public EmployeePageHandler(EmployeePageViewModel EmployeePageVM) : base(EmployeePageVM)
        {
            _employeePageViewModel = EmployeePageVM;
            PropertyPopulator <Employees> ppEmployee = new PropertyPopulator <Employees>();

            PopulatePrepInfo();
            ppEmployee.Repopulate(EmployeePageVM.PropEmployeeInfoList, EmployeePageVM.ActiveUser);
            GetOverTime();
        }
Exemplo n.º 2
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";
            }
        }
Exemplo n.º 3
0
 public PropertiesForm()
 {
     InitializeComponent();
     PopulatePropertyList = PopulateProperties;
 }