public static Industry GetIndustryDetail(string id) { var list = GetIndustrys(); if (list.Where(m => m.IndustryID == id).Count() > 0) { return list.Where(m => m.IndustryID == id).FirstOrDefault(); } Industry model = new Industry(); DataTable dt = new IndustryDAL().GetIndustryDetail(id); if (dt.Rows.Count > 0) { model.FillData(dt.Rows[0]); IndustryBusiness.Industrys.Add(model); } return model; }
/// <summary> /// 获取行业列表 /// </summary> /// <param name="clientid"></param> /// <returns></returns> public static List<Industry> GetIndustrys() { if (IndustryBusiness.Industrys != null && IndustryBusiness.Industrys.Count > 0) { return IndustryBusiness.Industrys; } else { List<Industry> list = new List<Industry>(); DataTable dt = new IndustryDAL().GetIndustrys(); foreach (DataRow item in dt.Rows) { Industry model = new Industry(); model.FillData(item); list.Add(model); } IndustryBusiness.Industrys = list; return list; } }