/** * OA_DriverRecordBLL.cs * * 功 能: 合作客户业务逻辑类 * 类 名: OA_DriverRecordBLL * * Ver 变更日期 负责人 变更内容 * ─────────────────────────────────── * V0.01 2013-4-2 15:11 吴辉 初版 * V0.02 2013-5-29 17:43 吴崎均 增加转换在线会员为厂商客户方法 * * * * * * */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using CY.IDAL; using CY.Model; using AbstractFactory; using CY.IBaseDAL; using CY.Infrastructure.DESEncrypt; using CY.Infrastructure.Query; namespace CY.BLL { public class OA_DriverRecordBLL { IOA_DriverRecordDAL _IOA_DriverRecordDAL = null; /// /// 初始化构造 /// public OA_DriverRecordBLL() { //获取OA_DriverRecord DAL实现 _IOA_DriverRecordDAL = Factory.GetDALByInterfaceName(DALInterface.IOA_DriverRecordDAL) as IOA_DriverRecordDAL; } /// /// 获取全部合作客户 /// /// 主键id /// public IEnumerable GetModelList() { Query query = new Query(); return _IOA_DriverRecordDAL.SelectAllModel(query); } /// /// 获取全部合作客户 /// /// 主键id /// public OA_DriverRecord GetModelByKeyid(Guid keyid) { return _IOA_DriverRecordDAL.GetModelByKeyid(keyid); } /// /// 查询合作客户分页列表 /// /// /// public IEnumerable SelectModelPage(Pagination pa, string CreatTimeStart, string CreatTimeEnd, string CarID, string CreaterName,string ClockType) { string Condition = " "; string sort = " CreatTime desc "; if (!string.IsNullOrEmpty(CreatTimeStart)) { Condition += " and DATEDIFF(day,'" + CreatTimeStart + "',od.[CreatTime]) >= 0 "; } if (!string.IsNullOrEmpty(CreatTimeEnd)) { Condition += " and DATEDIFF(day,'" + CreatTimeEnd + "',od.[CreatTime]) <= 0 "; } if (!string.IsNullOrEmpty(CarID)) Condition += " and od.CarID = " + CarID + ""; if (!string.IsNullOrEmpty(ClockType)) Condition += " and od.ClockType = " + ClockType + ""; if (!string.IsNullOrEmpty(CreaterName)) Condition += " and od.Creater like '%" + CreaterName + "%'"; Query query = new Query(); IList criterias = new List() { new Criterion("", Condition), new Criterion("orderBy",sort) }; query.Criteria = criterias; return _IOA_DriverRecordDAL.SelectModelPage(query, pa); } } }