Ejemplo n.º 1
0
 /// <summary>
 /// To add new ledger from these form
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnNewAccountLedger2_Click(object sender, EventArgs e)
 {
     try
     {
         if (cmbBank.SelectedValue != null)
         {
             strBankID = cmbBank.SelectedValue.ToString();
         }
         else
         {
             strBankID = "0";
         }
         frmAccountLedger frmAccountLedgerObj = new frmAccountLedger();
         frmAccountLedgerObj.MdiParent = formMDI.MDIObj;
         frmAccountLedger open = Application.OpenForms["frmAccountLedger"] as frmAccountLedger;
         if (open == null)
         {
             frmAccountLedgerObj.WindowState = FormWindowState.Normal;
             frmAccountLedgerObj.MdiParent = formMDI.MDIObj;
             frmAccountLedgerObj.CallThisFormFromPDCPayable2(this);
         }
         else
         {
             open.MdiParent = formMDI.MDIObj;
             open.BringToFront();
             open.CallThisFormFromPDCPayable2(this);
             if (open.WindowState == FormWindowState.Minimized)
             {
                 open.WindowState = FormWindowState.Normal;
             }
         }
         this.Enabled = false;
     }
     catch (Exception ex)
     {
         MessageBox.Show("PP49:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }