/// <summary> /// Call Corresponding Voucher to View details for updation in edit mode /// </summary> public void GotoAdvancePayment() { try { frmAdvancePayment frmobj = new frmAdvancePayment(); frmAdvancePayment _isOpen = Application.OpenForms["frmAdvancepayment"] as frmAdvancePayment; if (_isOpen == null) { frmobj.WindowState = FormWindowState.Normal; frmobj.MdiParent = formMDI.MDIObj; frmobj.Show(); frmobj.CallThisFormFromVoucherSearch(this, Convert.ToDecimal(dgvVoucherSearch.CurrentRow.Cells["Id"].Value.ToString())); } else { _isOpen.MdiParent = formMDI.MDIObj; if (_isOpen.WindowState == FormWindowState.Minimized) { _isOpen.WindowState = FormWindowState.Normal; } else { _isOpen.Activate(); } _isOpen.CallThisFormFromVoucherSearch(this, Convert.ToDecimal(dgvVoucherSearch.CurrentRow.Cells["Id"].Value.ToString())); _isOpen.BringToFront(); } } catch (Exception ex) { MessageBox.Show("VS12:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// On form closing /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void frmLedgerPopup_FormClosing(object sender, FormClosingEventArgs e) { try { if (frmMonthlySalaryRegisterObj != null) { frmMonthlySalaryRegisterObj = Application.OpenForms["frmMonthlySalaryRegister"] as frmMonthlySalaryRegister; if (frmMonthlySalaryRegisterObj == null) { frmMonthlySalaryRegisterObj = new frmMonthlySalaryRegister(); frmMonthlySalaryRegisterObj.MdiParent = formMDI.MDIObj; frmMonthlySalaryRegisterObj.Show(); } else { frmMonthlySalaryRegisterObj.Activate(); } } if (frmAdvancePaymentObj != null) { frmAdvancePaymentObj = Application.OpenForms["frmAdvancePayment"] as frmAdvancePayment; if (frmAdvancePaymentObj == null) { frmAdvancePaymentObj = new frmAdvancePayment(); frmAdvancePaymentObj.MdiParent = formMDI.MDIObj; frmAdvancePaymentObj.Show(); } else { frmAdvancePaymentObj.Activate(); } } if (frmMonthlySalaryVoucherObj != null) { frmMonthlySalaryVoucherObj = Application.OpenForms["frmMonthlySalaryVoucher"] as frmMonthlySalaryVoucher; if (frmMonthlySalaryVoucherObj == null) { frmMonthlySalaryVoucherObj = new frmMonthlySalaryVoucher(); frmMonthlySalaryVoucherObj.MdiParent = formMDI.MDIObj; frmMonthlySalaryVoucherObj.Show(); } else { frmMonthlySalaryVoucherObj.Activate(); } } if (frmDailySalaryVoucherObj != null) { frmDailySalaryVoucherObj = Application.OpenForms["frmDailySalaryVoucher"] as frmDailySalaryVoucher; if (frmDailySalaryVoucherObj == null) { frmDailySalaryVoucherObj = new frmDailySalaryVoucher(); frmDailySalaryVoucherObj.MdiParent = formMDI.MDIObj; frmDailySalaryVoucherObj.Show(); } else { frmDailySalaryVoucherObj.Activate(); } } if (frmJournalVoucherObj != null) { frmJournalVoucherObj.Enabled = true; } if (frmReceiptVoucherObj != null) { frmReceiptVoucherObj.Enabled = true; } if (frmContraVoucherObj != null) { frmContraVoucherObj = Application.OpenForms["frmContraVoucher"] as frmContraVoucher; if (frmContraVoucherObj == null) { frmContraVoucherObj = new frmContraVoucher(); frmContraVoucherObj.MdiParent = formMDI.MDIObj; frmContraVoucherObj.Show(); } else { frmContraVoucherObj.Activate(); } } if (frmPaymentVoucherObj != null) { frmPaymentVoucherObj.Enabled = true; } if (frmDebitNoteObj != null) { frmDebitNoteObj.Enabled = true; } if (frmCreditNoteObj != null) { frmCreditNoteObj.Enabled = true; } if (frmPdcPayableObj != null) { frmPdcPayableObj.Enabled = true; } if (frmpdReceivableObj != null) { frmpdReceivableObj.Enabled = true; } if (frmMaterialReceiptObj != null) { frmMaterialReceiptObj.Enabled = true; } if (frmSalesInvoiceObj != null) { frmSalesInvoiceObj.Enabled = true; } if (frmPOSObj != null) { frmPOSObj.Enabled = true; } if (frmMaterialReceiptObj != null) { frmMaterialReceiptObj = Application.OpenForms["frmMaterialReceipt"] as frmMaterialReceipt; if (frmMaterialReceiptObj == null) { frmMaterialReceiptObj = new frmMaterialReceipt(); frmMaterialReceiptObj.MdiParent = formMDI.MDIObj; frmMaterialReceiptObj.Show(); } else { frmMaterialReceiptObj.Activate(); } } if (frmPurchaseInvoiceObj != null) { frmPurchaseInvoiceObj = Application.OpenForms["frmPurchaseInvoice"] as frmPurchaseInvoice; if (frmPurchaseInvoiceObj == null) { frmPurchaseInvoiceObj = new frmPurchaseInvoice(); frmPurchaseInvoiceObj.MdiParent = formMDI.MDIObj; frmPurchaseInvoiceObj.Show(); } else { frmPurchaseInvoiceObj.Activate(); } } if (frmServiceVoucherObj != null) { frmServiceVoucherObj.Enabled = true; } dgvLedgerPopup.ClearSelection(); } catch (Exception ex) { MessageBox.Show("LP35:" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }