public static DialogResult CreateInsertDialog() { var form = new SupplierDetailsForm(); form.isForUpdate = false; return form.ShowDialog(); }
public static DialogResult CreateUpdateDialog(DataRow selectedRow) { var form = new SupplierDetailsForm(); form.isForUpdate = true; form.GetInfo(selectedRow); return form.ShowDialog(); }
public static DialogResult CreateInsertDialog() { var form = new SupplierDetailsForm(); form.isForUpdate = false; return(form.ShowDialog()); }
public static DialogResult CreateUpdateDialog(DataRow selectedRow) { var form = new SupplierDetailsForm(); form.isForUpdate = true; form.GetInfo(selectedRow); return(form.ShowDialog()); }
private void insertButton_Click(object sender, EventArgs e) { var result = SupplierDetailsForm.CreateInsertDialog(); bool inserted = result == DialogResult.OK; if (inserted) { LoadDataToGrid(); } }
private void ShowUpdateForm() { Debug.Assert(gridView.FocusedRowHandle != -1); DataRow selected = gridView.GetFocusedDataRow(); var result = SupplierDetailsForm.CreateUpdateDialog(selected); bool inserted = result == DialogResult.OK; if (inserted) { LoadDataToGrid(); } }