public void BindNomineeGrid()
        {
            DataSet dsCustomerAssociation = new DataSet();

            customerVo            = customerBo.GetCustomer(int.Parse(txtCustomerId.Value));
            boDematAccount        = new BoDematAccount();
            dsCustomerAssociation = boDematAccount.GetCustomerAccociation(customerVo.CustomerId);
            //Populating  Pick nominee
            if (dsCustomerAssociation.Tables[0].Rows.Count == 0)
            {
                lblPickNominee.Text = "You have no associates";
            }
            else
            {
                lblPickNominee.Text      = "Pick Nominee";
                gvPickNominee.DataSource = dsCustomerAssociation.Tables[0];
                gvPickNominee.DataBind();
            }

            //Populating  Joint Holder nominee
            if (dsCustomerAssociation.Tables[0].Rows.Count == 0)
            {
                lblPickJointHolder.Text = "You have no associates";
            }
            else
            {
                lblPickJointHolder.Text      = "Pick Joint Holder";
                gvPickJointHolder.DataSource = dsCustomerAssociation;
                gvPickJointHolder.DataBind();
            }
        }
Beispiel #2
0
        private void RegisterBSESIP(int systematicId)
        {
            Boolean         result                   = false;
            DataTable       dtXSIP                   = new DataTable();
            DematAccountVo  dematevo                 = new DematAccountVo();
            BoDematAccount  bo                       = new BoDematAccount();
            OnlineMFOrderBo boOnlineOrder            = new OnlineMFOrderBo();
            string          message                  = string.Empty;
            int             OrderId                  = 0;
            int             sipId                    = 0;
            char            msgType                  = 'F';
            List <int>      OrderIds                 = new List <int>();
            IDictionary <string, string> sipOrderIds = new Dictionary <string, string>();

            try
            {
                dtXSIP = OnlineOrderMISBo.GetSystematicDetails(systematicId);
                if (dtXSIP.Rows.Count > 0)
                {
                    onlineMFOrderVo.SchemePlanCode     = Convert.ToInt32(dtXSIP.Rows[0]["PASP_SchemePlanCode"]);
                    onlineMFOrderVo.SystematicTypeCode = "SIP";
                    onlineMFOrderVo.SystematicDate     = Convert.ToInt32(dtXSIP.Rows[0]["CMFSS_SystematicDate"]);
                    onlineMFOrderVo.Amount             = double.Parse(dtXSIP.Rows[0]["CMFSS_Amount"].ToString());
                    onlineMFOrderVo.SourceCode         = "";
                    onlineMFOrderVo.FrequencyCode      = dtXSIP.Rows[0]["XF_FrequencyCode"].ToString();
                    onlineMFOrderVo.CustomerId         = Convert.ToInt32(dtXSIP.Rows[0]["C_CustomerId"].ToString());
                    onlineMFOrderVo.StartDate          = DateTime.Parse(dtXSIP.Rows[0]["CMFSS_StartDate"].ToString());
                    onlineMFOrderVo.EndDate            = DateTime.Parse(dtXSIP.Rows[0]["CMFSS_EndDate"].ToString());
                    onlineMFOrderVo.SystematicDates    = "";
                    onlineMFOrderVo.TotalInstallments  = int.Parse(dtXSIP.Rows[0]["CMFSS_TotalInstallment"].ToString());
                    onlineMFOrderVo.DivOption          = dtXSIP.Rows[0]["CMFSS_DividendOption"].ToString();
                    dematevo = bo.GetCustomerActiveDematAccount(onlineMFOrderVo.CustomerId);
                    onlineMFOrderVo.ModeTypeCode = "BXSIP";
                    if (!string.IsNullOrEmpty(dtXSIP.Rows[0]["CMFSS_MandateId"].ToString()))
                    {
                        onlineMFOrderVo.MandateId = int.Parse(dtXSIP.Rows[0]["CMFSS_MandateId"].ToString());
                    }
                    onlineMFOrderVo.SystematicId = systematicId;
                    OnlineMFOrderBo OnlineMFOrderBo = new OnlineMFOrderBo();
                    message = OnlineMFOrderBo.BSESIPorderEntryParam(userVo.UserId, dtXSIP.Rows[0]["C_CustCode"].ToString(), onlineMFOrderVo, onlineMFOrderVo.CustomerId, dematevo.DepositoryName, out msgType, out sipOrderIds);
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('" + message + "');", true);
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "OnlineAdviserSIPSummaryBooks.ascx.cs:RegisterBSESIP(int systematicId)");
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
        public void bindModeOfHolding()
        {
            DataSet dsModeOfHolding = new DataSet();

            boDematAccount                  = new BoDematAccount();
            dsModeOfHolding                 = boDematAccount.GetXmlModeOfHolding();
            ddlModeOfHolding.DataSource     = dsModeOfHolding;
            ddlModeOfHolding.DataTextField  = "XMOH_ModeOfHolding";
            ddlModeOfHolding.DataValueField = "XMOH_ModeOfHoldingCode";
            ddlModeOfHolding.DataBind();
            ddlModeOfHolding.Items.Insert(0, new ListItem("Select", "Select"));
        }
        private bool ValidateUserLogin(string userAccountId, string isWerp)
        {
            string                    strOnlineAdviser          = "0";
            bool                      isValidUser               = false;
            UserBo                    userBo                    = new UserBo();
            AssociatesVO              associatesVo              = new AssociatesVO();
            AdvisorBranchVo           advisorBranchVo           = new AdvisorBranchVo();
            AssociatesUserHeirarchyVo associatesUserHeirarchyVo = new AssociatesUserHeirarchyVo();
            AdvisorBo                 advisorBo                 = new AdvisorBo();
            BoDematAccount            boDematAccount            = new BoDematAccount();
            AssociatesBo              associatesBo              = new AssociatesBo();
            AdvisorStaffBo            advisorStaffBo            = new AdvisorStaffBo();
            CustomerBo                customerBo                = new CustomerBo();
            AdvisorBranchBo           advisorBranchBo           = new AdvisorBranchBo();
            PortfolioBo               portfolioBo               = new PortfolioBo();
            CustomerPortfolioVo       customerPortfolioVo       = new CustomerPortfolioVo();

            strOnlineAdviser = ConfigurationSettings.AppSettings["ONLINE_ADVISER"].ToString();
            if (string.IsNullOrEmpty(isWerp))
            {
                userVo = userBo.GetUserAccountDetails(userAccountId, Convert.ToInt32(strOnlineAdviser));
            }
            else
            {
                advisorVo = (AdvisorVo)Session["advisorVo"];
                userVo    = userBo.GetUserAccountDetails(userAccountId, advisorVo.advisorId);
            }

            if (!string.IsNullOrEmpty(isWerp))
            {
                if (userVo != null)
                {
                    customerVo  = customerBo.GetCustomerInfo(userVo.UserId);
                    isValidUser = true;
                }
                Session["CustomerVo"] = customerVo;
            }
            else if (userVo != null)
            {
                isValidUser = true;
                List <string> roleList = new List <string>();
                string        branchLogoSourcePath;
                string        sourcePath;
                string        potentialHomePage = string.Empty;

                roleList = userBo.GetUserRoles(userVo.UserId);

                if (userVo.UserType == "Customer")
                {
                    customerVo = customerBo.GetCustomerInfo(userVo.UserId);
                    advisorVo  = advisorBo.GetAdvisor(advisorBranchBo.GetBranch(customerVo.BranchId).AdviserId);
                    if (customerVo.IsProspect == 0)
                    {
                        customerPortfolioVo = portfolioBo.GetCustomerDefaultPortfolio(customerVo.CustomerId);
                        Session[SessionContents.PortfolioId] = customerPortfolioVo.PortfolioId;
                    }
                    rmVo = advisorStaffBo.GetAdvisorStaffDetails(customerVo.RmId);

                    Session[SessionContents.LogoPath]        = advisorVo.LogoPath;
                    Session[SessionContents.CurrentUserRole] = "Customer";
                    Session[SessionContents.UserTopRole]     = "Customer";

                    branchLogoSourcePath = "Images/" + userBo.GetRMBranchLogo(rmVo.RMId);
                    sourcePath           = "Images/" + userBo.GetRMLogo(rmVo.RMId);
                    Session[SessionContents.LogoPath]       = sourcePath;
                    Session[SessionContents.BranchLogoPath] = branchLogoSourcePath;
                    Session["CustomerVo"]     = customerVo;
                    Session["DematAccountVo"] = boDematAccount.GetCustomerActiveDematAccount(customerVo.CustomerId);
                    UserBo.AddLoginTrack(userVo.LoginId, string.Empty, true, HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"], HttpContext.Current.Request.UserAgent, userVo.UserId);
                }

                Session["UserVo"]    = userVo;
                Session["advisorVo"] = advisorVo;
                Session["rmVo"]      = rmVo;
                SetAdviserPreference();

                //Session["Theme"] = advisorVo.theme;
                //Session["refreshTheme"] = true;

                Session[SessionContents.LogoPath] = advisorVo.LogoPath;
            }
            return(isValidUser);
        }
        private void CreateRedemptionOrderType()
        {
            List <int> OrderIds = new List <int>();
            DateTime   dtCutOfffTime;

            onlinemforderVo.SchemePlanCode = Int32.Parse(ddlScheme.SelectedValue.ToString());
            bool isCutOffTimeOver = false;

            onlinemforderVo.FolioNumber     = ddlFolio.SelectedValue;
            onlinemforderVo.DividendType    = ddlDivType.SelectedValue;
            onlinemforderVo.TransactionType = "SEL";
            dtCutOfffTime = DateTime.Parse(lbltime.Text);

            if (DateTime.Now.TimeOfDay > dtCutOfffTime.TimeOfDay && dtCutOfffTime.TimeOfDay < System.TimeSpan.Parse("23:59:59"))
            {
                isCutOffTimeOver = true;
            }

            if (ddlRedeem.SelectedValue == "1")
            {
                if (!string.IsNullOrEmpty(txtRedeemTypeValue.Text))
                {
                    onlinemforderVo.Redeemunits = double.Parse(txtRedeemTypeValue.Text);
                }
                else
                {
                    onlinemforderVo.Redeemunits = 0;
                }

                float RedeemUnits    = float.Parse(string.IsNullOrEmpty(txtRedeemTypeValue.Text) ? "0" : txtRedeemTypeValue.Text);
                float AvailableUnits = float.Parse(string.IsNullOrEmpty(lblUnitsheldDisplay.Text) ? "0" : lblUnitsheldDisplay.Text);
                if ((ddlRedeem.SelectedValue == "1" && (RedeemUnits > AvailableUnits)))
                {
                    retVal = 1;
                }
            }
            else if (ddlRedeem.SelectedValue == "2")
            {
                if (!string.IsNullOrEmpty(txtRedeemTypeValue.Text))
                {
                    onlinemforderVo.Amount = double.Parse(txtRedeemTypeValue.Text);
                }
                else
                {
                    onlinemforderVo.Amount = 0;
                }
                float RedeemAmt    = float.Parse(string.IsNullOrEmpty(txtRedeemTypeValue.Text) ? "0" : txtRedeemTypeValue.Text);
                float AvailableAmt = float.Parse(string.IsNullOrEmpty(lblCurrentValueDisplay.Text) ? "0" : lblCurrentValueDisplay.Text);

                if ((ddlRedeem.SelectedValue == "2" && (RedeemAmt > AvailableAmt)))
                {
                    retVal = -1;
                }
            }
            else if (ddlRedeem.SelectedValue == "3")
            {
                if (!string.IsNullOrEmpty(txtRedeemTypeValue.Text))
                {
                    onlinemforderVo.Redeemunits = double.Parse(txtRedeemTypeValue.Text);
                }
                else
                {
                    onlinemforderVo.Redeemunits = 0;
                }
                onlinemforderVo.IsAllUnits = true;
                //onlinemforderVo.Redeemunits = float.Parse(txtRedeemTypeValue.Text);
            }

            if (retVal != 0)
            {
                if (retVal == -1)
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Please enter a valid amount');", true); return;
                }
                else if (retVal == 1)
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('Please enter a valid Units');", true); return;
                }
            }

            string message = string.Empty;
            char   msgType = 'F';

            if (exchangeType == "Online")
            {
                onlinemforderVo.OrderType = 1;
                OrderIds = onlineMforderBo.CreateCustomerOnlineMFOrderDetails(onlinemforderVo, (BackOfficeUserId != 0) ? BackOfficeUserId : userVo.UserId, customerVo.CustomerId);
                OrderId  = int.Parse(OrderIds[0].ToString());
                message  = CreateUserMessage(OrderId, isCutOffTimeOver, out msgType);
            }
            else if (exchangeType == "Demat")
            {
                onlinemforderVo.OrderType = 0;
                DematAccountVo dematevo = new DematAccountVo();
                BoDematAccount bo       = new BoDematAccount();
                dematevo = bo.GetCustomerActiveDematAccount(customerVo.CustomerId);
                onlinemforderVo.BSESchemeCode = ViewState["BseCode"].ToString();
                OnlineMFOrderBo OnlineMFOrderBo = new OnlineMFOrderBo();
                message = OnlineMFOrderBo.BSEorderEntryParam(userVo.UserId, customerVo.CustCode, onlinemforderVo, customerVo.CustomerId, dematevo.DepositoryName, out msgType);
            }

            PurchaseOrderControlsEnable(false);
            ShowMessage(message, msgType);
        }
Beispiel #6
0
        private void CreatePurchaseOrderType()
        {
            List <int> OrderIds           = new List <int>();
            bool       accountDebitStatus = false;

            onlinemforderVo.SchemePlanCode = int.Parse(Session["MFSchemePlan"].ToString());
            if (!string.IsNullOrEmpty(txtAmt.Text.ToString()))
            {
                onlinemforderVo.Amount = double.Parse(txtAmt.Text.ToString());
            }
            else
            {
                onlinemforderVo.Amount = 0.0;
            }

            onlinemforderVo.DividendType = ddlDivType.SelectedValue;
            if (ddlFolio.SelectedValue != "New" && ddlFolio.SelectedValue != "0")
            {
                onlinemforderVo.TransactionType = "ABY";
                onlinemforderVo.FolioNumber     = ddlFolio.SelectedValue;
            }
            else
            {
                onlinemforderVo.TransactionType = "BUY";
            }
            float    amt;
            float    minAmt;
            float    multiAmt;
            DateTime Dt;

            if (string.IsNullOrEmpty(txtAmt.Text))
            {
                amt = 0;
            }
            else
            {
                amt = float.Parse(txtAmt.Text);
            }
            if (string.IsNullOrEmpty(lblMintxt.Text) && string.IsNullOrEmpty(lblMulti.Text) && string.IsNullOrEmpty(lbltime.Text))
            {
                minAmt = 0; multiAmt = 0; Dt = DateTime.MinValue;
            }
            else
            {
                minAmt   = float.Parse(lblMintxt.Text);
                multiAmt = float.Parse(lblMulti.Text);
                Dt       = DateTime.Parse(lbltime.Text);
            }
            int retVal = commonLookupBo.IsRuleCorrect(amt, minAmt, amt, multiAmt, Dt);

            if (retVal != 0)
            {
                if (retVal == -2)
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('You have entered amount less than Minimum Initial amount allowed');", true); return;
                }
                if (retVal == -1)
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "pageloadscript", "alert('You should enter the amount in multiples of Subsequent amount ');", true); return;
                }
            }
            decimal availableBalance = onlineMforderBo.GetUserRMSAccountBalance(customerVo.AccountId);
            //string message = string.Empty;

            //if (availableBalance >= Convert.ToDecimal(onlinemforderVo.Amount))
            //{
            //    OrderIds = onlineMforderBo.CreateCustomerOnlineMFOrderDetails(onlinemforderVo, userVo.UserId, customerVo.CustomerId, exchangeType);
            //    OrderId = int.Parse(OrderIds[0].ToString());

            //    if (OrderId != 0 && !string.IsNullOrEmpty(customerVo.AccountId))
            //    {
            //        accountDebitStatus = onlineMforderBo.DebitRMSUserAccountBalance(customerVo.AccountId, -onlinemforderVo.Amount, OrderId);
            //        ShowAvailableLimits();
            //    }

            //}
            //onlinemforderVo.BSESchemeCode = lblDemate.Text;
            string message = string.Empty;
            char   msgType = 'F';

            if (exchangeType == "Online")
            {
                onlinemforderVo.OrderType = 1;
                if (availableBalance >= Convert.ToDecimal(onlinemforderVo.Amount))
                {
                    OrderIds = onlineMforderBo.CreateCustomerOnlineMFOrderDetails(onlinemforderVo, (BackOfficeUserId != 0) ? BackOfficeUserId:userVo.UserId, customerVo.CustomerId);
                    OrderId  = int.Parse(OrderIds[0].ToString());

                    if (OrderId != 0 && !string.IsNullOrEmpty(customerVo.AccountId))
                    {
                        accountDebitStatus = onlineMforderBo.DebitRMSUserAccountBalance(customerVo.AccountId, -onlinemforderVo.Amount, OrderId, out debitstatus);
                        ShowAvailableLimits();
                    }
                }

                message = CreateUserMessage(OrderId, accountDebitStatus, retVal == 1 ? true : false, out msgType);
            }
            else if (exchangeType == "Demat")
            {
                onlinemforderVo.OrderType = 0;
                DematAccountVo dematevo = new DematAccountVo();
                BoDematAccount bo       = new BoDematAccount();
                dematevo = bo.GetCustomerActiveDematAccount(customerVo.CustomerId);
                onlinemforderVo.BSESchemeCode = lblDemate.Text;
                if (availableBalance >= Convert.ToDecimal(onlinemforderVo.Amount))
                {
                    OnlineMFOrderBo OnlineMFOrderBo = new OnlineMFOrderBo();
                    message = OnlineMFOrderBo.BSEorderEntryParam(userVo.UserId, customerVo.CustCode, onlinemforderVo, customerVo.CustomerId, dematevo.DepositoryName, out msgType);
                }
                else
                {
                    message = "Order cannot be processed. Insufficient balance";
                }
            }
            PurchaseOrderControlsEnable(false);
            ShowMessage(message, msgType);
        }