private void Cmb_SelectedIndexChanged(object sender, EventArgs e) { ComboBox cmb = (ComboBox)sender; if (cmb.Text == "Challan") { string orderID = dgvBills.CurrentRow.Cells["OrderID"].Value.ToString(); PurchaseChallanEntry frmChallanEntry = new PurchaseChallanEntry(orderID); frmChallanEntry.OnClose += GenerateOrderList; frmChallanEntry.ShowDialog(); } if (cmb.Text == "Bill") { string orderID = dgvBills.CurrentRow.Cells["OrderID"].Value.ToString(); PurchaseBillEntry frmbillEntry = new PurchaseBillEntry(PurchaseBillEntry._CameFrom.Order, orderID, ""); frmbillEntry.OnClose += GenerateOrderList; frmbillEntry.ShowDialog(); } if (cmb.Text == "Advance Payment") { string orderID = dgvBills.CurrentRow.Cells["OrderID"].Value.ToString(); AdvancePayment frmadvancePayment = new AdvancePayment(AdvancePayment._FromWherere.Order, orderID); frmadvancePayment.Onclose += GenerateOrderList; frmadvancePayment.ShowDialog(); } }
private void dgvChallanList_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (dgvChallanList.Columns[e.ColumnIndex].Name != "Action" && e.RowIndex != -1) { if (UserTools._IsEdit) { int rowindex = dgvChallanList.SelectedCells[0].RowIndex; string challanid = dgvChallanList.Rows[rowindex].Cells["challanId"].Value.ToString(); string status = dgvChallanList.Rows[rowindex].Cells["Status"].Value.ToString(); PurchaseChallanEntry challanEntry = new PurchaseChallanEntry(challanid, status); challanEntry.OnClose += GenerateChallanList; challanEntry.Show(this); } else { MessageBox.Show("Permission Denied", "Edit", MessageBoxButtons.OK, MessageBoxIcon.Stop); } } }