/// <summary> /// On FormClosing opens the form from which frmCurrencyDetails form has opened /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void frmCurrencyDetails_FormClosing(object sender, FormClosingEventArgs e) { try { if (frmExchangeRateObj != null) { frmExchangeRateObj = Application.OpenForms["frmExchangeRate"] as frmExchangeRate; if (frmExchangeRateObj == null) { frmExchangeRateObj = new frmExchangeRate(); frmExchangeRateObj.MdiParent = formMDI.MDIObj; frmExchangeRateObj.Show(); } else { frmExchangeRateObj.Activate(); } } if (frmCompanyCreationObj != null) { frmCompanyCreationObj = Application.OpenForms["frmCompanyCreation"] as frmCompanyCreation; if (frmCompanyCreationObj == null) { frmCompanyCreationObj = new frmCompanyCreation(); frmCompanyCreationObj.MdiParent = formMDI.MDIObj; frmCompanyCreationObj.Show(); } else { frmCompanyCreationObj.Activate(); } } if (frmJournalVoucherObj != null) { frmJournalVoucherObj.Enabled = true; } if (frmDebitNoteObj != null) { frmDebitNoteObj.Enabled = true; } if (frmCreditNoteObj != null) { frmCreditNoteObj.Enabled = true; } } catch (Exception ex) { MessageBox.Show("CDP14:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Calls frmExchangeRate form /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void exchangeRateToolStripMenuItem_Click(object sender, EventArgs e) { try { frmExchangeRate frm = new frmExchangeRate(); frmExchangeRate open = Application.OpenForms["frmExchangeRate"] as frmExchangeRate; if (open == null) { frm.MdiParent = this; frm.Show(); } else { open.Activate(); if (open.WindowState == FormWindowState.Minimized) { open.WindowState = FormWindowState.Normal; } } } catch (Exception ex) { MessageBox.Show("MDI 68 : " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }