public ActionResult Create(RequestRelease requestrelease) { if (ModelState.IsValid) { db.RequestReleases.Add(requestrelease); db.SaveChanges(); return RedirectToAction("Index"); } return View(requestrelease); }
public ActionResult Edit(RequestRelease request) { try { using (TransactionScope transaction = new TransactionScope()) { RequestRelease model = db.RequestReleases.Where(a => a.RequestID == request.RequestID).SingleOrDefault(); model.StartDate = request.StartDate; model.EndDate = request.EndDate; db.Entry(model).State = EntityState.Modified; db.SaveChanges(); transaction.Complete(); } return View("SuccessEdit"); } catch (Exception) { throw; } }
public ActionResult Edit(RequestRelease requestrelease) { if (ModelState.IsValid) { db.Entry(requestrelease).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(requestrelease); }