Beispiel #1
0
        public IActionResult Index()
        {
            var devices = _SetBoxService.GetAll().Select(s => new SetBoxDetailModel()
            {
                Id            = s.Id,
                ImageUrl      = s.ImageUrl,
                Name          = s.Name,
                Price         = s.Price,
                Specification = s.Specification
            });

            if (TempData["OrderPlaced"] != null)
            {
                ViewBag.OrderPlaced = TempData["OrderPlaced"].ToString();
                ViewBag.OrderMsg    = TempData["OrderMsg"].ToString();
            }

            if (TempData["SetBoxChanged"] != null)
            {
                ViewBag.SetBoxChange    = TempData["SetBoxChanged"].ToString();
                ViewBag.SetBoxChangeMsg = TempData["SetBoxChangedMsg"].ToString();
            }


            var model = new SetBoxIndexModel()
            {
                SetBoxList = devices
            };

            return(View(model));
        }
Beispiel #2
0
 private void SetDropDown()
 {
     ViewBag.Packages = _packageService.GetAll().ToList();
     ViewBag.SetBoxes = _setBoxService.GetAll().ToList();
 }