<% @ Codetemplate Language = "C #" targetlanguage = "T-SQL" DEBUG = "true" compilerversion = "v3.5" Description = "" %>
<% @ Assembly name = "schemaexplorer" %>
<% @ Property name = "sourcetable" type = "schemaexplorer. tableschema" Optional = "false" Category = "required" %>
<% @ Property name = "namespace" Optional = "false" type = "system. string "default =" beyondbit. app. entity "Category =" style "Description =" object namespace. "%>
//----------------------------------------------------------------
// Copyright (c) 2012 Shanghai Internet software Co., Ltd.
// All Rights Reserved.
// All Rights Reserved.
//
// File name: Bo <% = sourcetable. name %>. CS
// File function description:
//
//
// Create an ID: <% = datetime. Now. tostring ("yyyy-mm-dd hh: mm: SS") %>
//
// Modify the ID:
// Modify the description:
//----------------------------------------------------------------
Using system;
Using system. Collections. Generic;
Using system. text;
Using beyondbit. Framework. Biz;
Using beyondbit. Framework. biz. Bo;
Using beyondbit. Framework. Core. interceptorhandler;
Using beyondbit. Framework. dataaccess;
Using beyondbit. Framework. dataaccess. objectdao;
Using beyondbit. documentspare. Dao;
Using beyondbit. documentspare. entity;
Using system. Data;
Using beyondbit. Core. Common. tools;
<% --
Sourcetable. Columns [I]. extendedproperties []
= Cs_isrowguidcol
= Cs_isidentity
= Cs_iscomputed
= Cs_isdeterministic
= Cs_identityseed
= Cs_identityincrement
= Cs_default
= Cs_computeddefinition
= Cs_collation
= Cs_objectid
= Cs_systemtype
= Cs_usertype
= Ms_description
= Cs_description
-- %>
Namespace <% = namespace %> {
Public class Bo <% = sourcetable. name %>: basebo {
Private Dao <% = sourcetable. name %> Dao = NULL;
/// <Summary>
/// Initialization variable of the constructor
/// </Summary>
Public examplebo ()
{
Dao = New Dao <% = sourcetable. name %> ();
}
/// <Summary>
/// Add
/// </Summary>
/// <Param name = "entity"> </param>
[Frame (true, false)]
Public Virtual void insert (<% = sourcetable. name %> entity)
{
Try
{
Dao. insert (entity );
}
Catch (dalexception ex)
{
Throw new boexception ("An error occurred while calling the insert method of Bo <% = sourcetable. name %>! ", Ex );
}
}
/// <Summary>
/// Modify
/// </Summary>
/// <Param name = "entity"> </param>
[Frame (true, false)]
Public Virtual void Update (<% = sourcetable. name %> entity)
{
Try
{
Dao. Update (entity );
}
Catch (dalexception ex)
{
Throw new boexception ("An error occurred while calling the update method of Bo <% = sourcetable. name %>! ", Ex );
}
}
/// <Summary>
/// Delete
/// </Summary>
/// <Param name = "entity"> </param>
[Frame (True, true)]
Public Virtual bool Delete (<% = sourcetable. name %> entity)
{
Try
{
Return Dao. deleteitem (entity. ID );
}
Catch (dalexception ex)
{
Throw new boexception ("An error occurred while calling the delete method of Bo <% = sourcetable. name %>! ", Ex );
}
}
/// <Summary>
///
/// </Summary>
/// <Param name = "ID"> </param>
/// <Returns> </returns>
[Frame (true, false)]
Public Virtual <% = sourcetable. name %> get (int id)
{
Try
{
Return Dao. Get (ID );
}
Catch (dalexception ex)
{
Throw new boexception ("An error occurred while calling the get method of Bo <% = sourcetable. name %>! ", Ex );
}
}
/// <Summary>
///
/// </Summary>
/// <Param name = "psearch"> </param>
/// <Param name = "strcondition"> </param>
/// <Returns> </returns>
[Frame (true, false)]
Public Virtual splitpageresult <% = sourcetable. name %> queryexampleinfo (pagesearch psearch, string strcondition)
{
Try
{
Return Dao. query <% = sourcetable. name %> (psearch, strcondition );
}
Catch (dalexception ex)
{
Throw new boexception ("An error occurred while calling the query <% = sourcetable. name %> of Bo <% = sourcetable. name %>! ", Ex );
}
}
}
}