Ejemplo n.º 1
0
 public AdminHandler(AdminPageViewModel ViewModel) : base(ViewModel)
 {
     _catalog = CatalogsSingleton.Instance;
     _vm      = ViewModel;
     _updater = new UpdateObsCollection();
     _updater.GetEmployeesAsync(_vm.Employees);
 }
Ejemplo n.º 2
0
 private void Arrange()
 {
     _createEmployeeViewModel = new CreateEmployeeViewModel();
     _catalogsSingleton       = CatalogsSingleton.Instance;
     fillpropinfolist(_createEmployeeViewModel.PropEmployeeInfoList);
     fillpropinfolist(_createEmployeeViewModel.PropUsersInfoList);
     _AdminPageVM = new AdminPageViewModel();
 }
Ejemplo n.º 3
0
        public LoginHandler(LoginPageViewModel loginpageevm)
        {
            _loginPageViewModel      = loginpageevm;
            this._loginPageViewModel = loginpageevm;
            _catalog            = CatalogsSingleton.Instance;
            _employeesSingleton = EmployeesSingleton.Instance;
            var employeeCatalog = _catalog.EmployeeCatalog.GetAll();
            var worktimeCatalog = _catalog.WorktimeCatalog.GetAll();

            RemoveEmployeeWithoutUser();
        }
Ejemplo n.º 4
0
        public async void CreateEmployee()
        {
            Employees employee = new Employees();
            Users     user     = new Users();

            PropertyPopulator <Employees> ppEmployee = new PropertyPopulator <Employees>();
            PropertyPopulator <Users>     ppUsers    = new PropertyPopulator <Users>();

            employee = ppEmployee.Populate(_createEmployeeViewModel.PropEmployeeInfoList.ToList(), new Employees());
            user     = ppUsers.Populate(_createEmployeeViewModel.PropUsersInfoList.ToList(), new Users());

            CatalogsSingleton catalog = CatalogsSingleton.Instance;

            Users generatedUser = await catalog.UsersCatalog.AddAsync(user);

            if (generatedUser.UserID != 0)
            {
                employee.UserID = generatedUser.UserID;

                Employees generatedEmployee = await catalog.EmployeeCatalog.AddAsync(employee);

                if (generatedEmployee.EmployeeID != 0)
                {
                    _createEmployeeViewModel.Message = "Bruger er blevet oprettet";
                    PopulatePrepInfo();
                }
                else
                {
                    _createEmployeeViewModel.Message = "Bruger kunne ikke oprettes";
                }
            }
            else
            {
                _createEmployeeViewModel.Message = "Bruger kunne ikke oprettes";
            }
        }
Ejemplo n.º 5
0
 public void Arrange()
 {
     _workTimeViewModel = new WorkTimeViewModel();
     _catalogsSingleton = CatalogsSingleton.Instance;
 }