Exemplo n.º 1
0
        public async Task <IActionResult> Task(int id)
        {
            try
            {
                var assignment = await _databaseDriver.GetAssignmentById(id);

                var project = await _databaseDriver.GetProjectById(assignment.ProjectID);

                assignment.Project = project;
                var taskModel = new TaskModel(_databaseDriver);
                taskModel.Assignment = assignment;
                return(View("../Home/Assignment", taskModel));
            }
            catch
            {
                return(View("../Shared/Error", new ErrorViewModel {
                    Message = "Task cannot be opened"
                }));
            }
        }