Пример #1
0
        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           = 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();
                model.Modules        = ModulesBusiness.GetModulesByClientID(clientID);
            }

            return(model);
        }
Пример #2
0
        /// <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);
        }