using System; using System.Data; using System.Collections.Generic; using CallCenterApi.Model; namespace CallCenterApi.BLL { /// /// 1 /// public partial class T_Sys_AccessLog { private readonly CallCenterApi.DAL.T_Sys_AccessLog dal=new CallCenterApi.DAL.T_Sys_AccessLog(); public T_Sys_AccessLog() {} #region Method /// /// 得到最大ID /// public int GetMaxId() { return dal.GetMaxId(); } /// /// 是否存在该记录 /// public bool Exists(int F_CreateUserId) { return dal.Exists(F_CreateUserId); } /// /// 由id返回code /// //public string GetCodeById(int functionId) //{ // return dal.GetCodeById(functionId); //} /// /// 增加一条数据 /// public int Add(CallCenterApi.Model.T_Sys_AccessLog model) { return dal.Add(model); } /// /// 更新一条数据 /// public bool Update(CallCenterApi.Model.T_Sys_AccessLog model) { return dal.Update(model); } /// /// 删除一条数据 /// public bool Delete(int F_CreateUserId) { return dal.Delete(F_CreateUserId); } /// /// 删除一条数据 /// public bool DeleteList(string F_FunctionIdlist ) { return dal.DeleteList(F_FunctionIdlist ); } /// /// 得到一个对象实体 /// public CallCenterApi.Model.T_Sys_AccessLog GetModel(int F_CreateUserId) { return dal.GetModel(F_CreateUserId); } /// /// 得到一个对象实体,从缓存中 /// //public CallCenterApi.Model.T_Sys_AccessLog GetModelByCache(int F_CreateUserId) //{ // string CacheKey = "T_Sys_FunctionModel-" + F_CreateUserId; // object objModel = SZRX.Common.DataCache.GetCache(CacheKey); // if (objModel == null) // { // try // { // objModel = dal.GetModel(F_CreateUserId); // if (objModel != null) // { // int ModelCache = SZRX.Common.ConfigHelper.GetConfigInt("ModelCache"); // SZRX.Common.DataCache.SetCache(CacheKey, objModel, DateTime.Now.AddMinutes(ModelCache), TimeSpan.Zero); // } // } // catch{} // } // return (CallCenterApi.Model.T_Sys_AccessLog)objModel; //} /// /// 获得数据列表 /// public DataSet GetList(string strWhere) { return dal.GetList(strWhere); } /// /// 获得前几行数据 /// public DataSet GetList(int Top,string strWhere,string filedOrder) { return dal.GetList(Top,strWhere,filedOrder); } /// /// 获得数据列表 /// public List GetModelList(string strWhere) { DataSet ds = dal.GetList(strWhere); return DataTableToList(ds.Tables[0]); } /// /// 获得数据列表 /// public List DataTableToList(DataTable dt) { List modelList = new List(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { CallCenterApi.Model.T_Sys_AccessLog model; for (int n = 0; n < rowsCount; n++) { model = new CallCenterApi.Model.T_Sys_AccessLog(); if(dt.Rows[n]["F_CreateUserId"]!=null && dt.Rows[n]["F_CreateUserId"].ToString()!="") { model.F_CreateUserId=int.Parse(dt.Rows[n]["F_CreateUserId"].ToString()); } if(dt.Rows[n]["F_CreateDate"] !=null && dt.Rows[n]["F_CreateDate"].ToString()!="") { model.F_CreateDate= DateTime.Parse(dt.Rows[n]["F_CreateDate"].ToString()); } if(dt.Rows[n]["F_AccessType"] !=null && dt.Rows[n]["F_AccessType"].ToString()!="") { model.F_AccessType = dt.Rows[n]["F_AccessType"].ToString(); } if(dt.Rows[n]["F_BizFormId"] !=null && dt.Rows[n]["F_BizFormId"].ToString()!="") { model.F_BizFormId = int.Parse(dt.Rows[n]["F_BizFormId"].ToString()); } if(dt.Rows[n]["F_BizForm"] !=null && dt.Rows[n]["F_BizForm"].ToString()!="") { model.F_BizForm=dt.Rows[n]["F_BizForm"].ToString(); } if(dt.Rows[n]["F_Memo"] !=null && dt.Rows[n]["F_Memo"].ToString()!="") { model.F_Memo = dt.Rows[n]["F_Memo"].ToString(); } modelList.Add(model); } } return modelList; } /// /// 获得数据列表 /// public DataSet GetAllList() { return GetList(""); } public void AddAccessLog(string type, string bizName, int id, int userid) { dal.AddAccessLog(type, bizName, id, userid); } /// /// 分页获取数据列表 /// public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex) { return dal.GetListByPage(strWhere, orderby, startIndex, endIndex); } /// /// 分页获取数据列表 /// //public DataSet GetList(int PageSize,int PageIndex,string strWhere) //{ //return dal.GetList(PageSize,PageIndex,strWhere); //} #endregion Method } }