// GET: Product public ActionResult Index() { ProdutSupplierModel objProductsSuppliersInfo = new ProdutSupplierModel(); objProductsSuppliersInfo._ProductDetails = _ProductSupplierService.GetAllProducts(); objProductsSuppliersInfo._SupplierInfoDetails = _ProductSupplierService.GetAllSupplier().Where(x => x.SupplierName != null && x.SupplierName != string.Empty).ToList(); return(View(objProductsSuppliersInfo)); }
// GET: Product/Create public ActionResult Create() { ProductDetails model = new ProductDetails(); ProdutSupplierModel objProductsSuppliersInfo = new ProdutSupplierModel(); List <SupplierInfoDetails> _SupplierInfoDetails = _ProductSupplierService.GetAllSupplier(); IEnumerable <SelectListItem> Suppliers = _SupplierInfoDetails .OrderBy(n => n.SupplierName) .Select(n => new SelectListItem { Value = n.SupplierId.ToString(), Text = n.SupplierName }).ToList(); model.Suppliers = new SelectList(Suppliers, "Value", "Text"); return(View(model)); }