private void btnSave_Click(object sender, EventArgs e) { if (IsCorrectEntries()) { int intResults = 0; clsEmployeeChildren ec = new clsEmployeeChildren(); ec.Username = _strUsername; ec.Name = txtName.Text; ec.Birthdate = dtpBirthDate.Value; intResults = ec.Add(); if (intResults > 0) { _frmEmployeeDetails.LoadChildrenList(); 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; clsEmployeeChildren ec = new clsEmployeeChildren(); ec.ChildCode = _strChildCode; ec.Name = txtName.Text; ec.Birthdate = dtpBirthDate.Value; intResults = ec.Edit(); if (intResults > 0) { _frmEmployeeDetails.LoadChildrenList(); Close(); } } }