private void btnSave_Click(object sender, EventArgs e) { if (this.txtBox_suppName.Text.Trim() == "") { MessageBox.Show("Please insert 'Item Name' ", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); this.txtBox_suppName.Focus(); } else if (this.txtBox_suppAddress.Text.Trim() == "") { MessageBox.Show("Please insert 'Address' ", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); this.txtBox_suppAddress.Focus(); } else { if (editMode == true) { dao.EditSupplier(GetTxtBoxData(), supp); } else { dao.AddNewSupplier(GetTxtBoxData()); } this.Close(); } }
public int AddNewSupplier(SupplierInfo supplierInfo) { return(supplierDAO.AddNewSupplier(supplierInfo)); }