Пример #1
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 string UpdateBSESIP(int systematicId)
        {
            Boolean   result = false;
            DataTable dtXSIP = new DataTable();

            VoCustomerPortfolio.DematAccountVo dematevo = new VoCustomerPortfolio.DematAccountVo();
            BoCustomerPortfolio.BoDematAccount bo       = new BoCustomerPortfolio.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>();

            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 = dtXSIP.Rows[0]["WSTM_ModeTypeCode"].ToString();
                onlineMFOrderVo.IsCancelled  = "True";
                if (!string.IsNullOrEmpty(dtXSIP.Rows[0]["CMFSS_MandateId"].ToString()))
                {
                    onlineMFOrderVo.MandateId = int.Parse(dtXSIP.Rows[0]["CMFSS_MandateId"].ToString());
                }
                onlineMFOrderVo.SystematicId = systematicId;
                onlineMFOrderVo.BSEREGID     = Convert.ToInt64(dtXSIP.Rows[0]["BMFSRD_BSESIPREGID"].ToString());
                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);
            }
            return(msgType.ToString());
        }
Пример #3
0
        protected void btnMandateSubmit_Click(object sender, EventArgs e)
        {
            string             userMessage     = string.Empty;
            string             BSEMessage      = string.Empty;
            char               msgtype         = 's';
            bool               result          = false;
            OnlineMFOrderBo    onlineMFOrderBo = new OnlineMFOrderBo();
            int                mandateId       = 0;
            AdviserStaffSMTPBo advstaffsmtpbo  = new AdviserStaffSMTPBo();

            if (txtCustomerId.Value != "0")
            {
                if (ddlBankName.SelectedItem.ToString().Length > 40)
                {
                    result = advstaffsmtpbo.BSEMandateCreate(txtClientCode.Text, lblgetcust.Text, Convert.ToDouble(txtAmount.Text), ddlBankName.SelectedItem.ToString().Substring(0, 40), txtBBranch.Text, userVo.UserId, out BSEMessage, out mandateId);
                }
                else
                {
                    result = advstaffsmtpbo.BSEMandateCreate(txtClientCode.Text, lblgetcust.Text, Convert.ToDouble(txtAmount.Text), ddlBankName.SelectedItem.ToString(), txtBBranch.Text, userVo.UserId, out BSEMessage, out mandateId);
                }
                if (result)
                {
                    int OrderId = onlineMFOrderBo.CreateMandateOrder(int.Parse(txtCustomerId.Value.ToString()), Convert.ToDouble(txtAmount.Text), int.Parse(ddlBankName.SelectedValue), txtBBranch.Text, userVo.UserId, mandateId, txtBankAccount.Text, txtIFSC.Text);
                    if (OrderId != 0)
                    {
                        userMessage = BSEMessage + " " + "Order Reference Number is: " + OrderId.ToString();
                        msgtype     = 'S';
                        freezeControls();
                        trNewOrder.Visible = true;
                    }
                    else
                    {
                        userMessage = "Order cannot be processed";
                        msgtype     = 'F';
                    }
                }
                else
                {
                    userMessage = BSEMessage;
                    msgtype     = 'F';
                }
                ShowMessage(userMessage, msgtype);
            }
        }
Пример #4
0
        private void BindMandateddetailsDetailsGrid(int adviserId)
        {
            DataSet         ds;
            DataTable       dt = new DataTable();
            OnlineMFOrderBo onlineMFOrderBo = new OnlineMFOrderBo();

            ds = onlineMFOrderBo.BindMandateddetailsDetails(adviserId);
            gvMandatedetails.DataSource = ds.Tables[0];
            gvMandatedetails.DataBind();
            pnlZoneCluster.Visible   = true;
            gvMandatedetails.Visible = true;
            UpdatePanel1.Visible     = true;
            btnExportFilteredMandatedetails.Visible = true;
            if (Cache["gvMandatedetails" + advisorVo.advisorId.ToString()] != null)
            {
                Cache.Remove("gvMandatedetails" + advisorVo.advisorId.ToString());
            }
            Cache.Insert("gvMandatedetails" + advisorVo.advisorId.ToString(), ds.Tables[0]);
        }
Пример #5
0
        private void BindOrderStatus()
        {
            OnlineMFOrderBo OnlineMFOrderBo = new OnlineMFOrderBo();

            ddlOrderStatus.Items.Clear();
            DataSet   dsOrderStatus;
            DataTable dtOrderStatus;

            dsOrderStatus = OnlineMFOrderBo.GetOrderStatus();
            dtOrderStatus = dsOrderStatus.Tables[0];
            if (dtOrderStatus.Rows.Count > 0)
            {
                ddlOrderStatus.DataSource     = dtOrderStatus;
                ddlOrderStatus.DataTextField  = dtOrderStatus.Columns["WOS_OrderStep"].ToString();
                ddlOrderStatus.DataValueField = dtOrderStatus.Columns["WOS_OrderStepCode"].ToString();
                ddlOrderStatus.DataBind();
            }
            ddlOrderStatus.Items.Insert(0, new ListItem("All", "0"));
        }
        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);
        }
Пример #7
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);
        }