示例#1
0
        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"));
        }
示例#2
0
        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"));
        }