ASP.NET 2.0数据教程:在业务逻辑层添加方法
因为我们的程序架构使用了单独的一层来处理业务逻辑(业务逻辑层)和数据逻辑,我们需要在BLL里增加一个方法,该方法调用DAL的方法获取指定月份里雇用的员工。打开文件EmployeesBLL.cs并添加下面这个方法:
- [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, false)]
- public Northwind.EmployeesDataTable GetEmployeesByHiredDateMonth(int month)
- {
- return Adapter.GetEmployeesByHiredDateMonth(month);
- }
和此类里的其他方法一样,GetEmployeesByHiredDateMonth(month)仅仅是简单地调用DAL并返回结果。在业务逻辑层添加方法基本上都是这样。
【编辑推荐】
- ASP.NET 2.0数据教程:插入,更新和删除数据
- ASP.NET 2.0数据教程:给数据访问层添加参数化的方法
- ASP.NET 2.0数据教程:创建数据访问层
- ASP.NET 2.0数据教程:创建一个Web项目,配置数据库连接
- ASP.NET 2.0数据教程:给DataRow添加字段级验证
版权声明:
作者:后浪云
链接:https://www.idc.net/help/414616/
文章版权归作者所有,未经允许请勿转载。
THE END