Exemplo n.º 1
0
 /// <summary>
 /// to add a new Sales Account using this button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSalesAcct_Click(object sender, EventArgs e)
 {
     try
     {
         isFromSalesAccountCombo = true;
         isFromCashOrPartyCombo = false;
         if (cmbSalesAccount.SelectedValue != null)
         {
             strSalesAccount = cmbSalesAccount.SelectedValue.ToString();
         }
         else
         {
             strSalesAccount = string.Empty;
         }
         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.CallFromSalesReturn(this, isFromCashOrPartyCombo, isFromSalesAccountCombo);
         }
         else
         {
             open.MdiParent = formMDI.MDIObj;
             open.BringToFront();
             open.CallFromSalesReturn(this, isFromCashOrPartyCombo, isFromSalesAccountCombo);
             if (open.WindowState == FormWindowState.Minimized)
             {
                 open.WindowState = FormWindowState.Normal;
             }
         }
         this.Enabled = false;
     }
     catch (Exception ex)
     {
         MessageBox.Show("SR99:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// to add a new cash or party using this button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnCashOrParty_Click(object sender, EventArgs e)
 {
     try
     {
         isFromCashOrPartyCombo = true;
         isFromSalesAccountCombo = false;
         if (cmbCashOrParty.SelectedValue != null)
         {
             strCashOrPartyAccount = cmbCashOrParty.SelectedValue.ToString();
         }
         else
         {
             strCashOrPartyAccount = string.Empty;
         }
         frmAccountLedger frmAccountLedgerObj = new frmAccountLedger();
         frmAccountLedgerObj.MdiParent = formMDI.MDIObj;
         frmAccountLedgerObj.CallFromSalesReturn(this, isFromCashOrPartyCombo, isFromSalesAccountCombo);
         this.Enabled = false;
     }
     catch (Exception ex)
     {
         MessageBox.Show("SR96:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }