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); }
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; } }
private void UpdateSupervisionDates(ProjectSupervision supervision, DateTime endDate) { supervision.StartDate = endDate; supervision.EndDate = supervision.StartDate.AddDays(_random.Next(5, 10)); }
public void EndSupervision(ProjectSupervision supervision) { supervision.Status = UKONCZONY; }