public ActionResult Brand(int page = 1, int pageSize = 100) { var lstBrand = BrandModel.GetAllBrand(page, pageSize); if (lstBrand == null) { lstBrand = new List <BrandBO>(); } return(View(lstBrand)); }
public ActionResult SideBar(int currentID, bool isCollectionLoad) { var lstCollection = CollectionDAO.GetAllCollection(); var lstBrand = BrandModel.GetAllBrand(); if (lstCollection.Count == 0 && lstBrand.Count() == 0) { return(RedirectToAction("NotFound", "Error")); } ViewBag.ListCollection = lstCollection; ViewBag.ListBrand = lstBrand; ViewBag.CurrentID = currentID; ViewBag.IsCollectionLoad = isCollectionLoad; return(PartialView()); }
public ActionResult PhoneModel(int page = 1, int pageSize = 100) { var lstCollection = PhoneModelDAO.GetAllPhoneModel(); var lstBrand = BrandModel.GetAllBrand(); if (lstCollection == null) { lstCollection = new List <PhoneModelBO>(); } if (lstBrand == null) { lstBrand = new List <BrandBO>(); } ViewBag.ListBrand = lstBrand; return(View(lstCollection.OrderBy(x => x.group).ToList())); }
public ActionResult Index() { var commonInfo = LocationDAO.GetCommonInfoByID("commoninfo"); var lstBrand = BrandModel.GetAllBrand(); var lstPhoneModel = new List <PhoneModelBO>(); foreach (var item in lstBrand) { var result = BrandModel.GetPhoneModelByBrandID(item.id); if (result != null) { lstPhoneModel.AddRange(result); } } ViewBag.ListBrand = lstBrand; ViewBag.ListModel = lstPhoneModel; ViewBag.CommonInfo = commonInfo; return(View()); }
public void InitSelectListBrand(long?selectedID = null) { ViewBag.BrandID = new SelectList(BrandModel.GetAllBrand(), "id", "name", selectedID); }