Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            path = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());
            OnlineUserSessionBo.CheckSession();
            customerVo         = (CustomerVo)Session["customerVo"];
            userVo             = (UserVo)Session["userVo"];
            Session["OrderId"] = OrderId;
            if (System.Web.HttpContext.Current.Session["BackOfficeUserId"] != null)
            {
                BackOfficeUserId = Convert.ToInt32(Session["BackOfficeUserId"]);
            }
            else
            {
                BackOfficeUserId = 0;
            }

            RadInformation.VisibleOnPageLoad = false;
            TimeSpan now = DateTime.Now.TimeOfDay;

            if (Session["ExchangeMode"] != null && Session["ExchangeMode"].ToString() == "Demat")
            {
                CommonLookupBo boCommon = new CommonLookupBo();
                if (!boCommon.CheckForBusinessDate(DateTime.Now))
                {
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "LoadBottomPanelFromBlocking", "LoadTransactPanel('MFOnlineSchemeManager');", true);
                    return;
                }
                if (!(now >= TimeSpan.Parse(ConfigurationSettings.AppSettings["BSETradeOpTime"]) && now <= TimeSpan.Parse(ConfigurationSettings.AppSettings["BSETradeEnTime"])))
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscriptvwewv", "LoadTransactPanel('MFOnlineSchemeManager')", true);
                    return;
                }
            }
            int TOcpmaretime = int.Parse(DateTime.Now.ToShortTimeString().Split(':')[0]);

            if (TOcpmaretime >= int.Parse(ConfigurationSettings.AppSettings["START_TIME"]) && TOcpmaretime < int.Parse(ConfigurationSettings.AppSettings["END_TIME"]))
            {
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscriptvwewv", "LoadTransactPanel('MFOnlineSchemeManager')", true);
                return;
            }

            if (Session["ExchangeMode"] != null)
            {
                exchangeType = Session["ExchangeMode"].ToString();
            }
            else
            {
                exchangeType = "Online";
            }

            if (!IsPostBack)
            {
                BindKYCDetailDDl();

                clientMFAccessCode = onlineMforderBo.GetClientMFAccessStatus(customerVo.CustomerId);
                if (clientMFAccessCode == "FA")
                {
                    ShowAvailableLimits();

                    lblOption.Visible       = false;
                    lblDividendType.Visible = false;
                    if ((Request.QueryString["accountId"] != null && Request.QueryString["SchemeCode"] != null) || Session["MFSchemePlan"] != null)
                    {
                        int    accountId  = 0;
                        int    schemeCode = 0;
                        int    amcCode    = 0;
                        string category   = string.Empty;
                        if (Request.QueryString["accountId"] != null)
                        {
                            schemeCode = int.Parse(Session["MFSchemePlan"].ToString());
                            accountId  = int.Parse(Request.QueryString["accountId"].ToString());
                            commonLookupBo.GetSchemeAMCSchemeCategory(int.Parse(Session["MFSchemePlan"].ToString()), out amcCode, out category, out categoryname, out amcName, out schemeName, out IsSIPAvaliable, out IspurchaseAvaliable, out IsRedeemAvaliable, exchangeType == "Online" ? 1 : 0);
                            lblNavDisplay.Text       = "";
                            lblMintxt.Text           = "";
                            lblMulti.Text            = "";
                            lbltime.Text             = "";
                            lblSchemeRatingAsOn.Text = "";
                            if (IspurchaseAvaliable != 1)
                            {
                                ShowMessage("Purchase is not available", 'I');

                                return;
                            }

                            lblAmc.Text      = amcName;
                            lblCategory.Text = categoryname;
                            lblScheme.Text   = schemeName;
                            BindFolioNumber(int.Parse(Session["MFSchemePlan"].ToString()));
                            ddlFolio.SelectedValue = accountId.ToString();
                            tdFolio.Visible        = true;
                            DataSet ds = onlineMforderBo.GetCustomerSchemeFolioHoldings(customerVo.CustomerId, int.Parse(Session["MFSchemePlan"].ToString()), out schemeDividendOption, exchangeType == "Online" ? 1 : 0, accountId);
                            GetControlDetails(ds);
                            SetControlDetails();
                        }
                        else
                        {
                            //if (exchangeType == "Online")
                            //    tdFolio.Visible = true;
                            //else
                            //{
                            DataSet ds;
                            ds = onlineMforderBo.GetControlDetails(int.Parse(Session["MFSchemePlan"].ToString()), null, exchangeType == "Online" ? 1 : 0);
                            lblUnitsheldDisplay.Visible = false;
                            GetControlDetails(ds);

                            //}
                            scheme                   = int.Parse(Session["MFSchemePlan"].ToString());
                            lblNavDisplay.Text       = "";
                            lblMintxt.Text           = "";
                            lblMulti.Text            = "";
                            lbltime.Text             = "";
                            lblSchemeRatingAsOn.Text = "";
                            //commonLookupBo.GetSchemeAMCCategory(38122, out amcCode, out category);
                            commonLookupBo.GetSchemeAMCSchemeCategory(int.Parse(Session["MFSchemePlan"].ToString()), out amcCode, out category, out categoryname, out amcName, out schemeName, out IsSIPAvaliable, out IspurchaseAvaliable, out IsRedeemAvaliable, exchangeType == "Online" ? 1 : 0);
                            if (IspurchaseAvaliable != 1)
                            {
                                ShowMessage("Purchase is not available", 'I'); return;
                            }

                            BindFolioNumber(int.Parse(Session["MFSchemePlan"].ToString()));
                            lblAmc.Text      = amcName;
                            lblScheme.Text   = schemeName;
                            lblCategory.Text = categoryname;
                            DataSet dst = onlineMforderBo.GetControlDetails(int.Parse(Session["MFSchemePlan"].ToString()), null, exchangeType == "Online" ? 1 : 0);
                            lblUnitsheldDisplay.Visible = false;
                            GetControlDetails(dst);
                            SetControlDetails();
                        }
                    }
                }
                else
                {
                    ShowMessage(onlineMforderBo.GetOnlineOrderUserMessage(clientMFAccessCode), 'I');
                    PurchaseOrderControlsEnable(false);
                    divControlContainer.Visible = false;
                }
            }
        }