public override async Task InitializeAsync(Company parameter)
        {
            await base.InitializeAsync(parameter);

            Title = parameter.Name;
            Employees.AddRange(Employee.EmployeeRepository.Where(e => e.CompanyId == parameter.Id));
        }
 public MainDepartement(string Name, Director director, Deputy deputy, List <Employee> empl, List <SubDepartament> subDeps) : base(Name, subDeps, empl)
 {
     Director = director;
     Deputy   = deputy;
     Employees.AddRange(new List <Employee> {
         Director, Deputy
     });
 }
Esempio n. 3
0
        public PaySalaryDialogViewModel(MainViewModel mainViewModel)
        {
            _mainViewModel = mainViewModel;

            PaySalaryCommand = new DelegateCommand(PaySalary, Validate);

            Employees = _mainViewModel.Context.Salesmen.Select(x => x.Contragent).ToList();
            Employees.AddRange(_mainViewModel.Context.Guards.Select(x => x.Contragent).ToList());
            SelectedEmployee = Employees.FirstOrDefault();
        }
Esempio n. 4
0
        /// <summary>
        /// Loads the employees
        /// </summary>
        public async Task <int> loadEmployeesAsync(int offset, int limit)
        {
            _events.PublishOnUIThread(new ProgressEventModel(System.Windows.Visibility.Visible));

            List <IEmployee> newEmployees = await _databaseService.GetEmployeesAsync(_user, limit, offset);

            Employees.AddRange(newEmployees);

            _events.PublishOnUIThread(new ProgressEventModel(System.Windows.Visibility.Collapsed));

            return(newEmployees.Count);
        }
Esempio n. 5
0
        public TestCompanyVm()
            : base("ACME Inc.")//, MakeAScene())
        {
            var address1 = new AddressVm
            {
                HouseNumber = "11280",
                Street      = "NW 35th Court",
                City        = "Coral Springs",
                State       = "FL",
                ZipCode     = 33065
            };

            var address2 = new AddressVm
            {
                HouseNumber = "8546",
                Street      = "NW 28th Court",
                City        = "North Lauderdale",
                State       = "Florida",
                ZipCode     = 33068
            };

            var addies = new List <AddressVm> {
                address1, address2
            };

            var larry = new EmployeeViewModel {
                FirstName = "larry", LastName = "larry", Addresses = addies
            };
            var curly = new EmployeeViewModel {
                FirstName = "curly", LastName = "sue"
            };
            var moe = new EmployeeViewModel {
                FirstName = "moe", LastName = "money", Addresses = addies
            };
            var bob = new EmployeeViewModel {
                FirstName = "bob", LastName = "ooo"
            };
            var john = new EmployeeViewModel {
                FirstName = "john", LastName = "doe", Addresses = addies
            };
            var bobJr = new EmployeeViewModel {
                FirstName = "bob", LastName = "jones"
            };

            Employees.AddRange(new List <EmployeeViewModel> {
                larry, curly, moe, bob, john, bobJr
            });
        }
Esempio n. 6
0
        public void Initialize()
        {
            // Init DB
            Database.EnsureCreated();

            // Seed data
            if (!Employees.Any())
            {
                Employees.AddRange(GetEmployees());
            }

            if (!TransitionSets.Any())
            {
                TransitionSets.AddRange(GetDefaultTransitionSets());
            }

            SaveChanges();
        }
Esempio n. 7
0
        public MainViewModel()
        {
            SelectedProfile = new ProfileModel();
            //pulls models from external source but no logic which collections are for
            try
            {
                profileCommand = new ProfileCommand(_connectionString);
                //list that comes from the database will be added to Emplyees Bindable collection
                Profiles.AddRange(profileCommand.GetList());

                EmployeeCommand employeeCommand = new EmployeeCommand(_connectionString);
                //list that comes from the database will be added to Emplyees Bindable collection
                Employees.AddRange(employeeCommand.GetList());

                CompanyCommand companyCommand = new CompanyCommand(_connectionString);
                //list that comes from the database will be added to Emplyees Bindable collection
                Companies.AddRange(companyCommand.GetList());
            }
            catch (Exception ex)
            {
                AppStatus = ex.Message;
                NotifyOfPropertyChange(() => AppStatus);
            }
        }
Esempio n. 8
0
 public void Display(IEnumerable <Employee> employees)
 {
     Employees.Clear();
     Employees.AddRange(employees);
 }
 public Employee(string name, Employee manager, params Employee[] employees) : this(name, manager)
 {
     Employees.AddRange(employees);
 }
Esempio n. 10
0
        public override async Task InitializeAsync()
        {
            await base.InitializeAsync();

            Employees.AddRange(Employee.EmployeeRepository);
        }