/// <summary> /// To create one account ledger from this form /// </summary> public void AccountLedgerCreation() { try { if (cmbCashOrParty.SelectedValue != null) { strCashOrParty = cmbCashOrParty.SelectedValue.ToString(); } else { strCashOrParty = string.Empty; } if (cmbSalesAccount.SelectedValue != null) { strSalesAccount = cmbSalesAccount.SelectedValue.ToString(); } else { strSalesAccount = string.Empty; } frmAccountLedger frmAccountLedgerObj = new frmAccountLedger(); frmAccountLedgerObj.MdiParent = formMDI.MDIObj; frmAccountLedgerObj.callFromSalesInvoice(this, isFromCashOrPartyCombo, isFromSalesAccountCombo); } catch (Exception ex) { MessageBox.Show("SI: 19" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// To create a new Sales account from this button click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnNewSalesAccount_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.callFromSalesInvoice(this, isFromCashOrPartyCombo, isFromSalesAccountCombo); } else { open.MdiParent = formMDI.MDIObj; open.BringToFront(); open.callFromSalesInvoice(this, isFromCashOrPartyCombo, isFromSalesAccountCombo); if (open.WindowState == FormWindowState.Minimized) { open.WindowState = FormWindowState.Normal; } } this.Enabled = false; } catch (Exception ex) { MessageBox.Show("SI: 96" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Error); } }