private void buttonUpdate_Click(object sender, EventArgs e) //ok { Employee emp = new Employee(); emp.EmployeeId = Convert.ToInt32(textBoxEmployeeId.Text); emp.FirstName = textBoxFirstName.Text; emp.LastName = textBoxLastName.Text; emp.JobTitle = textBoxJobTitle.Text; emp.UserType = textBoxUserType.Text; emp.Password = textBoxPassword.Text; emp.Email = textBoxEmail.Text; emp.DeleteEmployee(emp.EmployeeId); emp.SaveEmployee(emp); MessageBox.Show("Employee has been modified."); }
private void buttonAdd_Click(object sender, EventArgs e) //OK { Employee emp = new Employee(); emp.FirstName = textBoxFirstName.Text; emp.LastName = textBoxLastName.Text; emp.JobTitle = textBoxJobTitle.Text; emp.UserType = textBoxUserType.Text; emp.Password = textBoxPassword.Text; emp.Email = textBoxEmail.Text; if (emp.SaveEmployee(emp)) { MessageBox.Show("Employee saved!"); } else { MessageBox.Show("Saving problem."); } }