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