本系列目录:ASP.NET MVC4入门到精通系列目录汇总
在上一篇中,我们已经把项目的基本框架搭起来了,这一篇我们就来实现业务层和数据层的父接口及父类。
1、我们先来定义一个业务层父接口IBaseBLL.cs

using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; namespace IBLL { ////// 业务父 接口 /// /// public interface IBaseBLL where T:class,new() { //定义 增删改查 方法 #region 1.0 新增 实体 +int Add(T model) /// /// 新增 实体 /// /// /// int Add(T model); #endregion #region 2.0 根据 id 删除 +int Del(T model) /// /// 根据 id 删除 /// /// 包含要删除id的对象 /// int Del(T model); #endregion #region 3.0 根据条件删除 +int DelBy(Expression > delWhere) /// /// 3.0 根据条件删除 /// /// /// int DelBy(Expression bool>> delWhere); #endregion #region 4.0 修改 +int Modify(T model, params string[] proNames) /// /// 4.0 修改,如: /// T u = new T() { uId = 1, uLoginName = "asdfasdf" }; /// this.Modify(u, "uLoginName"); /// /// 要修改的实体对象 /// 要修改的 属性 名称 /// int Modify(T model, params string[] proNames); #endregion #region 4.0 批量修改 +int Modify(T model, Expression > whereLambda, params string[] modifiedProNames) /// /// 4.0 批量修改 /// /// 要修改的实体对象 /// 查询条件 /// 要修改的 属性 名称 /// int ModifyBy(T model, Expression bool>> whereLambda, params string[] modifiedProNames); #endregion #region 5.0 根据条件查询 +List GetListBy(Expression > whereLambda) /// /// 5.0 根据条件查询 +List GetListBy(Expression > whereLambda) /// /// /// List GetListBy(Expression bool>> whereLambda); #endregion #region 5.1 根据条件 排序 和查询 + List GetListBy /// /// 5.1 根据条件 排序 和查询 /// /// 排序字段类型 /// 查询条件 lambda表达式 /// 排序条件 lambda表达式 /// List GetListBy (Expression bool>> whereLambda, Expression > orderLambda); #endregion #region 6.0 分页查询 + List GetPagedList /// /// 6.0 分页查询 + List GetPagedList /// /// 页码 /// 页容量 /// 条件 lambda表达式 /// 排序 lambda表达式 /// List GetPagedList (int pageIndex, int pageSize, Expression bool>> whereLambda, Expression > orderBy); #endregion } }
2、定义一个数据层父接口IBaseDAL.cs

using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; namespace IDAL { ////// 数据层父接口 /// public interface IBaseDAL where T:class ,new() { //定义增删改查方法 #region 1.0 新增 实体 +int Add(T model) /// /// 新增 实体 /// /// /// int Add(T model); #endregion #region 2.0 根据 id 删除 +int Del(T model) /// /// 根据 id 删除 /// /// 包含要删除id的对象 /// int Del(T model); #endregion #region 3.0 根据条件删除 +int DelBy(Expression > delWhere) /// /// 3.0 根据条件删除 /// /// /// int DelBy(Expression bool>> delWhere); #endregion #region 4.0 修改 +int Modify(T model, params string[] proNames) /// /// 4.0 修改,如: /// T u = new T() { uId = 1, uLoginName = "asdfasdf" }; /// this.Modify(u, "uLoginName"); /// /// 要修改的实体对象 /// 要修改的 属性 名称 /// int Modify(T model, params string[] proNames); #endregion #region 4.0 批量修改 +int Modify(T model, Expression > whereLambda, params string[] modifiedProNames) /// /// 4.0 批量修改 /// /// 要修改的实体对象 /// 查询条件 /// 要修改的 属性 名称 /// int ModifyBy(T model, Expression bool>> whereLambda, params string[] modifiedProNames); #endregion #region 5.0 根据条件查询 +List GetListBy(Expression > whereLambda) /// /// 5.0 根据条件查询 +List GetListBy(Expression > whereLambda) /// /// /// List GetListBy(Expression bool>> whereLambda); #endregion #region 5.1 根据条件 排序 和查询 + List GetListBy /// /// 5.1 根据条件 排序 和查询 /// /// 排序字段类型 /// 查询条件 lambda表达式 /// 排序条件 lambda表达式 /// List GetListBy (Expression bool>> whereLambda, Expression > orderLambda); #endregion #region 6.0 分页查询 + List GetPagedList /// /// 6.0 分页查询 + List GetPagedList /// /// 页码 /// 页容量 /// 条件 lambda表达式 /// 排序 lambda表达式 /// List GetPagedList (int pageIndex, int pageSize, Expression bool>> whereLambda, Expression > orderBy); #endregion } }
3、我们数据库中有许多的表,通常每一张表都对应一个业务实体,如果我们每一个业务实体类都自己去手写的话,太浪费时间了,我们可以使用T4模板,简化这些枯燥的操作,提高我们的开发效率。
新建一个文本模板
然后把以下代码复制上去,

<#@ template language="C#" debug="false" hostspecific="true"#> <#@ include file="EF.Utility.CS.ttinclude"#><#@ output extension=".cs"#> <# CodeGenerationTools code = new CodeGenerationTools(this); MetadataLoader loader = new MetadataLoader(this); CodeRegion region = new CodeRegion(this, 1); MetadataTools ef = new MetadataTools(this); string inputFile = @"..\MODEL\OA.edmx"; EdmItemCollection ItemCollection = loader.CreateEdmItemCollection(inputFile); string namespaceName = code.VsNamespaceSuggestion(); EntityFrameworkTemplateFileManager fileManager = EntityFrameworkTemplateFileManager.Create(this); #> using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace IBLL { <# // Emit Entity Types foreach (EntityType entity in ItemCollection.GetItems().OrderBy(e => e.Name)) { //fileManager.StartNewFile(entity.Name + "RepositoryExt.cs"); //BeginNamespace(namespaceName, code); #> public partial interface I<#=entity.Name#>BLL : IBaseBLL > { } <#}#> }
当然,你也可以使用NuGet安装tangibleT4EditorPlusModellingToolsVS2012,安装完成后,按照如下的方式添加T4模板
按Ctrl+S自动生成代码,自动生成的IBLL.cs如下:

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace IBLL { public partial interface IBill_LeaveBLL : IBaseBLL{ } public partial interface IoldWF_AutoTransactNodeBLL : IBaseBLL { } public partial interface IoldWF_BillFlowNodeBLL : IBaseBLL { } public partial interface IoldWF_BillFlowNodeRemarkBLL : IBaseBLL { } public partial interface IoldWF_BillStateBLL : IBaseBLL { } public partial interface IoldWF_NodeBLL : IBaseBLL { } public partial interface IoldWF_NodeStateBLL : IBaseBLL { } public partial interface IoldWF_WorkFlowBLL : IBaseBLL { } public partial interface IoldWF_WorkFlowNodeBLL : IBaseBLL { } public partial interface IOu_DepartmentBLL : IBaseBLL { } public partial interface IOu_PermissionBLL : IBaseBLL { } public partial interface IOu_RoleBLL : IBaseBLL { } public partial interface IOu_RolePermissionBLL : IBaseBLL { } public partial interface IOu_UserInfoBLL : IBaseBLL { } public partial interface IOu_UserRoleBLL : IBaseBLL { } public partial interface IOu_UserVipPermissionBLL : IBaseBLL { } public partial interface IW_WorkFlowBLL : IBaseBLL { } public partial interface IW_WorkFlowBranchBLL : IBaseBLL { } public partial interface IW_WorkFlowNodeBLL : IBaseBLL { } public partial interface IW_WrokFlowRoleBLL : IBaseBLL { } public partial interface IWR_WorkFlowApplyBLL : IBaseBLL { } public partial interface IWR_WrokFlowApplyDetailsBLL : IBaseBLL { } }
4、把IBLL.tt拷贝到IDAL项目下,然后修改命名空间为IDAL,修改接口声明模板
namespace IDAL public partial interface I<#=entity.Name#>DAL : IBaseDAL>
按Ctrl+S自动生成代码,自动生成的IDAL.cs如下:

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace IDAL { public partial interface IBill_LeaveDAL : IBaseDAL{ } public partial interface IoldWF_AutoTransactNodeDAL : IBaseDAL { } public partial interface IoldWF_BillFlowNodeDAL : IBaseDAL { } public partial interface IoldWF_BillFlowNodeRemarkDAL : IBaseDAL { } public partial interface IoldWF_BillStateDAL : IBaseDAL { } public partial interface IoldWF_NodeDAL : IBaseDAL { } public partial interface IoldWF_NodeStateDAL : IBaseDAL { } public partial interface IoldWF_WorkFlowDAL : IBaseDAL { } public partial interface IoldWF_WorkFlowNodeDAL : IBaseDAL { } public partial interface IOu_DepartmentDAL : IBaseDAL { } public partial interface IOu_PermissionDAL : IBaseDAL { } public partial interface IOu_RoleDAL : IBaseDAL { } public partial interface IOu_RolePermissionDAL : IBaseDAL { } public partial interface IOu_UserInfoDAL : IBaseDAL { } public partial interface IOu_UserRoleDAL : IBaseDAL { } public partial interface IOu_UserVipPermissionDAL : IBaseDAL { } public partial interface IW_WorkFlowDAL : IBaseDAL { } public partial interface IW_WorkFlowBranchDAL : IBaseDAL { } public partial interface IW_WorkFlowNodeDAL : IBaseDAL { } public partial interface IW_WrokFlowRoleDAL : IBaseDAL { } public partial interface IWR_WorkFlowApplyDAL : IBaseDAL { } public partial interface IWR_WrokFlowApplyDetailsDAL : IBaseDAL { } }
注意,我这里生成的所有接口都是partial类型的,这样我以后可以很方便的进行扩展
关于T4模板的使用不在本篇所讲的范畴,有兴趣的朋友,可以查找相关资料学习,我这里只做简要说明。
<#@ include file="EF.Utility.CS.ttinclude"#>:引入微软的生成框架
<#@ output extension=".cs"#>:指定生成的文件类型为.cs文件
string inputFile = @"..\MODEL\OA.edmx":这里使用相对路径指向我们新建的ADO.NET实体数据模型文件。
5、添加数据层的父类BaseDAL.cs
前面数据层接口和业务层接口都已经添加好了,那么现在来添加数据层类和业务层类
在DAL项目中添加EntityFramework.dll和System.Data.Entity.dll的引用

using System; using System.Collections.Generic; using System.Data.Entity; using System.Data.Entity.Infrastructure; using System.Linq; using System.Linq.Expressions; using System.Reflection; using System.Text; using Model; namespace DAL { ////// 数据层 父类 /// /// public class BaseDAL : IDAL.IBaseDAL where T : class,new() { /// /// EF上下文对象 /// DbContext db = new OAEntities(); //new DBContextFactory().GetDbContext();// #region 1.0 新增 实体 +int Add(T model) /// /// 新增 实体 /// /// /// public int Add(T model) { db.Set ().Add(model); return db.SaveChanges();//保存成功后,会将自增的id设置给 model的 主键属性,并返回受影响行数 } #endregion #region 2.0 根据 id 删除 +int Del(T model) /// /// 根据 id 删除 /// /// 包含要删除id的对象 /// public int Del(T model) { db.Set ().Attach(model); db.Set ().Remove(model); return db.SaveChanges(); } #endregion #region 3.0 根据条件删除 +int DelBy(Expression > delWhere) /// /// 3.0 根据条件删除 /// /// /// public int DelBy(Expression bool>> delWhere) { //3.1查询要删除的数据 List listDeleting = db.Set ().Where(delWhere).ToList(); //3.2将要删除的数据 用删除方法添加到 EF 容器中 listDeleting.ForEach(u => { db.Set ().Attach(u);//先附加到 EF容器 db.Set ().Remove(u);//标识为 删除 状态 }); //3.3一次性 生成sql语句到数据库执行删除 return db.SaveChanges(); } #endregion #region 4.0 修改 +int Modify(T model, params string[] proNames) /// /// 4.0 修改,如: /// T u = new T() { uId = 1, uLoginName = "asdfasdf" }; /// this.Modify(u, "uLoginName"); /// /// 要修改的实体对象 /// 要修改的 属性 名称 /// public int Modify(T model, params string[] proNames) { //4.1将 对象 添加到 EF中 DbEntityEntry entry = db.Entry (model); //4.2先设置 对象的包装 状态为 Unchanged entry.State = System.Data.EntityState.Unchanged; //4.3循环 被修改的属性名 数组 foreach (string proName in proNames) { //4.4将每个 被修改的属性的状态 设置为已修改状态;后面生成update语句时,就只为已修改的属性 更新 entry.Property(proName).IsModified = true; } //4.4一次性 生成sql语句到数据库执行 return db.SaveChanges(); } #endregion #region 4.0 批量修改 +int Modify(T model, Expression > whereLambda, params string[] modifiedProNames) /// /// 4.0 批量修改 /// /// 要修改的实体对象 /// 查询条件 /// 要修改的 属性 名称 /// public int ModifyBy(T model, Expression bool>> whereLambda, params string[] modifiedProNames) { //4.1查询要修改的数据 List listModifing = db.Set ().Where(whereLambda).ToList(); //获取 实体类 类型对象 Type t = typeof(T); // model.GetType(); //获取 实体类 所有的 公有属性 List proInfos = t.GetProperties(BindingFlags.Instance | BindingFlags.Public).ToList(); //创建 实体属性 字典集合 Dictionary<string, PropertyInfo> dictPros = new Dictionary<string, PropertyInfo>(); //将 实体属性 中要修改的属性名 添加到 字典集合中 键:属性名 值:属性对象 proInfos.ForEach(p => { if (modifiedProNames.Contains(p.Name)) { dictPros.Add(p.Name, p); } }); //4.3循环 要修改的属性名 foreach (string proName in modifiedProNames) { //判断 要修改的属性名是否在 实体类的属性集合中存在 if (dictPros.ContainsKey(proName)) { //如果存在,则取出要修改的 属性对象 PropertyInfo proInfo = dictPros[proName]; //取出 要修改的值 object newValue = proInfo.GetValue(model, null); //object newValue = model.uName; //4.4批量设置 要修改 对象的 属性 foreach (T usrO in listModifing) { //为 要修改的对象 的 要修改的属性 设置新的值 proInfo.SetValue(usrO, newValue, null); //usrO.uName = newValue; } } } //4.4一次性 生成sql语句到数据库执行 return db.SaveChanges(); } #endregion #region 5.0 根据条件查询 +List GetListBy(Expression > whereLambda) /// /// 5.0 根据条件查询 +List GetListBy(Expression > whereLambda) /// /// /// public List GetListBy(Expression bool>> whereLambda) { return db.Set ().Where(whereLambda).ToList(); } #endregion #region 5.1 根据条件 排序 和查询 + List GetListBy /// /// 5.1 根据条件 排序 和查询 /// /// 排序字段类型 /// 查询条件 lambda表达式 /// 排序条件 lambda表达式 /// public List GetListBy (Expression bool>> whereLambda, Expression > orderLambda) { return db.Set ().Where(whereLambda).OrderBy(orderLambda).ToList(); } #endregion #region 6.0 分页查询 + List GetPagedList /// /// 6.0 分页查询 + List GetPagedList /// /// 页码 /// 页容量 /// 条件 lambda表达式 /// 排序 lambda表达式 /// public List GetPagedList (int pageIndex, int pageSize, Expression bool>> whereLambda, Expression > orderBy) { // 分页 一定注意: Skip 之前一定要 OrderBy return db.Set ().Where(whereLambda).OrderBy(orderBy).Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList(); } #endregion } }
6、拷贝IDAL.tt到DAL项目中,改名为DAL.tt,然后修改T4模板
按Ctrl+S自动生成代码,自动生成的DAL.cs如下:

using System; using System.Collections.Generic; using System.Linq; using System.Text; using IDAL; namespace DAL { public partial class Bill_LeaveDAL : BaseDAL,IBill_LeaveDAL { } public partial class oldWF_AutoTransactNodeDAL : BaseDAL ,IoldWF_AutoTransactNodeDAL { } public partial class oldWF_BillFlowNodeDAL : BaseDAL ,IoldWF_BillFlowNodeDAL { } public partial class oldWF_BillFlowNodeRemarkDAL : BaseDAL ,IoldWF_BillFlowNodeRemarkDAL { } public partial class oldWF_BillStateDAL : BaseDAL ,IoldWF_BillStateDAL { } public partial class oldWF_NodeDAL : BaseDAL ,IoldWF_NodeDAL { } public partial class oldWF_NodeStateDAL : BaseDAL ,IoldWF_NodeStateDAL { } public partial class oldWF_WorkFlowDAL : BaseDAL ,IoldWF_WorkFlowDAL { } public partial class oldWF_WorkFlowNodeDAL : BaseDAL ,IoldWF_WorkFlowNodeDAL { } public partial class Ou_DepartmentDAL : BaseDAL ,IOu_DepartmentDAL { } public partial class Ou_PermissionDAL : BaseDAL ,IOu_PermissionDAL { } public partial class Ou_RoleDAL : BaseDAL ,IOu_RoleDAL { } public partial class Ou_RolePermissionDAL : BaseDAL ,IOu_RolePermissionDAL { } public partial class Ou_UserInfoDAL : BaseDAL ,IOu_UserInfoDAL { } public partial class Ou_UserRoleDAL : BaseDAL ,IOu_UserRoleDAL { } public partial class Ou_UserVipPermissionDAL : BaseDAL ,IOu_UserVipPermissionDAL { } public partial class W_WorkFlowDAL : BaseDAL ,IW_WorkFlowDAL { } public partial class W_WorkFlowBranchDAL : BaseDAL ,IW_WorkFlowBranchDAL { } public partial class W_WorkFlowNodeDAL : BaseDAL ,IW_WorkFlowNodeDAL { } public partial class W_WrokFlowRoleDAL : BaseDAL ,IW_WrokFlowRoleDAL { } public partial class WR_WorkFlowApplyDAL : BaseDAL ,IWR_WorkFlowApplyDAL { } public partial class WR_WrokFlowApplyDetailsDAL : BaseDAL ,IWR_WrokFlowApplyDetailsDAL { } }
7、BLL项目中添加业务层的父类BaseBLL.cs,在业务父类中只能调用数据库父类接口,所以可以通过一个抽象方法,让子类来实现数据库对象的实例化操作。

using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; using System.Reflection; namespace BLL { ////// 业务层父类 /// /// public abstract class BaseBLL : IBLL.IBaseBLL where T : class,new() { public BaseBLL() { SetDAL(); } //1.数据层接口 对象 - 等待 被实例化 protected IDAL.IBaseDAL idal;// = new idal.BaseDAL(); /// /// 由子类实现,为 业务父类 里的 数据接口对象 设置 值! /// public abstract void SetDAL(); //2.增删改查方法 #region 1.0 新增 实体 +int Add(T model) /// /// 新增 实体 /// /// /// public int Add(T model) { return idal.Add(model); } #endregion #region 2。0 根据 用户 id 删除 +int Del(int uId) /// /// 根据 用户 id 删除 /// /// /// public int Del(T model) { return idal.Del(model); } #endregion #region 3.0 根据条件删除 +int DelBy(Expression > delWhere) /// /// 3.0 根据条件删除 /// /// /// public int DelBy(Expression bool>> delWhere) { return idal.DelBy(delWhere); } #endregion #region 4.0 修改 +int Modify(T model, params string[] proNames) /// /// 4.0 修改,如: /// /// 要修改的实体对象 /// 要修改的 属性 名称 /// public int Modify(T model, params string[] proNames) { return idal.Modify(model, proNames); } #endregion #region 4.0 批量修改 +int Modify(T model, Expression > whereLambda, params string[] modifiedProNames) /// /// 4.0 批量修改 +int Modify(T model, Expression > whereLambda, params string[] modifiedProNames) /// /// /// /// /// public int ModifyBy(T model, Expression bool>> whereLambda, params string[] modifiedProNames) { return idal.ModifyBy(model, whereLambda, modifiedProNames); } #endregion #region 5.0 根据条件查询 +List GetListBy(Expression > whereLambda) /// /// 5.0 根据条件查询 +List GetListBy(Expression > whereLambda) /// /// /// public List GetListBy(Expression bool>> whereLambda) { return idal.GetListBy(whereLambda); } #endregion #region 5.1 根据条件 排序 和查询 + List GetListBy /// /// 5.1 根据条件 排序 和查询 /// /// 排序字段类型 /// 查询条件 lambda表达式 /// 排序条件 lambda表达式 /// public List GetListBy (Expression bool>> whereLambda, Expression > orderLambda) { return idal.GetListBy(whereLambda, orderLambda); } #endregion #region 6.0 分页查询 + List GetPagedList /// /// 6.0 分页查询 + List GetPagedList /// /// 页码 /// 页容量 /// 条件 lambda表达式 /// 排序 lambda表达式 /// public List GetPagedList (int pageIndex, int pageSize, Expression bool>> whereLambda, Expression > orderBy) { return idal.GetPagedList(pageIndex, pageSize, whereLambda, orderBy); } #endregion } }
8、同样的拷贝IBLL.tt到BLL项目下,重命名为BLL.tt,然后修改T4模板
public override void SetDAL() { idal = DBSession.I<#=entity.Name#>DAL; }
按Ctrl+S自动生成代码,自动生成的BLL.cs如下:

using System; using System.Collections.Generic; using System.Linq; using System.Text; using IBLL; namespace BLL { public partial class Bill_LeaveBLL : BaseBLL,IBill_LeaveBLL { public override void SetDAL() { idal= DBSession.IBill_LeaveDAL; } } public partial class oldWF_AutoTransactNodeBLL : BaseBLL ,IoldWF_AutoTransactNodeBLL { public override void SetDAL() { idal= DBSession.IoldWF_AutoTransactNodeDAL; } } public partial class oldWF_BillFlowNodeBLL : BaseBLL ,IoldWF_BillFlowNodeBLL { public override void SetDAL() { idal= DBSession.IoldWF_BillFlowNodeDAL; } } public partial class oldWF_BillFlowNodeRemarkBLL : BaseBLL ,IoldWF_BillFlowNodeRemarkBLL { public override void SetDAL() { idal= DBSession.IoldWF_BillFlowNodeRemarkDAL; } } public partial class oldWF_BillStateBLL : BaseBLL ,IoldWF_BillStateBLL { public override void SetDAL() { idal= DBSession.IoldWF_BillStateDAL; } } public partial class oldWF_NodeBLL : BaseBLL ,IoldWF_NodeBLL { public override void SetDAL() { idal= DBSession.IoldWF_NodeDAL; } } public partial class oldWF_NodeStateBLL : BaseBLL ,IoldWF_NodeStateBLL { public override void SetDAL() { idal= DBSession.IoldWF_NodeStateDAL; } } public partial class oldWF_WorkFlowBLL : BaseBLL ,IoldWF_WorkFlowBLL { public override void SetDAL() { idal= DBSession.IoldWF_WorkFlowDAL; } } public partial class oldWF_WorkFlowNodeBLL : BaseBLL ,IoldWF_WorkFlowNodeBLL { public override void SetDAL() { idal= DBSession.IoldWF_WorkFlowNodeDAL; } } public partial class Ou_DepartmentBLL : BaseBLL ,IOu_DepartmentBLL { public override void SetDAL() { idal= DBSession.IOu_DepartmentDAL; } } public partial class Ou_PermissionBLL : BaseBLL ,IOu_PermissionBLL { public override void SetDAL() { idal= DBSession.IOu_PermissionDAL; } } public partial class Ou_RoleBLL : BaseBLL ,IOu_RoleBLL { public override void SetDAL() { idal= DBSession.IOu_RoleDAL; } } public partial class Ou_RolePermissionBLL : BaseBLL ,IOu_RolePermissionBLL { public override void SetDAL() { idal= DBSession.IOu_RolePermissionDAL; } } public partial class Ou_UserInfoBLL : BaseBLL ,IOu_UserInfoBLL { public override void SetDAL() { idal= DBSession.IOu_UserInfoDAL; } } public partial class Ou_UserRoleBLL : BaseBLL ,IOu_UserRoleBLL { public override void SetDAL() { idal= DBSession.IOu_UserRoleDAL; } } public partial class Ou_UserVipPermissionBLL : BaseBLL ,IOu_UserVipPermissionBLL { public override void SetDAL() { idal= DBSession.IOu_UserVipPermissionDAL; } } public partial class W_WorkFlowBLL : BaseBLL ,IW_WorkFlowBLL { public override void SetDAL() { idal= DBSession.IW_WorkFlowDAL; } } public partial class W_WorkFlowBranchBLL : BaseBLL ,IW_WorkFlowBranchBLL { public override void SetDAL() { idal= DBSession.IW_WorkFlowBranchDAL; } } public partial class W_WorkFlowNodeBLL : BaseBLL ,IW_WorkFlowNodeBLL { public override void SetDAL() { idal= DBSession.IW_WorkFlowNodeDAL; } } public partial class W_WrokFlowRoleBLL : BaseBLL ,IW_WrokFlowRoleBLL { public override void SetDAL() { idal= DBSession.IW_WrokFlowRoleDAL; } } public partial class WR_WorkFlowApplyBLL : BaseBLL ,IWR_WorkFlowApplyBLL { public override void SetDAL() { idal= DBSession.IWR_WorkFlowApplyDAL; } } public partial class WR_WrokFlowApplyDetailsBLL : BaseBLL ,IWR_WrokFlowApplyDetailsBLL { public override void SetDAL() { idal= DBSession.IWR_WrokFlowApplyDetailsDAL; } } }
到此,业务父类、业务类、数据父类、数据类都已经创建好了,里面有些东西还需要优化的,后续一步一步完善。