Ejemplo n.º 1
0
        private void CreateSupervision(OuterSubject manager, Project project)
        {
            var supervision = new ProjectSupervision(Supervisions.Count + 1, manager.Id, 0, project.Id);

            project.TotalPrize   = project.Prize + supervision.Prize;
            project.IsSupervised = true;
            supervision.RecalculateFields();
            Supervisions.Add(supervision);
        }
Ejemplo n.º 2
0
        private void AssignSupervisor(Project project, ProjectSupervision supervision, List <Architect> architects)
        {
            var projectsDone         = GetAllByProjectId(project.Id);
            var availableSupervisors = new List <Architect>();

            projectsDone.ForEach(projectDone => availableSupervisors.Add(_architectHandler.GetOneById(projectDone.ArchitectId)));
            var architect = IsAnySupervisorAvailable(availableSupervisors)
                ? availableSupervisors.Find(o => o.CanSupervise)
                : architects.Find(a => a.CanSupervise);

            if (architect != null)
            {
                supervision.ArchitectId = architect.Id;
            }
        }
Ejemplo n.º 3
0
 private void UpdateSupervisionDates(ProjectSupervision supervision, DateTime endDate)
 {
     supervision.StartDate = endDate;
     supervision.EndDate   = supervision.StartDate.AddDays(_random.Next(5, 10));
 }
Ejemplo n.º 4
0
 public void EndSupervision(ProjectSupervision supervision)
 {
     supervision.Status = UKONCZONY;
 }