private void butOK_Click(object sender, System.EventArgs e) { EmployerCur.EmpName = textEmp.Text; if (IsNew) { Employers.Insert(EmployerCur); } else { Employers.Update(EmployerCur); } DialogResult = DialogResult.OK; }
private void butOK_Click(object sender, System.EventArgs e) { if (String.IsNullOrWhiteSpace(textEmp.Text)) { MsgBox.Show(this, "Please enter an employer name."); return; } Employer empOld = EmployerCur.Copy(); EmployerCur.EmpName = textEmp.Text; if (IsNew) { Employers.Insert(EmployerCur); } else { Employers.Update(EmployerCur, empOld); } DialogResult = DialogResult.OK; }