public ProjectModuleEditVM(ILoadDataSender lastScreen, OrderVM order, ProjectVM projectVM, ProjectVM parentProject = null) : this(lastScreen, order, parentProject)
        {
            _parentProject = parentProject;
            _projectVM = projectVM;

            _project = _projectVM.Project;

            foreach (var item in Users_Project.Items)
            {
                if (_employeesCollection.FirstOrDefault(employee => employee.User.Id == item.User.Id) == null && item.Project.Id == _projectVM.Project.Id)
                {
                    _employeesCollection.Add(new UserVM(item.User));
                }

                if (item.Project.Id == _project.Id)
                    _savedPositions.Add(new User_ProjectVM(item));
            }

            foreach (var item in Team_Project.Items)
            {
                if (_teamsCollection.FirstOrDefault(team => team.Team.Id == item.Team.Id) == null && item.Project.Id == _projectVM.Project.Id)
                {
                    _teamsCollection.Add(new TeamVM(item.Team));
                }
            }

            _status = projectVM.Status;
            _selectedLeader = new UserVM(_projectVM.Leader);
            LoadData();
        }
 public ProjectModuleEdit(ILoadDataSender lastScreen, OrderVM order, ProjectVM parentProject = null)
 {
     InitializeComponent();
     _order = order;
     _lastScreen = lastScreen;
     _parentProject = parentProject;
     _projectModuleEditVM = new ProjectModuleEditVM(this, order, parentProject);
     DataContext = _projectModuleEditVM;
     fillCheckboxList();
     FormTitle.Text = "Add module";
 }
        public ProjectModuleEditVM(ILoadDataSender lastScreen, OrderVM order, ProjectVM parentProject = null)
        { 
            _projectVM = new ProjectVM(_project);
            _parentProject = parentProject;
            _projectVM.Order = order.Order;
            _lastScreen = lastScreen;
            _projectVM.StartDate = DateTime.Now;
            _projectVM.ReleaseDate = DateTime.Now.AddDays(31);

            foreach (Project.Statuses status in Enum.GetValues(typeof(Project.Statuses)))
            {
                _statuses.Add(status);
            }

            _status = _statuses.Where(item => item == Project.Statuses.Opened).FirstOrDefault();

        }