BLL層
<%@ CodeTemplate Language=
<%@ Assembly Name=
<%@ Assembly Name=
<%@ Property Name=
<%@ Property Name=
<%@ Property Name=
<%@ Property Name=
<%@ Map Name=
<%@ Import Namespace=
<%@ Import Namespace=
/*
* File Name: <%= GetTableName(TargetTable) %>Bll
*
* Create Author: <%= Author %>
*
* Create DateTime: <%=DateTime
*
* Description: <%= Description %>
*
using System;
using System
using System
using System
namespace <%= NameSpace %>
{
public class <%= GetTableName(TargetTable) %>Bll
{
private static readonly <%= GetTableName(TargetTable) %>Bll _classinstance = new <%= GetTableName(TargetTable) %>Bll();
public static <%= GetTableName(TargetTable) %>Bll ClassInstance {get{return _classinstance; }}
/// <summary>
/// Add Record
/// </summary>
public int Insert_<%= GetTableName(TargetTable) %>(<%= GetTableName(TargetTable) %>Model instance)
{
return <%= GetTableName(TargetTable) %>Dal
}
/// <summary>
/// Delete Record
/// </summary>
public int Delete_<%= GetTableName(TargetTable) %>(String pkid)
{
return <%= GetTableName(TargetTable) %>Dal
}
/// <summary>
/// Update Record
/// </summary>
public int Update_<%= GetTableName(TargetTable) %>(<%= GetTableName(TargetTable) %>Model instance)
{
return <%= GetTableName(TargetTable) %>Dal
}
/// <summary>
/// Get Record By Primary Key
/// </summary>
public <%= GetTableName(TargetTable) %>Model Get_<%= GetTableName(TargetTable) %>ByPKID(String pkid)
{
return <%= GetTableName(TargetTable) %>Dal
}
/// <summary>
/// Get Total Record Number
/// </summary>
public Int
{
return <%= GetTableName(TargetTable) %>Dal
}
/// <summary>
/// Get Record With Split Page
/// </summary>
public List<<%= GetTableName(TargetTable) %>Model> Get_<%= GetTableName(TargetTable) %>ByWhere
(
String tablename
String column
String swhere
String sorder
String ordertype
Int
Int
)
{
return <%= GetTableName(TargetTable) %>Dal
}
}
}
<script runat=
//Get tablename
public string GetTableName(TableSchema table)
{
if(table==null)
{
return null;
}
return table
}
</script>
From:http://tw.wingwit.com/Article/program/net/201311/11682.html