Пример #1
0
 public ProjectDto(Project project)
 {
     Id = project.Id;
     Name = project.Name;
     Price = project.Price.ToString("C0");
     Stage = project.Stage.ToString();
 }
 public ProjectInvolement(Project project, Employee employee, Role role, bool isMainForEmployee)
     : this()
 {
     Project = project;
     Employee = employee;
     Role = role;
     IsMainForEmployee = isMainForEmployee;
 }
        public NewProjectViewModel()
        {
            _repository = new ProjectRepository();
            Project = new Project();
            MainProperties = new ProjectMainPropertiesViewModel(Project);

            OkCommand = new Command(() => MainProperties.IsValid(), Save);
            CancelCommand = new Command(() => DialogResult = false);
        }
        public ExistingProjectViewModel(Project project)
        {
            _repository = new ProjectRepository();
            Project = project;

            var mainProperties = new ProjectMainPropertiesViewModel(project);
            Tabs = new List<ViewModel>
            {
                mainProperties,
                new ProjectEmployeeListViewModel(project)
            };

            OkCommand = new Command(() => mainProperties.IsValid(), Save);
            CancelCommand = new Command(() => DialogResult = false);
        }
 public ProjectEmployeeListViewModel(Project project)
 {
     _project = project;
 }
 public ProjectMainPropertiesViewModel(Project project)
 {
     Project = project;
     WasPromoted = project.Stage == ProjectStage.Closed;
     PromoteProjectCommand = new Command(() => !WasPromoted, PromoteProject);
 }