public ActionResult Edit(Cause Cause) { Cause dbCause = new Cause { }; if (Cause.CauseID != Guid.Empty) dbCause = reposetory.GetCauseItem(Cause.CauseID); if (dbCause == null) return HttpNotFound(); if (ModelState.IsValid) { dbCause.Name = Cause.Name; dbCause.Description = Cause.Description; dbCause.Trim(); if (reposetory.Save(dbCause)) { Cause.CauseID = dbCause.CauseID; ViewBag.FormSucces = true; } } return View(Cause); }
public ActionResult Edit(Guid? Id) { Cause Cause = new Cause { }; if (Id != null) Cause = reposetory.GetCauseItem((Guid)Id); if (Cause == null) return HttpNotFound(); return View(Cause); }