Exemplo n.º 1
0
        public async Task <ActionResult> UpdateByProjectManagerTask(ProjectManagerCalendarViewModel viewModel)
        {
            var updatedAssigment = await db.UpdateMapByProjectManagerTask(viewModel);

            db.UpdateAssignment(updatedAssigment);
            await db.SaveChangesAsync();

            return(new JsonResult {
                Data = new { status = "save" }
            });
        }
Exemplo n.º 2
0
        public async Task <Assignment> UpdateMapByProjectManagerTask(ProjectManagerCalendarViewModel viewModel)
        {
            var assignment = db.Assignments.SingleOrDefault(x => x.Id == viewModel.AssigmentId);
            var status     = await db.Statuses.SingleOrDefaultAsync(x => x.Id == viewModel.StatusId);

            assignment.Progress = viewModel.Progress;
            assignment.Progress = viewModel.StatusId;
            assignment.Status   = status;
            assignment.StatusId = viewModel.StatusId;
            assignment.Deadline = viewModel.End;
            return(assignment);
        }