private void btnEmployees_Click(object sender, EventArgs e) { // opening employee management form EmployeeManagement employeeManagement = new EmployeeManagement(); employeeManagement.Show(); this.Close(); }
private void btnSubmit_Click(object sender, EventArgs e) { // validating all if (validateFields()) { // concatenating account number in one variable string accountNumber = txtAccountNumber.Text + txtAccountTransit.Text + txtAccountBranch.Text; // making an object of class employee Employee employee = new Employee(txtFirstName.Text, txtLastName.Text, txtPhoneNumber.Text, txtEmail.Text, txtTitle.Text, txtDOB.Text, txtEmploymentStartDate.Text, accountNumber, txtSocialInsuranceNumber.Text, Int32.Parse(txtPayRate.Text), cmbPayCycle.Text, txtPayRate.Text, txtAllocatedHours.Text, txtAllocatedVacation.Text, txtAllocatedHealthDays.Text, cmbAllocatedBenefits.Text); // adding record to list of employees Info.employees.Add(employee); // adding notification to list of notifications Notification notification = new Notification("Employee added, Name: " + txtFirstName.Text + " " + txtLastName.Text, DateTime.Today.ToString()); Info.notifications.Add(notification); // opening employee management form EmployeeManagement employeeManagement = new EmployeeManagement(); employeeManagement.Show(); this.Close(); } }