private void BindFolioNumber(int amcCode, string schemeType)
 {
     try
     {
         DataTable dtGetAmcFolioNo = new DataTable();
         dtGetAmcFolioNo = commonLookupBo.GetFolioNumberForSIP(Convert.ToInt32(ddlAmc.SelectedValue), customerVo.CustomerId, 0);
         if (schemeType == "SO")
         {
             if (dtGetAmcFolioNo.Rows.Count > 0)
             {
                 ddlFolio.Items.Clear();
                 ddlFolio.DataSource     = dtGetAmcFolioNo;
                 ddlFolio.DataTextField  = dtGetAmcFolioNo.Columns["CMFA_FolioNum"].ToString();
                 ddlFolio.DataValueField = dtGetAmcFolioNo.Columns["CMFA_AccountId"].ToString();
                 ddlFolio.DataBind();
                 ddlFolio.Items.Insert(0, new ListItem("Select", "0"));
             }
         }
         else
         {
             ddlSwitchFolio.DataSource     = dtGetAmcFolioNo;
             ddlSwitchFolio.DataTextField  = dtGetAmcFolioNo.Columns["CMFA_FolioNum"].ToString();
             ddlSwitchFolio.DataValueField = dtGetAmcFolioNo.Columns["CMFA_AccountId"].ToString();
             ddlSwitchFolio.DataBind();
             ddlSwitchFolio.Items.Insert(0, new ListItem("Select", "0"));
         }
     }
     catch (BaseApplicationException Ex)
     {
         throw (Ex);
     }
 }
Exemplo n.º 2
0
        private void BindFolioNumber(int amcCode)
        {
            DataTable dtCustomerFolioList;

            try
            {
                ddlFolio.Items.Clear();
                dtCustomerFolioList = commonLookupBo.GetFolioNumberForSIP(amcCode, customerVo.CustomerId, 0);
                if (dtCustomerFolioList.Rows.Count > 0)
                {
                    ddlFolio.DataSource     = dtCustomerFolioList;
                    ddlFolio.DataTextField  = dtCustomerFolioList.Columns["CMFA_FolioNum"].ToString();
                    ddlFolio.DataValueField = dtCustomerFolioList.Columns["CMFA_AccountId"].ToString();
                    ddlFolio.DataBind();
                }
                ddlFolio.Items.Insert(0, new System.Web.UI.WebControls.ListItem("--SELECT--", "0"));
                //ddlFolio.Items.Insert(0, new System.Web.UI.WebControls.ListItem("--SELECT--", "0"));
                //ddlFolio.Items.Insert(0, new ListItem("--SELECT--"));
                ddlFolio.Items.Insert(1, new ListItem("New", "1"));
                ddlFolio.SelectedIndex = 0;
            }
            catch (BaseApplicationException Ex)
            {
                throw (Ex);
            }
        }
        private void BindFolioNumber(int amcCode)
        {
            ddlFolio.Items.Clear();
            if (ddlAmc.SelectedIndex == 0)
            {
                return;
            }

            DataTable dtScheme = new DataTable();
            DataTable dtgetfolioNo;

            try
            {
                if (strAction != "Edit")
                {
                    dtgetfolioNo = commonLookupBo.GetFolioNumberForSIP(Convert.ToInt32(ddlAmc.SelectedValue), customerVo.CustomerId, 0);
                }
                else
                {
                    dtgetfolioNo = commonLookupBo.GetFolioNumberForSIP(Convert.ToInt32(onlineMFOrderVo.AssetGroup), customerVo.CustomerId, 0);
                }

                if (dtgetfolioNo.Rows.Count > 0)
                {
                    ddlFolio.DataSource     = dtgetfolioNo;
                    ddlFolio.DataTextField  = dtgetfolioNo.Columns["CMFA_FolioNum"].ToString();
                    ddlFolio.DataValueField = dtgetfolioNo.Columns["CMFA_AccountId"].ToString();
                    ddlFolio.DataBind();
                }
                ddlFolio.Items.Insert(0, new System.Web.UI.WebControls.ListItem("--SELECT--", "0"));
                //ddlFolio.Items.Insert(0, new System.Web.UI.WebControls.ListItem("--SELECT--", "0"));
                //ddlFolio.Items.Insert(0, new ListItem("--SELECT--"));
                //ddlFolio.Items.Insert(1, new ListItem("New", "1"));
                ddlFolio.SelectedIndex = 0;
            }
            catch (BaseApplicationException Ex)
            {
                throw (Ex);
            }
        }
        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"];
            RadInformation.VisibleOnPageLoad   = false;
            rwTermsCondition.VisibleOnPageLoad = false;
            TimeSpan now = DateTime.Now.TimeOfDay;

            if (System.Web.HttpContext.Current.Session["BackOfficeUserId"] != null)
            {
                BackOfficeUserId = Convert.ToInt32(Session["BackOfficeUserId"]);
            }
            else
            {
                BackOfficeUserId = 0;
            }
            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)
            {
                clientMFAccessCode = onlineMforderBo.GetClientMFAccessStatus(customerVo.CustomerId);
                if (clientMFAccessCode == "FA" || clientMFAccessCode == "PA")
                {
                    AmcBind();
                    //CategoryBind();
                    BindNomineeAndJointHolders();
                    dtgetfolioNo         = commonLookupBo.GetFolioNumberForSIP(0, customerVo.CustomerId, exchangeType == "Online" ? 0 : 1);
                    lnkOfferDoc.Visible  = false;
                    lnkFactSheet.Visible = false;
                    lnkExitLoad.Visible  = false;
                    //txtRedeemTypeValue.Visible = false;
                    //lblOption.Visible = false;
                    //lblDividendType.Visible = false;
                    trDividendOption.Visible = false;
                    trRedeemType.Visible     = true;
                    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.GetSchemeAMCCategory(schemeCode, 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 (IsRedeemAvaliable != 1)
                            {
                                ShowMessage("Redeem is not available", 'I'); return;
                            }


                            lblAmc.Text      = amcName;
                            lblCategory.Text = categoryname;
                            lblScheme.Text   = schemeName;
                            dtgetfolioNo     = commonLookupBo.GetFolioNumberForSIP(amcCode, customerVo.CustomerId, exchangeType == "Online" ? 0 : 1);
                            SetSelectedDisplay(accountId, int.Parse(Session["MFSchemePlan"].ToString()), amcCode, category);
                        }
                        else
                        {
                            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 (IsRedeemAvaliable != 1)
                            {
                                ShowMessage("Redeem is not available", 'I'); return;
                            }

                            lblAmc.Text      = amcName;
                            lblCategory.Text = categoryname;
                            lblScheme.Text   = schemeName;

                            SetSelectedDisplay(0, int.Parse(Session["MFSchemePlan"].ToString()), amcCode, category);
                        }
                    }
                }
                else
                {
                    ShowMessage(onlineMforderBo.GetOnlineOrderUserMessage(clientMFAccessCode), 'F');
                    PurchaseOrderControlsEnable(false);
                    divControlContainer.Visible     = false;
                    divClientAccountBalance.Visible = false;
                }
            }
        }