private void BtnAddPur_Click(object sender, EventArgs e) { AddPurchaseInvoice m = new AddPurchaseInvoice(usrId, 0); try { m.btnAdd.Text = "Add New"; m.ShowDialog(); RefrechImports(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void BtnUpInvoice_Click(object sender, EventArgs e) { try { var purID = Convert.ToInt32(dgvPuchases.CurrentRow.Cells[0].Value); AddPurchaseInvoice m = new AddPurchaseInvoice(usrId, purID); m.btnAdd.Text = "Update"; m.ShowDialog(); RefrechImports(); } catch (Exception ex) { MessageBox.Show (ex.Message); } }