private void newToolStripMenuItem_Click(object sender, EventArgs e) { try { frmInvoicer objInvoicer = new frmInvoicer(); objInvoicer.ShowDialog(this); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); throw ex; } }
private void editToolStripMenuItem_Click(object sender, EventArgs e) { int intInvoiceID = 0; try { if (dgInvoice.SelectedRows.Count >= 1) { intInvoiceID = Convert.ToInt32(dgInvoice.SelectedRows[0].Cells["InvoiceID"].Value.ToString()); //this.Owner.ShowDialog(this); //frmInvoicer objInvoicer = new frmInvoicer(intInvoiceNo); //objInvoicer.ShowDialog(this); //this.Owner.Close(); frmInvoicer myParent = (frmInvoicer)this.Owner; myParent.DisplayData(intInvoiceID); this.Close(); } } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); throw ex; } }