public async Task <ActionResult> Create(ShipView vShip) { if (ModelState.IsValid) { VShipRepository repo = new VShipRepository(); return(RedirectToAction("Index")); } return(View(vShip)); }
public ActionResult Create() { VShipRepository repo = new VShipRepository(); ViewBag.cust = Menu.Cust; ShipView vShip = repo.GetCreate(Menu.CustId); return(View(vShip)); }
public async Task <ActionResult> Edit(int id) { VShipRepository repo = new VShipRepository(); ShipView vShip = repo.GetChange(id); Session["Detal"] = vShip.Detal; if (vShip == null) { return(HttpNotFound()); } return(View(vShip)); }
public ActionResult Good(ShipOrderDetailView svd) { svd.ShipOrderDetailViewId = (int)Session["id"]; List <ShipOrderDetailView> detal = (List <ShipOrderDetailView>)Session["Detal"]; int ShipOrderId = 0; foreach (var o in detal) { ShipOrderId = o.ShipOrderId; } VShipRepository repo = new VShipRepository(); repo.SaveDetail(ShipOrderId, svd); //db.SaveChanges(); return(RedirectToAction("Edit", "VShips", new { id = ShipOrderId })); }
public async Task <ActionResult> Edit(ShipView vShip, string Adres, string Person) { List <ShipOrderDetailView> detal = (List <ShipOrderDetailView>)Session["Detal"]; VShipRepository repo = new VShipRepository(); Session["Order"] = vShip; repo.Save(vShip, detal); if (Adres == "Новый") { return(RedirectToAction("NewAdres")); } if (Person == "Новый") { return(RedirectToAction("NewPerson")); } return(RedirectToAction("Index")); }