Пример #1
0
        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));
        }
Пример #2
0
        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());
        }
Пример #3
0
        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()));
        }
Пример #4
0
        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());
        }
Пример #5
0
 public void InitSelectListBrand(long?selectedID = null)
 {
     ViewBag.BrandID = new SelectList(BrandModel.GetAllBrand(), "id", "name", selectedID);
 }