//获取实体 public base_department QueryObject(base_department model) { IList <base_department> list = base_departmentdal.getbase_departmentList(model); if (list.Count > 0) { return(list[0]); } else { return(null); } }
//查询List public IList <base_department> getbase_departmentList(base_department model) { IList <base_department> list = new List <base_department>(); try { list = base_departmentdal.getbase_departmentList(model); } catch { list = null; } return(list); }
/// <summary> /// 返回总条数 /// </summary> /// <param name="model"></param> /// <returns></returns> public int GetRecordCount(base_department model) { return(base_departmentdal.GetRecordCount(model)); #region 缓存用法 //int totalItems = 0; //object obj = CacheHelper.GetCache("base_departmentBLL_GetRecordCount"); //key一定要设置的有规律不重复类名+方法名 //if (obj != null) //{ // totalItems = (int)obj; //} //else //{ // totalItems = base_departmentdal.GetRecordCount(model); // CacheHelper.SetCacheAbsolute("base_departmentBLL_GetRecordCount", totalItems);//写入服务器缓存 //} //return totalItems; #endregion }
public DataTable getQBdatatable(base_department model) { return(base_departmentdal.getQBdatatable(model)); #region 缓存用法 //DataTable dt = null; //object obj = CacheHelper.GetCache("base_departmentBLL_getPageList"); //key一定要设置的有规律不重复类名+方法名 //if (obj != null) //{ // dt = (DataTable)obj; //} //else //{ // dt = base_departmentdal.getPageList(model); // CacheHelper.SetCacheAbsolute("base_departmentBLL_getPageList", dt);//写入服务器缓存 //} //return dt; #endregion }
/// <summary> /// 更新 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool Update(base_department model) { return(base_departmentdal.Update(model)); }
/// <summary> /// 新增 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool Insert(base_department model) { return(base_departmentdal.Insert(model)); }