public ActionResult Create(VolumDiscount volumdiscount) { if (ModelState.IsValid) { volumdiscount.Id = Guid.NewGuid(); db.VolumDiscounts.Add(volumdiscount); db.SaveChanges(); return BreadCrum.RedirectToPreviousAction(Session, ControllerName); } ViewBag.ContractId = new SelectList(db.Contracts, "Id", "Name", volumdiscount.ContractId); return View(volumdiscount); }
public ActionResult Edit(VolumDiscount volumdiscount) { if (ModelState.IsValid) { db.Entry(volumdiscount).State = EntityState.Modified; db.SaveChanges(); return BreadCrum.RedirectToPreviousAction(Session, ControllerName); } ViewBag.ContractId = new SelectList(db.Contracts, "Id", "Name", volumdiscount.ContractId); return View(volumdiscount); }