// GET: Procedures public ActionResult Index() { var models = new CMS_ProceduresViewModels(); try { var data = _facProce.GetList(); if (data != null && data.Any()) { models.ListProcedures = data.Where(o => o.IsActive).GroupBy(o => new { o.CategoryId, o.CategoryName, o.CateSequence }) .OrderBy(o => o.Key.CateSequence) .Select(s => new CMS_ProceduresModels { CategoryId = s.Key.CategoryId, CategoryName = s.Key.CategoryName, ListProceduresDTOChild = data.OrderBy(o => o.ProceduresName).Where(w => w.CategoryId == s.Key.CategoryId).ToList(), }).ToList(); } models.LstDiscount = _facDis.GetList(true); } catch (Exception ex) { NSLog.Logger.Error("Procedures_Index", ex); } return(View(models)); }
public ActionResult LoadGrid() { var model = _factory.GetList(); model.ForEach(x => { x.sStatus = x.IsActive ? "Kích hoạt" : "Chưa kích hoạt"; }); return(PartialView("_ListData", model)); }
// GET: Clients/Home public ActionResult Index() { try { ProductViewModels model = new ProductViewModels(); //Company model.Company = _facCom.GetList().FirstOrDefault(); //Category model.ListCate = _facCate.GetList().Where(o => o.ProductTypeCode == (int)Commons.EProductType.Procudure).OrderByDescending(x => x.CreatedDate).Skip(0).Take(3).ToList(); //Product var productType = (byte)Commons.EProductType.Product; model.ListProduct = _fac.GetList(productType).Where(o => !string.IsNullOrEmpty(o.ImageURL)).OrderByDescending(x => x.CreatedDate).Skip(0).Take(8).ToList(); //Procedures model.ListProcedures = _facProce.GetList().OrderBy(o => o.CreatedDate).Skip(0).Take(3).ToList(); //News model.ListNews = _facNews.GetList().OrderByDescending(x => x.CreatedDate).Skip(0).Take(3).ToList(); if (model.ListNews != null && model.ListNews.Any()) { model.ListNews.ForEach(x => { if (!string.IsNullOrEmpty(x.ImageURL)) { x.ImageURL = "~/Uploads/News/" + x.ImageURL; } }); } model.ListEmployee = _facEmp.GetList().OrderBy(o => o.CreatedDate).Skip(0).Take(10).ToList(); if (model.ListEmployee != null) { model.ListEmployee.ForEach(o => { o.ImageURL = !string.IsNullOrEmpty(o.ImageURL) ? Commons._PublicImages + "Employees/" + o.ImageURL : Commons._ImageDefault; }); } model.LstDiscount = _facDis.GetList(true); return(View(model)); } catch (Exception ex) { // NSLog.Logger.Error("Index: ", ex); return(new HttpStatusCodeResult(400, ex.Message)); } }
public HQController() { var _Path = HostingEnvironment.MapPath("~/Uploads/Silder/"); var list = Directory.GetFiles(_Path).Select(x => Path.GetFileName(x)).ToList(); var ListSlider = new List <SliderSession>(); if (list != null && list.Count > 0) { for (var i = 0; i < list.Count; i++) { ListSlider.Add(new SliderSession { ImageUrl = "~/Uploads/Silder/" + list[i] }); } } System.Web.HttpContext.Current.Session["SliderSession"] = ListSlider; //For Procedures CMSProcedureFactory _facPro = new CMSProcedureFactory(); var ListProce = new List <ProcedureUI>(); var LstPro = _facPro.GetList(); if (LstPro != null && LstPro.Count > 0) { ListProce = LstPro.GroupBy(o => new { o.CategoryId, o.CategoryName }).Select(s => new ProcedureUI { CateID = s.Key.CategoryId, CateName = s.Key.CategoryName, ListProcedureUI = LstPro.OrderBy(p => p.ProceduresName).Where(w => w.CategoryId == s.Key.CategoryId).Select(q => new ProcedureUI { ID = q.Id, Name = q.ProceduresName, }).OrderBy(p => p.Name).ToList() }).OrderBy(o => o.CateName).ToList(); } System.Web.HttpContext.Current.Session["ProcedureUI"] = ListProce; }