public void AddEmployee()
        {
            presenter.EmpId      = 123;
            presenter.Name       = "Kubing";
            presenter.Address    = "314 Elm";
            presenter.IsHourly   = true;
            presenter.HourlyRate = 25;

            presenter.AddEmployee();

            Assert.AreEqual(1, container.Transactions.Count);
            Assert.IsTrue(container.Transactions[0] is AddHourlyEmployee);
        }
        private void btnAddEmployee_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(Username))
            {
                MessageBox.Show("Field username can not empty!");
                return;
            }

            if (string.IsNullOrEmpty(Password))
            {
                MessageBox.Show("Field password can not empty!");
                return;
            }

            if (string.IsNullOrEmpty(Phone))
            {
                MessageBox.Show("Field phone can not empty!");
                return;
            }

            if (string.IsNullOrEmpty(EmployeeName))
            {
                MessageBox.Show("Field name can not empty!");
                return;
            }

            if (string.IsNullOrEmpty(Address))
            {
                MessageBox.Show("Field address can not empty!");
                return;
            }

            bool IsAddSuccess = _addEmployeePresenter.AddEmployee();

            if (IsAddSuccess)
            {
                this.Close();
            }
        }
Exemple #3
0
 private void submitButton_Click(object sender, EventArgs e)
 {
     presenter.AddEmployee();
     this.Close();
 }