public ActionResult Edit(int id, TaskViewModel TVM) { if (!Request.IsAuthenticated) { return(RedirectToAction("Login", "Account")); } //redirect to nowhere if not admin if (!(User.IsInRole("Team Leader"))) { return(RedirectToAction("Nowhere", "Account")); } Tasks T = TS.GetById(id); T.TaskName = TVM.TaskName; T.Start_Date = TVM.Start_Date; T.End_Date = TVM.End_Date; T.Duration = TVM.Duration; T.Description = TVM.Description; TVM.Estimation = TVM.Estimation; TS.Update(T); TS.Commit(); return(RedirectToAction("Index")); }
public ActionResult Edit(int id, TaskViewModel TVM) { Tasks T = TS.GetById(id); T.TaskName = TVM.TaskName; T.Start_Date = TVM.Start_Date; T.End_Date = TVM.End_Date; T.Duration = TVM.Duration; T.Description = TVM.Description; TVM.Estimation = TVM.Estimation; TS.Update(T); TS.Commit(); return(RedirectToAction("Index")); }