private void btnSave_Click(object sender, EventArgs e) { if (validations()) { getDataFromForm(); if (supplyBL.Insert(supplyInfo) > 0) { MessageBox.Show("success"); clearControls(); frmSupplies.loadData(frmSupplies.txtSearch.Text); this.Close(); } else { MessageBox.Show("failed"); } } }
private void btnSave_Click(object sender, EventArgs e) { if (validations()) { getDataFromForm(); if (supplyBL.Edit(supplyInfo)) { frmSupplies.loadData(frmSupplies.txtSearch.Text); MessageBox.Show("Success."); clearControls(); this.Close(); } else { MessageBox.Show("Failed."); } } else { MessageBox.Show("Please complete the required fields."); } }