private void grd_order_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex != -1) { if (e.ColumnIndex == 2) { //order viewing int invoiceid = int.Parse(grd_order.Rows[e.RowIndex].Cells[17].Value.ToString()); string invoice_no = grd_order.Rows[e.RowIndex].Cells[3].Value.ToString(); Ordermanagement_01.Tax.Tax_Invoice_Generation invoice_view = new Ordermanagement_01.Tax.Tax_Invoice_Generation(invoiceid, userid, "VIEW", invoice_no, user_roleid); invoice_view.Show(); } else if (e.ColumnIndex == 14) { //report viewing int invoiceid = int.Parse(grd_order.Rows[e.RowIndex].Cells[17].Value.ToString()); string invoice_no = grd_order.Rows[e.RowIndex].Cells[3].Value.ToString(); Ordermanagement_01.Tax.Tax_Invoice_Reports.Tax_Invoice_rpt invoice_rpt = new Ordermanagement_01.Tax.Tax_Invoice_Reports.Tax_Invoice_rpt(invoiceid); invoice_rpt.Show(); } else if (e.ColumnIndex == 15) { //invoice email sending } else if (e.ColumnIndex == 19) { //invoice delete int invoiceid = int.Parse(grd_order.Rows[e.RowIndex].Cells[17].Value.ToString()); DialogResult dialog = MessageBox.Show("Are you sure want to delete this Monthly invoice", "Monthly Invoice Delete confirmation", MessageBoxButtons.YesNo); if (dialog == DialogResult.Yes) { //delete this record ht.Clear(); dt.Clear(); ht.Add("@Trans", "DELETE__INVOICE"); ht.Add("@Tax_Invoice_Id", invoiceid); dt = dataaccess.ExecuteSP("Sp_Tax_Invoice_Entry", ht); MessageBox.Show("Invoice Deleted Successfully"); } Bind_Tax_Invoice_data(); } } }
private void btn_New_Invoice_Click(object sender, EventArgs e) { Ordermanagement_01.Tax.Tax_Invoice_Generation invoice_gen = new Ordermanagement_01.Tax.Tax_Invoice_Generation(0, userid, "Insert", "0", user_roleid); invoice_gen.Show(); }