/// <summary> /// To create one account ledger from this form /// </summary> public void AccountLedgerCreation() { try { if (CheckUserPrivilege.PrivilegeCheck(PublicVariables._decCurrentUserId, "frmAccountLedger", "Save")) { 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; frmAccountLedger open = Application.OpenForms["frmAccountLedger"] as frmAccountLedger; if (open == null) { frmAccountLedgerObj.WindowState = FormWindowState.Normal; frmAccountLedgerObj.MdiParent = formMDI.MDIObj; frmAccountLedgerObj.callFromPOS(this, isFromCashOrPartyCombo, isFromSalesAccountCombo); } else { open.MdiParent = formMDI.MDIObj; open.BringToFront(); open.callFromPOS(this, isFromCashOrPartyCombo, isFromSalesAccountCombo); if (open.WindowState == FormWindowState.Minimized) { open.WindowState = FormWindowState.Normal; } } this.Enabled = false; } else { MessageBox.Show("You don’t have privilege", "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { MessageBox.Show("POS : 21" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }