public static void Finish(int taskId) { if (taskId > 0) { ProjectsRepository projectsRepository = new ProjectsRepository(new DB.PmcsDbContext()); ProjectTasksRepository projectTasksRepository = new ProjectTasksRepository(new DB.PmcsDbContext()); var original = projectTasksRepository.GetById(t => t.TaskId == taskId); var newTask = projectTasksRepository.GetById(t => t.TaskId == taskId); newTask.CompletionPercentage = 1.00; newTask.TaskStatus = 2; newTask.TaskComplete = true; newTask.ActualEndDate = DateTime.Now; projectTasksRepository.Update(original, newTask); if (original.ParentTaskId != null) { var childrenTasks = projectTasksRepository .SearchData(t => t.ParentTaskId == original.ParentTaskId) .ToList(); if (childrenTasks.Any() && childrenTasks.All(t => t.TaskComplete == true)) { var originalParent = projectTasksRepository.GetById(t => t.TaskId == original.ParentTaskId); var newParentTask = projectTasksRepository.GetById(t => t.TaskId == original.ParentTaskId); newParentTask.CompletionPercentage = 1.00; newParentTask.TaskStatus = 2; newParentTask.TaskComplete = true; projectTasksRepository.Update(originalParent, newParentTask); } } } }
public HttpResponseMessage Get() { var projectTasks = ProjectTasksRepository.GetAllTasks(); HttpResponseMessage responce = Request.CreateResponse(HttpStatusCode.OK, projectTasks); return(responce); }
public HttpResponseMessage Get(int id) { var projectsTasks = ProjectTasksRepository.GetProjectTaskByID(id); HttpResponseMessage responce = Request.CreateResponse(HttpStatusCode.OK, projectsTasks); return(responce); }
public CommentsController() { commentsRepo = new CommentsRepository(db); projectTasksRepo = new ProjectTasksRepository(db); usersRepo = new UsersRepository(db); coursesRepo = new CoursesRepository(db); }
public ProjectsService(ProjectsRepository projectsRepository, ProjectTasksRepository projectTasksRepository, SitesRepository sitesRepository) { this.projectsRepository = projectsRepository; this.projectTasksRepository = projectTasksRepository; this.sitesRepository = sitesRepository; }
public ProjectTasksController() { projectTasksRepository = new ProjectTasksRepository(db); coursesRepository = new CoursesRepository(db); projectsRepository = new ProjectsRepository(db); submissionsRepository = new SubmissionsRepository(db); userCoursesRepostiory = new UserCoursesRepository(db); }
public static void UpdateTaskActualStartDate(int taskId) { ProjectTasksRepository projectTasksRepository = new ProjectTasksRepository(new DB.PmcsDbContext()); var original = projectTasksRepository.GetById(j => j.TaskId == taskId); var updated = projectTasksRepository.GetById(j => j.TaskId == taskId); updated.ActualStartDate = DateTime.Now; projectTasksRepository.Update(original, updated); }
public JobsService(JobsRepository jobsRepository, AsBuiltRepository asBuiltRepository, PATRepository pATRepository, OILsRepository oILsRepository, ProjectTasksRepository projectTasksRepository) { this.jobsRepository = jobsRepository; this.asBuiltRepository = asBuiltRepository; this.pATRepository = pATRepository; this.oILsRepository = oILsRepository; this.projectTasksRepository = projectTasksRepository; }
public IEnumerable <ProjectTask> Delete(int id) { return(ProjectTasksRepository.DeleteProjectTask(id)); }
public IEnumerable <ProjectTask> Put(ProjectTask pt) { return(ProjectTasksRepository.UpdateProjectTask(pt)); }
public IEnumerable <ProjectTask> Post(ProjectTask pt) { return(ProjectTasksRepository.InsertProjectTask(pt)); }
public ProjectTask Get(int id) { return(ProjectTasksRepository.GetProjectTask(id)); }
public IEnumerable <ProjectTask> Get() { return(ProjectTasksRepository.GetAllProjectTasks()); }
public IEnumerable <ProjectTask> Delete(ProjectTask pt) { return(ProjectTasksRepository.DeleteProjectTask(pt)); }
public ProjectTasksController() { repository = new ProjectTasksRepository(); }
public List <ProjectTask> Delete(ProjectTask pt) { return(ProjectTasksRepository.DeleteProjectTask(pt)); }
public List <ProjectTask> Put(ProjectTask pt) { return(ProjectTasksRepository.UpdateProjectTask(pt)); }
public List <ProjectTask> Post(ProjectTask pt) { return(ProjectTasksRepository.InsertPrrojectTask(pt)); }