Esempio n. 1
0
        public void NewEmployee()
        {
            var window = new AddEmployeeWindow();

            window.DataContext = new AddUserViewModel(new EmployeeModel());
            window.Show();
        }
        public void UpdateEmployee(EmployeeUc parameter)
        {
            this.AorU = false;
            AddEmployeeWindow addEmployeeWindow = new AddEmployeeWindow();
            Employee          employee          = EmployeeDAL.Instance.GetEmployee(parameter.txbID.Text);

            addEmployeeWindow.txtIdEmployee.Text = employee.IdEmployee.ToString();
            addEmployeeWindow.txtName.Text       = employee.Name;
            addEmployeeWindow.txtDate.Text       = employee.Date.ToString();
            if (employee.Sex == "Nam")
            {
                addEmployeeWindow.rdoMale.IsChecked = true;
            }
            else
            {
                addEmployeeWindow.rdoFemale.IsChecked = true;
            }
            addEmployeeWindow.txtStartDate.Text = employee.StartDate.ToString();

            addEmployeeWindow.txtPosition.Text        = employee.Position;
            addEmployeeWindow.txtTelephoneNumber.Text = employee.Telephone;
            addEmployeeWindow.txtAddress.Text         = employee.Address;
            addEmployeeWindow.Show();
            foreach (var item in addEmployeeWindow.txtPosition.Items)
            {
                if (item.ToString() == employee.Position)
                {
                    addEmployeeWindow.txtPosition.SelectedItem = item;
                }
            }
        }
Esempio n. 3
0
        public void SetUp()
        {
            window = new AddEmployeeWindow();
            transactionContainer = new TransactionContainer(null);
            presenter            = new AddEmployeePresenter(window, transactionContainer, null);

            window.Presenter = presenter;
            window.Show();
        }
        public void OpenWindowAddEmployee(AddEmployeeWindow paramater)
        {
            this.AorU = true;
            AddEmployeeWindow addEmployeeWindow = new AddEmployeeWindow();
            int id = EmployeeDAL.Instance.GetMaxId() + 1;

            addEmployeeWindow.txtIdEmployee.Text = id.ToString();
            addEmployeeWindow.Show();
        }
        private void OnAddStuff(object obj)
        {
            Window newEmployee = new AddEmployeeWindow();

            newEmployee.Show();
        }