public ActionResult Create() { var model = new DeliveryModel(); model.Markets = MarketContainer.GetMarkets(); model.Suppliers = SupplierContainer.GetSuppliers(); return(View(model)); }
public ActionResult Index() { var markets = MarketContainer.GetMarkets(); var suppliers = SupplierContainer.GetSuppliers(); var delivery = DeliveryContainer.GetDeliveries(); foreach (var del in delivery) { del.SupplierName = suppliers.FirstOrDefault(x => x.ID == del.FurnizorID).Nume; del.MarketName = markets.FirstOrDefault(x => x.ID == del.MagazinID).Denumire; } return(View(delivery)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var model = new DeliveryModel(); model.Delivery = DeliveryContainer.getDeliveryById((int)id); model.Markets = MarketContainer.GetMarkets(); model.Suppliers = SupplierContainer.GetSuppliers(); return(View(model)); }
public ActionResult Edit(Delivery delivery) { if (ModelState.IsValid && DeliveriesController.validateStatus((int)Session["role"], delivery.Status)) { DeliveryContainer.SaveDelivery(delivery); return(RedirectToAction("Index")); } var model = new DeliveryModel(); model.Delivery = delivery; model.Suppliers = SupplierContainer.GetSuppliers(); model.Markets = MarketContainer.GetMarkets(); return(View(model)); }
public ActionResult Create(Delivery delivery) { if (ModelState.IsValid) { delivery.Status = delivery.Status != null ? delivery.Status : "Initiata"; delivery.DataSolicitare = DateTime.Now; DeliveryContainer.SaveDelivery(delivery); return(RedirectToAction("Index")); } var model = new DeliveryModel(); model.Delivery = delivery; model.Suppliers = SupplierContainer.GetSuppliers(); model.Markets = MarketContainer.GetMarkets(); return(View(model)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var model = new DeliveryModel(); model.Delivery = DeliveryContainer.getDeliveryById((int)id); if ((int)Session["role"] != 3) { model.Statuses.Remove("Refuzata"); } model.Markets = MarketContainer.GetMarkets(); model.Suppliers = SupplierContainer.GetSuppliers(); return(View(model)); }
// GET: Suppliers public ActionResult Index() { var suppliers = SupplierContainer.GetSuppliers(); return(View(suppliers)); }