示例#1
0
        // 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));
        }
示例#2
0
        // 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));
        }