コード例 #1
0
        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);
                    }
                }
            }
        }
コード例 #2
0
        public HttpResponseMessage Get()
        {
            var projectTasks             = ProjectTasksRepository.GetAllTasks();
            HttpResponseMessage responce = Request.CreateResponse(HttpStatusCode.OK, projectTasks);

            return(responce);
        }
コード例 #3
0
        public HttpResponseMessage Get(int id)
        {
            var projectsTasks            = ProjectTasksRepository.GetProjectTaskByID(id);
            HttpResponseMessage responce = Request.CreateResponse(HttpStatusCode.OK, projectsTasks);

            return(responce);
        }
コード例 #4
0
 public CommentsController()
 {
     commentsRepo     = new CommentsRepository(db);
     projectTasksRepo = new ProjectTasksRepository(db);
     usersRepo        = new UsersRepository(db);
     coursesRepo      = new CoursesRepository(db);
 }
コード例 #5
0
 public ProjectsService(ProjectsRepository projectsRepository,
                        ProjectTasksRepository projectTasksRepository,
                        SitesRepository sitesRepository)
 {
     this.projectsRepository     = projectsRepository;
     this.projectTasksRepository = projectTasksRepository;
     this.sitesRepository        = sitesRepository;
 }
コード例 #6
0
 public ProjectTasksController()
 {
     projectTasksRepository = new ProjectTasksRepository(db);
     coursesRepository      = new CoursesRepository(db);
     projectsRepository     = new ProjectsRepository(db);
     submissionsRepository  = new SubmissionsRepository(db);
     userCoursesRepostiory  = new UserCoursesRepository(db);
 }
コード例 #7
0
        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);
        }
コード例 #8
0
 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;
 }
コード例 #9
0
 public IEnumerable <ProjectTask> Delete(int id)
 {
     return(ProjectTasksRepository.DeleteProjectTask(id));
 }
コード例 #10
0
 public IEnumerable <ProjectTask> Put(ProjectTask pt)
 {
     return(ProjectTasksRepository.UpdateProjectTask(pt));
 }
コード例 #11
0
 public IEnumerable <ProjectTask> Post(ProjectTask pt)
 {
     return(ProjectTasksRepository.InsertProjectTask(pt));
 }
コード例 #12
0
 public ProjectTask Get(int id)
 {
     return(ProjectTasksRepository.GetProjectTask(id));
 }
コード例 #13
0
 public IEnumerable <ProjectTask> Get()
 {
     return(ProjectTasksRepository.GetAllProjectTasks());
 }
コード例 #14
0
 public IEnumerable <ProjectTask> Delete(ProjectTask pt)
 {
     return(ProjectTasksRepository.DeleteProjectTask(pt));
 }
コード例 #15
0
 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));
 }