/// <summary> /// On double clicking the cell in grid, it loads the corresponding Voucher to update or delete the entries /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvBillAllocation_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex != -1) { decVoucherTypeId = Convert.ToDecimal(dgvBillAllocation.CurrentRow.Cells["voucherTypeId"].Value.ToString()); strTypeOfVoucher = dgvBillAllocation.CurrentRow.Cells["typeOfVoucher"].Value.ToString(); strVoucherNo = dgvBillAllocation.CurrentRow.Cells["voucherNo"].Value.ToString(); if (strTypeOfVoucher == "PDC Payable") { PDCPayableMasterSP sp = new PDCPayableMasterSP(); decimal decMasterId = sp.PdcPayableMasterIdView(decVoucherTypeId, strVoucherNo); frmPdcPayable frmpdcPayableObj = new frmPdcPayable(); frmpdcPayableObj = Application.OpenForms["frmPdcPayable"] as frmPdcPayable; if (frmpdcPayableObj == null) { frmpdcPayableObj = new frmPdcPayable(); frmpdcPayableObj.MdiParent = formMDI.MDIObj; frmpdcPayableObj.CallFromBillAllocation(this, decMasterId); } } if (strTypeOfVoucher == "PDC Receivable") { PDCReceivableMasterSP sp = new PDCReceivableMasterSP(); decimal decMasterId = sp.PdcReceivableMasterIdView(decVoucherTypeId, strVoucherNo); frmPdcReceivable frmPdcReceivableObj = new frmPdcReceivable(); frmPdcReceivableObj = Application.OpenForms["frmPdcReceivable"] as frmPdcReceivable; if (frmPdcReceivableObj == null) { frmPdcReceivableObj = new frmPdcReceivable(); frmPdcReceivableObj.MdiParent = formMDI.MDIObj; frmPdcReceivableObj.CallFromBillAllocation(this, decMasterId); } } if (strTypeOfVoucher == "Payment Voucher") { PaymentMasterSP sp = new PaymentMasterSP(); decimal decMasterId = sp.paymentMasterIdView(decVoucherTypeId, strVoucherNo); frmPaymentVoucher frmPaymentVoucherObj = new frmPaymentVoucher(); frmPaymentVoucherObj = Application.OpenForms["frmPaymentVoucher"] as frmPaymentVoucher; if (frmPaymentVoucherObj == null) { frmPaymentVoucherObj = new frmPaymentVoucher(); frmPaymentVoucherObj.MdiParent = formMDI.MDIObj; frmPaymentVoucherObj.CallFromBillAllocation(this, decMasterId); } } if (strTypeOfVoucher == "Receipt Voucher") { ReceiptMasterSP sp = new ReceiptMasterSP(); decimal decMasterId = sp.ReceiptMasterIdView(decVoucherTypeId, strVoucherNo); frmReceiptVoucher frmReceiptVoucherObj = new frmReceiptVoucher(); frmReceiptVoucherObj = Application.OpenForms["frmReceiptVoucher"] as frmReceiptVoucher; if (frmReceiptVoucherObj == null) { frmReceiptVoucherObj = new frmReceiptVoucher(); frmReceiptVoucherObj.MdiParent = formMDI.MDIObj; frmReceiptVoucherObj.CallFromBillAllocation(this, decMasterId); } } if (strTypeOfVoucher == "Journal Voucher") { JournalMasterSP sp = new JournalMasterSP(); decimal decMasterId = sp.JournalMasterIdView(decVoucherTypeId, strVoucherNo); frmJournalVoucher frmJournalVoucherObj = new frmJournalVoucher(); frmJournalVoucherObj = Application.OpenForms["frmJournalVoucher"] as frmJournalVoucher; if (frmJournalVoucherObj == null) { frmJournalVoucherObj = new frmJournalVoucher(); frmJournalVoucherObj.MdiParent = formMDI.MDIObj; frmJournalVoucherObj.CallFromBillAllocation(this, decMasterId); } } if (strTypeOfVoucher == "Credit Note") { CreditNoteMasterSP sp = new CreditNoteMasterSP(); decimal decMasterId = sp.CreditNoteMasterIdView(decVoucherTypeId, strVoucherNo); frmCreditNote frmCreditNoteObj = new frmCreditNote(); frmCreditNoteObj = Application.OpenForms["frmCreditNote"] as frmCreditNote; if (frmCreditNoteObj == null) { frmCreditNoteObj = new frmCreditNote(); frmCreditNoteObj.MdiParent = formMDI.MDIObj; frmCreditNoteObj.CallFromBillAllocation(this, decMasterId); } } if (strTypeOfVoucher == "Debit Note") { DebitNoteMasterSP sp = new DebitNoteMasterSP(); decimal decMasterId = sp.DebitNoteMasterIdView(decVoucherTypeId, strVoucherNo); frmDebitNote frmDebitNoteObj = new frmDebitNote(); frmDebitNoteObj = Application.OpenForms["frmDebitNote"] as frmDebitNote; if (frmDebitNoteObj == null) { frmDebitNoteObj = new frmDebitNote(); frmDebitNoteObj.MdiParent = formMDI.MDIObj; frmDebitNoteObj.CallFromBillAllocation(this, decMasterId); } } } } catch (Exception ex) { formMDI.infoError.ErrorString = "BA15:" + ex.Message; } }
/// <summary> /// On double clicking the cell in grid, it loads the corresponding Voucher to update or delete the entries /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvBillAllocation_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex != -1) { decVoucherTypeId = Convert.ToDecimal(dgvBillAllocation.CurrentRow.Cells["voucherTypeId"].Value.ToString()); strTypeOfVoucher = dgvBillAllocation.CurrentRow.Cells["typeOfVoucher"].Value.ToString(); strVoucherNo = dgvBillAllocation.CurrentRow.Cells["voucherNo"].Value.ToString(); if (strTypeOfVoucher == "PDC Payable") { PDCPayableBll BllPDCPayable = new PDCPayableBll(); decimal decMasterId = BllPDCPayable.PdcPayableMasterIdView(decVoucherTypeId, strVoucherNo); frmPdcPayable frmpdcPayableObj = new frmPdcPayable(); frmpdcPayableObj = Application.OpenForms["frmPdcPayable"] as frmPdcPayable; if (frmpdcPayableObj == null) { frmpdcPayableObj = new frmPdcPayable(); frmpdcPayableObj.MdiParent = formMDI.MDIObj; frmpdcPayableObj.CallFromBillAllocation(this, decMasterId); } } if (strTypeOfVoucher == "PDC Receivable") { PDCRecivebleBll BllPDCReciveble = new PDCRecivebleBll(); decimal decMasterId = BllPDCReciveble.PdcReceivableMasterIdView(decVoucherTypeId, strVoucherNo); frmPdcReceivable frmPdcReceivableObj = new frmPdcReceivable(); frmPdcReceivableObj = Application.OpenForms["frmPdcReceivable"] as frmPdcReceivable; if (frmPdcReceivableObj == null) { frmPdcReceivableObj = new frmPdcReceivable(); frmPdcReceivableObj.MdiParent = formMDI.MDIObj; frmPdcReceivableObj.CallFromBillAllocation(this, decMasterId); } } if (strTypeOfVoucher == "Payment Voucher") { PaymentVoucherBll BllPaymentVoucher = new PaymentVoucherBll(); decimal decMasterId = BllPaymentVoucher.paymentMasterIdView(decVoucherTypeId, strVoucherNo); frmPaymentVoucher frmPaymentVoucherObj = new frmPaymentVoucher(); frmPaymentVoucherObj = Application.OpenForms["frmPaymentVoucher"] as frmPaymentVoucher; if (frmPaymentVoucherObj == null) { frmPaymentVoucherObj = new frmPaymentVoucher(); frmPaymentVoucherObj.MdiParent = formMDI.MDIObj; frmPaymentVoucherObj.CallFromBillAllocation(this, decMasterId); } } if (strTypeOfVoucher == "Receipt Voucher") { RecieptVoucherBll bllRecieptVoucherBll = new RecieptVoucherBll(); decimal decMasterId = bllRecieptVoucherBll.ReceiptMasterIdView(decVoucherTypeId, strVoucherNo); frmReceiptVoucher frmReceiptVoucherObj = new frmReceiptVoucher(); frmReceiptVoucherObj = Application.OpenForms["frmReceiptVoucher"] as frmReceiptVoucher; if (frmReceiptVoucherObj == null) { frmReceiptVoucherObj = new frmReceiptVoucher(); frmReceiptVoucherObj.MdiParent = formMDI.MDIObj; frmReceiptVoucherObj.CallFromBillAllocation(this, decMasterId); } } if (strTypeOfVoucher == "Journal Voucher") { JournalVoucherBll JournalVoucherbll = new JournalVoucherBll(); decimal decMasterId = JournalVoucherbll.JournalMasterIdView(decVoucherTypeId, strVoucherNo); frmJournalVoucher frmJournalVoucherObj = new frmJournalVoucher(); frmJournalVoucherObj = Application.OpenForms["frmJournalVoucher"] as frmJournalVoucher; if (frmJournalVoucherObj == null) { frmJournalVoucherObj = new frmJournalVoucher(); frmJournalVoucherObj.MdiParent = formMDI.MDIObj; frmJournalVoucherObj.CallFromBillAllocation(this, decMasterId); } } if (strTypeOfVoucher == "Credit Note") { CreditNoteBll BllCreditNoteMaster = new CreditNoteBll(); decimal decMasterId = BllCreditNoteMaster.CreditNoteMasterIdView(decVoucherTypeId, strVoucherNo); frmCreditNote frmCreditNoteObj = new frmCreditNote(); frmCreditNoteObj = Application.OpenForms["frmCreditNote"] as frmCreditNote; if (frmCreditNoteObj == null) { frmCreditNoteObj = new frmCreditNote(); frmCreditNoteObj.MdiParent = formMDI.MDIObj; frmCreditNoteObj.CallFromBillAllocation(this, decMasterId); } } if (strTypeOfVoucher == "Debit Note") { //DebitNoteMasterSP sp = new DebitNoteMasterSP(); DebitNoteBll bll = new DebitNoteBll(); decimal decMasterId = bll.DebitNoteMasterIdView(decVoucherTypeId, strVoucherNo); frmDebitNote frmDebitNoteObj = new frmDebitNote(); frmDebitNoteObj = Application.OpenForms["frmDebitNote"] as frmDebitNote; if (frmDebitNoteObj == null) { frmDebitNoteObj = new frmDebitNote(); frmDebitNoteObj.MdiParent = formMDI.MDIObj; frmDebitNoteObj.CallFromBillAllocation(this, decMasterId); } } } } catch (Exception ex) { MessageBox.Show("BA:15" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }