private void dgInvoiceList_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == this.dgInvoiceList.Columns["View"].Index || e.ColumnIndex == -1) { string invoiceNo = Convert.ToString(this.dgInvoiceList.CurrentRow.Cells["InvoiceNo"].Value); FillOrderItem(invoiceNo); } else if (e.ColumnIndex == this.dgInvoiceList.Columns["Print"].Index) { string invoiceNo = Convert.ToString(this.dgInvoiceList.CurrentRow.Cells["InvoiceNo"].Value); FillOrderItem(invoiceNo); PrintInvoice(invoiceNo); } else if (e.ColumnIndex == this.dgInvoiceList.Columns["Edit"].Index) { string invoiceNo = Convert.ToString(this.dgInvoiceList.CurrentRow.Cells["InvoiceNo"].Value); CreateInvoice createInvoice = new CreateInvoice(); createInvoice.MdiParent = this.ParentForm; createInvoice.strInvoiceNo = invoiceNo; this.ParentForm.ActiveMdiChild.Close(); createInvoice.Show(); //FillOrderItem(invoiceNo); //PrintInvoice(invoiceNo); } }
private void invoiceAddToolStripMenuItem_Click(object sender, EventArgs e) { if (_instanceInvoiceCreate == null) { CloseAllForms(); _instanceInvoiceCreate = new Invoice.CreateInvoice(); _instanceInvoiceCreate.MdiParent = this; _instanceInvoiceCreate.FormClosed += instanceInvoiceCreateHasBeenClosed; } else { ShowMessage(); } _instanceInvoiceCreate.Show(); }