public AddNewEmployeeViewModel(AddNewEmployeeView addNewEmployeeView, IValidatedUserData userData)
 {
     this.addNewEmployeeView = addNewEmployeeView;
     Position      = string.Empty;
     FloorNumber   = string.Empty;
     Citizenship   = string.Empty;
     Sex           = string.Empty;
     employee      = new tblEmployee();
     this.userData = userData;
     FloorNumbers  = LoadFloorNumbers();
 }
 private void AddNewEmployeeExecute()
 {
     try
     {
         AddNewEmployeeView addNewEmployeeView = new AddNewEmployeeView();
         addNewEmployeeView.ShowDialog();
         view.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
        private void AddNewEmployeeExecute()
        {
            try
            {
                AddNewEmployeeView addNewEmployeeView = new AddNewEmployeeView();
                addNewEmployeeView.ShowDialog();

                if ((addNewEmployeeView.DataContext as AddNewEmployeeViewModel).IsAddedNewEmployee == true)
                {
                    Employees = LoadEmpolyees();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
 private void AddNewEmployeeExecute()
 {
     try
     {
         if (!db.LoadFloorNumbers().Any())
         {
             MessageBox.Show("You can not create a new employee. There is no created manager at the moment. Please try later.");
         }
         else
         {
             AddNewEmployeeView addNewEmployeeView = new AddNewEmployeeView();
             addNewEmployeeView.ShowDialog();
             hotelOwnerView.Close();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
 public AddNewEmployeeViewModel(AddNewEmployeeView addNewEmployeeView)
 {
     Employee = new tblEmployee();
     this.addNewEmployeeView = addNewEmployeeView;
     PersonalNo           = string.Empty;
     Sex                  = string.Empty;
     Employee.Telephone   = string.Empty;
     RegistrationNumber   = string.Empty;
     SectorName           = string.Empty;
     Employee.Manager     = string.Empty;
     Employee.Surname     = string.Empty;
     Employee.GivenName   = string.Empty;
     Locations            = LoadLocations();
     Sector               = new tblSector();
     CanSave              = true;
     Location             = new tblLocation();
     Sectors              = LoadSectors();
     Managers             = LoadManagers();
     workerAddNew.DoWork += LogAddedNewEmployee;
 }
Exemple #6
0
        public AddNewEmployeeViewModel(AddNewEmployeeView addNewEmployeeView)
        {
            this.addNewEmployeeView = addNewEmployeeView;
            PersonalNo       = string.Empty;
            Sex              = string.Empty;
            PlaceOfResidence = string.Empty;
            MaritalStatus    = string.Empty;
            Position         = string.Empty;
            Username         = string.Empty;
            Password         = string.Empty;
            GivenName        = string.Empty;
            Surname          = string.Empty;
            CanSave          = true;
            userData         = new tblUserData();
            sectors          = LoadSectors();

            Employee = new tblEmployee();
            position = string.Empty;
            sector   = new tblSector();
            sectors  = LoadSectors();
            professionalQualificationsLevel = string.Empty;
            yearsOfService = string.Empty;
            sectorName     = Sector.SectorName;
        }