private void btnSave_Click(object sender, EventArgs e) { if (IsCorrectEntries()) { int intResults = 0; using (clsEmployeeTraining et = new clsEmployeeTraining()) { et.Username = _strUsername; et.Training = txtTraining.Text; et.TrainingDate = dtpDate.Value; et.Details = txtDetails.Text; et.Sponsor = txtSponsor.Text; intResults = et.Add(); } if (intResults > 0) { _frmEmployeeDetails.LoadTrainingList(); if (MessageBox.Show(clsMessageBox.MessageBoxSuccessAddAskNew, clsMessageBox.MessageBoxText, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { ClearFields(); } else { this.Close(); } } } }
private void btnSave_Click(object sender, EventArgs e) { if (IsCorrectEntries()) { int intResults = 0; clsEmployeeTraining et = new clsEmployeeTraining(); et.TrainingCode = _strTrainingCode; et.Training = txtTraining.Text; et.TrainingDate = dtpDate.Value; et.Details = txtDetails.Text; et.Sponsor = txtSponsor.Text; intResults = et.Edit(); if (intResults > 0) { _frmEmployeeDetails.LoadTrainingList(); Close(); } } }