public static Clients GetClientDetail(string clientID) { DataTable dt = ClientDAL.BaseProvider.GetClientDetail(clientID); Clients model = new Clients(); if (dt.Rows.Count==1) { DataRow row=dt.Rows[0]; model.FillData(row); model.City = CommonBusiness.Citys.Where(c => c.CityCode == model.CityCode).FirstOrDefault(); model.IndustryEntity =Manage.IndustryBusiness.GetIndustrys().Where(i => i.IndustryID.ToLower() == model.Industry.ToLower()).FirstOrDefault(); model.Modules = ModulesBusiness.GetModulesByClientID(clientID); } return model; }
/// <summary> /// 获取客户端列表 /// </summary> /// <param name="keyWords"></param> /// <param name="pageSize"></param> /// <param name="pageIndex"></param> /// <param name="totalCount"></param> /// <param name="pageCount"></param> /// <returns></returns> public static List<Clients> GetClients(string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount) { DataTable dt = CommonBusiness.GetPagerData("Clients", "*", "Status<>9", "AutoID", pageSize, pageIndex, out totalCount, out pageCount); List<Clients> list = new List<Clients>(); Clients model; foreach (DataRow item in dt.Rows) { model = new Clients(); model.FillData(item); model.City = CommonCache.Citys.Where(c => c.CityCode == model.CityCode).FirstOrDefault(); model.IndustryEntity = IndustryBusiness.GetIndustryByClientID(AppSettings.Settings[AppSettingsWEB.Manage, "ClientID"]).Where(i => i.IndustryID.ToLower() == model.Industry.ToLower()).FirstOrDefault(); list.Add(model); } return list; }
/// <summary> /// 获取客户端列表 /// </summary> /// <param name="keyWords"></param> /// <param name="pageSize"></param> /// <param name="pageIndex"></param> /// <param name="totalCount"></param> /// <param name="pageCount"></param> /// <returns></returns> public static List<Clients> GetClients(string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount) { string whereSql = "Status<>9"; if (!string.IsNullOrEmpty(keyWords)) whereSql += " and ( CompanyName like '%" + keyWords + "%' or MobilePhone like '%" + keyWords + "%')"; DataTable dt = CommonBusiness.GetPagerData("Clients", "*", whereSql, "AutoID", pageSize, pageIndex, out totalCount, out pageCount); List<Clients> list = new List<Clients>(); Clients model; foreach (DataRow item in dt.Rows) { model = new Clients(); model.FillData(item); model.City = CommonBusiness.Citys.Where(c => c.CityCode == model.CityCode).FirstOrDefault(); model.IndustryEntity =Manage.IndustryBusiness.GetIndustrys().Where(i => i.IndustryID.ToLower() == model.Industry.ToLower()).FirstOrDefault(); list.Add(model); } return list; }