Beispiel #1
0
        public int AddDematDetails(int customerId, int portfolioId, DematAccountVo demataccountvo, RMVo rmvo)
        {
            int result = 0;

            result = demataccountdao.AddDematDetails(customerId, portfolioId, demataccountvo, rmvo);
            return(result);
        }
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;
            }
        }
        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 #4
0
        public void AddDematDetails(int customerId, int portfolioId, DematAccountVo demataccountvo, RMVo rmvo, ArrayList associationIdJH, ArrayList associationIdN, ArrayList lstassociatedtradeaccount)
        {
            //DataSet dsDematDetails = null;
            Database  db;
            DbCommand dbDematDetails;
            DbCommand dbAssociationTypes = null;
            DbCommand dbTradeAccount     = null;
            int       dematAccountId     = 0;

            try
            {
                db             = DatabaseFactory.CreateDatabase("wealtherp");
                dbDematDetails = db.GetStoredProcCommand("SP_AddDematDetails");

                db.AddInParameter(dbDematDetails, "@CP_PortfolioId", DbType.Int32, portfolioId);
                db.AddInParameter(dbDematDetails, "@CEDA_DPClientId", DbType.String, demataccountvo.DpclientId);
                db.AddInParameter(dbDematDetails, "@CEDA_DPId", DbType.String, demataccountvo.DpId);
                db.AddInParameter(dbDematDetails, "@CEDA_DPName", DbType.String, demataccountvo.DpName);
                db.AddInParameter(dbDematDetails, "@XMOH_ModeOfHoldingCode", DbType.String, demataccountvo.ModeOfHolding);
                db.AddInParameter(dbDematDetails, "@CEDA_IsJointlyHeld", DbType.Int16, demataccountvo.IsHeldJointly);
                if (demataccountvo.AccountOpeningDate != DateTime.MinValue)
                {
                    db.AddInParameter(dbDematDetails, "@CEDA_AccountOpeningDate", DbType.DateTime, demataccountvo.AccountOpeningDate);
                }
                else
                {
                    db.AddInParameter(dbDematDetails, "@CEDA_AccountOpeningDate", DbType.DateTime, DBNull.Value);
                }
                db.AddInParameter(dbDematDetails, "@CEDA_BeneficiaryAccountNum", DbType.String, demataccountvo.BeneficiaryAccountNbr);
                db.AddInParameter(dbDematDetails, "@CEDA_CreatedBy", DbType.Int32, rmvo.RMId);
                db.AddInParameter(dbDematDetails, "@CEDA_ModifiedBy", DbType.Int32, rmvo.RMId);
                db.AddInParameter(dbDematDetails, "@C_CustomerId", DbType.Int32, customerId);
                db.AddOutParameter(dbDematDetails, "@CEDA_DematAccountId", DbType.Int32, 10000);
                db.ExecuteNonQuery(dbDematDetails);
                dematAccountId = int.Parse(db.GetParameterValue(dbDematDetails, "@CEDA_DematAccountId").ToString());


                IEnumerator enumassociationIdJH = associationIdJH.GetEnumerator();
                while (enumassociationIdJH.MoveNext())
                {
                    Object obj = enumassociationIdJH.Current;
                    dbAssociationTypes = db.GetStoredProcCommand("SP_AddAssociationTypesForDemat");
                    db.AddInParameter(dbAssociationTypes, "@CEDA_DematAccountId", DbType.Int32, dematAccountId);
                    db.AddInParameter(dbAssociationTypes, "@CAS_AssociationId", DbType.Int32, int.Parse(obj.ToString()));
                    db.AddInParameter(dbAssociationTypes, "@CEDAA_AssociationType", DbType.String, "JH");
                    db.AddInParameter(dbAssociationTypes, "@CEDAA_CreatedBy", DbType.String, rmvo.RMId);
                    db.AddInParameter(dbAssociationTypes, "@CEDAA_ModifiedBy", DbType.String, rmvo.RMId);
                    db.ExecuteNonQuery(dbAssociationTypes);
                }


                IEnumerator enumassociationIdN = associationIdN.GetEnumerator();

                while (enumassociationIdN.MoveNext())
                {
                    dbAssociationTypes = db.GetStoredProcCommand("SP_AddAssociationTypesForDemat");
                    Object obj = enumassociationIdN.Current;
                    db.AddInParameter(dbAssociationTypes, "@CEDA_DematAccountId", DbType.Int32, dematAccountId);
                    db.AddInParameter(dbAssociationTypes, "@CAS_AssociationId", DbType.Int32, int.Parse(obj.ToString()));
                    db.AddInParameter(dbAssociationTypes, "@CEDAA_AssociationType", DbType.String, "N");
                    db.AddInParameter(dbAssociationTypes, "@CEDAA_CreatedBy", DbType.String, rmvo.RMId);
                    db.AddInParameter(dbAssociationTypes, "@CEDAA_ModifiedBy", DbType.String, rmvo.RMId);
                    db.ExecuteNonQuery(dbAssociationTypes);
                }



                IEnumerator enumlstassociatedtradeaccount = lstassociatedtradeaccount.GetEnumerator();
                while (enumlstassociatedtradeaccount.MoveNext())
                {
                    dbTradeAccount = db.GetStoredProcCommand("SP_AddTradeAccountForDemat");

                    Object obj = enumlstassociatedtradeaccount.Current;
                    db.AddInParameter(dbTradeAccount, "@CEDA_DematAccountId", DbType.Int32, dematAccountId);
                    db.AddInParameter(dbTradeAccount, "@CETA_AccountId", DbType.Int32, int.Parse(obj.ToString()));
                    db.AddInParameter(dbTradeAccount, "@CETDAA_IsDefault", DbType.Int16, 1);
                    db.AddInParameter(dbTradeAccount, "@CEDA_CreatedBy", DbType.Int32, rmvo.RMId);
                    db.AddInParameter(dbTradeAccount, "@CEDA_ModifiedBy", DbType.Int32, rmvo.RMId);
                    db.ExecuteNonQuery(dbTradeAccount);
                }
            }
            catch (BaseApplicationException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(ex.Message, ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "AdvisorDao.cs:AddDematDetails()");

                object[] objects = new object[2];
                objects[0]   = customerId;
                objects[0]   = dematAccountId;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
Beispiel #5
0
 public void UpdateDematDetails(int customerId, int portfolioId, int dematId, DematAccountVo demataccountvo, RMVo rmvo, ArrayList associationIdJH, ArrayList associationIdN, ArrayList lstassociatedtradeaccount)
 {
     demataccountdao.UpdateDematDetails(customerId, portfolioId, dematId, demataccountvo, rmvo, associationIdJH, associationIdN, lstassociatedtradeaccount);
 }
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);
        }
Beispiel #7
0
        public int AddDematDetails(int customerId, int portfolioId, DematAccountVo demataccountvo, RMVo rmvo)
        {
            //bool result = false;
            int       result = 0;
            Database  db;
            DbCommand dbDematDetails;

            int dematAccountId = 0;

            try
            {
                db             = DatabaseFactory.CreateDatabase("wealtherp");
                dbDematDetails = db.GetStoredProcCommand("SP_AddDematDetails");

                db.AddInParameter(dbDematDetails, "@CP_PortfolioId", DbType.Int32, portfolioId);
                db.AddInParameter(dbDematDetails, "@CEDA_DPClientId", DbType.String, demataccountvo.DpclientId);
                db.AddInParameter(dbDematDetails, "@CEDA_DPId", DbType.String, demataccountvo.DpId);
                db.AddInParameter(dbDematDetails, "@CEDA_DPName", DbType.String, demataccountvo.DpName);
                db.AddInParameter(dbDematDetails, "@CEDA_DepositoryName", DbType.String, demataccountvo.DepositoryName);
                db.AddInParameter(dbDematDetails, "@XMOH_ModeOfHoldingCode", DbType.String, demataccountvo.ModeOfHolding);
                db.AddInParameter(dbDematDetails, "@CEDA_IsJointlyHeld", DbType.Int16, demataccountvo.IsHeldJointly);
                db.AddInParameter(dbDematDetails, "@CEDA_IsActive", DbType.Int16, demataccountvo.IsActive);
                if (demataccountvo.AccountOpeningDate != DateTime.MinValue)
                {
                    db.AddInParameter(dbDematDetails, "@CEDA_AccountOpeningDate", DbType.DateTime, demataccountvo.AccountOpeningDate);
                }
                else
                {
                    db.AddInParameter(dbDematDetails, "@CEDA_AccountOpeningDate", DbType.DateTime, DBNull.Value);
                }
                //db.AddInParameter(dbDematDetails,"@CEDA_BeneficiaryAccountNum",DbType.String,demataccountvo.BeneficiaryAccountNbr);
                db.AddInParameter(dbDematDetails, "@CEDA_CreatedBy", DbType.Int32, rmvo.RMId);
                db.AddInParameter(dbDematDetails, "@CEDA_ModifiedBy", DbType.Int32, rmvo.RMId);
                db.AddInParameter(dbDematDetails, "@C_CustomerId", DbType.Int32, customerId);
                db.AddOutParameter(dbDematDetails, "@CEDA_DematAccountId", DbType.Int32, 1000);

                if (db.ExecuteNonQuery(dbDematDetails) != 0)
                {
                    result = Convert.ToInt32(db.GetParameterValue(dbDematDetails, "@CEDA_DematAccountId").ToString());
                }
                ;
                //if ((db.ExecuteNonQuery(dbDematDetails))!=0)
                //{
                //    result = true;
                //}
            }
            catch (BaseApplicationException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(ex.Message, ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();

                FunctionInfo.Add("Method", "AdvisorDao.cs:AddDematDetails()");

                object[] objects = new object[2];
                objects[0]   = customerId;
                objects[0]   = dematAccountId;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(result);
        }
Beispiel #8
0
 public void UpdateDematDetails(int customerId, int portfolioId, int dematId, DematAccountVo demataccountvo, RMVo rmvo)
 {
     demataccountdao.UpdateDematDetails(customerId, portfolioId, dematId, demataccountvo, rmvo);
 }