public ActionResult ManageProducts()
        {
            var products = _repositoryServices.GetProductsList();

            ViewBag.ProductIdsList = GetProductList();
            return(View("ManageProducts"));
        }
Beispiel #2
0
        private List <SelectListItem> GetProductList()
        {
            var productList = new List <SelectListItem>();

            productList.Add(new SelectListItem {
                Text = "Pick Product Item", Value = 0.ToString()
            });

            productList.AddRange(_teacherRepository.GetProductsList().Select(p => new SelectListItem {
                Text = p.prodName, Value = p.prodId.ToString()
            }).ToList());
            return(productList);
        }