public ActionResult Create(TaskPMVM taskVM) { string currentUserId = User.Identity.GetUserId(); // ApplicationUser currentUser = db.Users.FirstOrDefault(x => x.Id == currentUserId); TaskPM t1 = new TaskPM() { Name = taskVM.Name, DeadLine = taskVM.DeadLine, EndDate = taskVM.EndDate, StartDate = taskVM.StartDate, Status = " todo", ProjectId = taskVM.ProjectId, UserId = taskVM.User_Id, leader = currentUserId }; MyTaskService.Add(t1); MyTaskService.Commit(); return(RedirectToAction("Index")); }
public ActionResult Delete(int id, TaskPMVM pvm) { TaskPM p = MyTaskService.GetById(id); p.Name = pvm.Name; p.StartDate = pvm.StartDate; p.EndDate = pvm.EndDate; p.DeadLine = pvm.DeadLine; MyTaskService.Delete(p); MyTaskService.Commit(); return(RedirectToAction("Index")); }