public EmployeeMainPropertiesViewModel(Employee employee)
        {
            _departmentRepository = new DepartmentRepository();
            _employee = employee;

            ChangeDepartmentCommand = new Command(ChangeDepartment);
        }
 public ProjectInvolement(Project project, Employee employee, Role role, bool isMainForEmployee)
     : this()
 {
     Project = project;
     Employee = employee;
     Role = role;
     IsMainForEmployee = isMainForEmployee;
 }
        public EmployeeProjectListViewModel(Employee employee)
        {
            _repository = new EmployeeRepository();
            _employee = employee;

            AddProjectCommand = new Command(AddProject);
            DeleteProjectCommand = new Command<ProjectInvolement>(x => x != null, DeleteProject);
        }
        public NewEmployeeViewModel()
        {
            _repository = new EmployeeRepository();
            Employee = new Employee();
            MainProperties = new EmployeeMainPropertiesViewModel(Employee);

            OkCommand = new Command(() => MainProperties.IsValid(), Save);
            CancelCommand = new Command(() => DialogResult = false);
        }
        public NewEmployeeProjectViewModel(Employee employee)
        {
            _repository = new ProjectRepository();
            _employee = employee;

            Projects = _repository.GetProjectDtoList()
                .Where(x => !employee.Projects.Any(y => y.Id == x.Id))
                .ToList();

            OkCommand = new Command(IsValid, Save);
            CancelCommand = new Command(() => DialogResult = false);
        }
        public ExistingEmployeeViewModel(Employee employee)
        {
            _repository = new EmployeeRepository();
            Employee = employee;

            var mainProperties = new EmployeeMainPropertiesViewModel(employee);
            var projects = new EmployeeProjectListViewModel(employee);
            Tabs = new List<ViewModel>
            {
                mainProperties,
                projects
            };

            OkCommand = new Command(() => mainProperties.IsValid(), Save);
            CancelCommand = new Command(() => DialogResult = false);
        }
Ejemplo n.º 7
0
 public EmployeeDto(Employee employee)
     : this(employee.Id, employee.FirstName, employee.LastName, employee.Department.Name)
 {
 }