コード例 #1
0
        /// <summary>
        /// Function to get the details of a particular Systematic Setup Scheme
        /// </summary>
        /// <param name="systematicSetupId"></param>
        /// <returns></returns>
        public SystematicSetupVo GetSystematicSchemeSetupDetails(int systematicSetupId)
        {
            SystematicSetupVo systematicSetupVo = new SystematicSetupVo();;
            Database          db;
            DbCommand         getSystematicSetupDetailsCmd;
            DataSet           dsSystematicSetups;
            DataRow           dr;

            try
            {
                db = DatabaseFactory.CreateDatabase("wealtherp");
                getSystematicSetupDetailsCmd = db.GetStoredProcCommand("SP_GetSystematicSetupDetails");
                db.AddInParameter(getSystematicSetupDetailsCmd, "@CMFSS_SystematicSetupId", DbType.Int32, systematicSetupId);
                db.AddOutParameter(getSystematicSetupDetailsCmd, "@PortfolioId", DbType.Int32, 9999999);
                dsSystematicSetups = db.ExecuteDataSet(getSystematicSetupDetailsCmd);

                Object objportfolioId = db.GetParameterValue(getSystematicSetupDetailsCmd, "@PortfolioId");
                if (objportfolioId != DBNull.Value)
                {
                    systematicSetupVo.PortfolioId = int.Parse(db.GetParameterValue(getSystematicSetupDetailsCmd, "@PortfolioId").ToString());
                }
                else
                {
                    systematicSetupVo.PortfolioId = 0;
                }

                if (dsSystematicSetups.Tables[0].Rows.Count > 0)
                {
                    dr = dsSystematicSetups.Tables[0].Rows[0];

                    systematicSetupVo.SystematicSetupId = int.Parse(dr["CMFSS_SystematicSetupId"].ToString());
                    systematicSetupVo.SchemePlan        = dr["PASP_SchemePlanName"].ToString();
                    systematicSetupVo.SchemePlanCode    = int.Parse(dr["PASP_SchemePlanCode"].ToString());
                    //systematicSetupVo.SystematicType = dr["XSTT_SystematicType"].ToString();
                    systematicSetupVo.SystematicTypeCode = dr["XSTT_SystematicTypeCode"].ToString();
                    //systematicSetupVo.Frequency = dr["XF_Frequency"].ToString();
                    systematicSetupVo.FrequencyCode = dr["XF_FrequencyCode"].ToString();
                    systematicSetupVo.Folio         = dr["CMFA_FolioNum"].ToString();
                    systematicSetupVo.StartDate     = DateTime.Parse(dr["CMFSS_StartDate"].ToString());
                    systematicSetupVo.EndDate       = DateTime.Parse(dr["CMFSS_EndDate"].ToString());

                    systematicSetupVo.Amount               = double.Parse(dr["CMFSS_Amount"].ToString());
                    systematicSetupVo.AccountId            = int.Parse(dr["CMFA_AccountId"].ToString());
                    systematicSetupVo.SchemePlanCodeSwitch = int.Parse(dr["SwitchSchemeCode"].ToString());
                    systematicSetupVo.SchemePlanSwitch     = dr["SwitchSchemePlanName"].ToString();
                    if (!string.IsNullOrEmpty(dr["CMFSS_SIPFirstChequeDate"].ToString()))
                    {
                        systematicSetupVo.SipChequeDate = DateTime.Parse(dr["CMFSS_SIPFirstChequeDate"].ToString());
                    }
                    else
                    {
                        systematicSetupVo.SipChequeDate = DateTime.MinValue;
                    }
                    if (!string.IsNullOrEmpty(dr["CMFSS_SIPFirstChequeNo"].ToString()))
                    {
                        systematicSetupVo.SipChequeNo = Int64.Parse(dr["CMFSS_SIPFirstChequeNo"].ToString());
                    }
                    else
                    {
                        systematicSetupVo.SipChequeNo = 0;
                    }
                    if (!string.IsNullOrEmpty(dr["CMFSS_RegistrationDate"].ToString()))
                    {
                        systematicSetupVo.RegistrationDate = DateTime.Parse(dr["CMFSS_RegistrationDate"].ToString());
                    }
                    else
                    {
                        systematicSetupVo.RegistrationDate = DateTime.MinValue;
                    }

                    if (!string.IsNullOrEmpty(dr["CMFSS_Tenure"].ToString()))
                    {
                        systematicSetupVo.Period = int.Parse(dr["CMFSS_Tenure"].ToString());
                    }

                    if (!string.IsNullOrEmpty(dr["XPM_PaymentModeCode"].ToString()))
                    {
                        systematicSetupVo.PaymentModeCode = dr["XPM_PaymentModeCode"].ToString();
                    }
                    systematicSetupVo.PeriodSelection = dr["CMFSS_TenureCycle"].ToString();
                    if (!string.IsNullOrEmpty(dr["CMFSS_IsAutoTransaction"].ToString()))
                    {
                        systematicSetupVo.IsAutoTransaction = dr["CMFSS_IsAutoTransaction"].ToString();
                    }
                    if (!string.IsNullOrEmpty(dr["CMFSS_IsHistoricalCreated"].ToString()))
                    {
                        systematicSetupVo.IsHistoricalCreated = dr["CMFSS_IsHistoricalCreated"].ToString();
                    }


                    if (!string.IsNullOrEmpty(dr["CMFSS_REMARKS"].ToString()))
                    {
                        systematicSetupVo.Remarks = dr["CMFSS_REMARKS"].ToString();
                    }
                    else
                    {
                        systematicSetupVo.Remarks = "";
                    }
                    if (!string.IsNullOrEmpty(dr["CMFSS_CEASEDATE"].ToString()))
                    {
                        systematicSetupVo.CeaseDate = DateTime.Parse(dr["CMFSS_CEASEDATE"].ToString());
                    }
                    else
                    {
                        systematicSetupVo.CeaseDate = DateTime.MinValue;
                    }
                    if (!string.IsNullOrEmpty(dr["CMFSS_SubBrokerCode"].ToString()))
                    {
                        systematicSetupVo.SubBrokerCode = dr["CMFSS_SubBrokerCode"].ToString();
                    }
                    else
                    {
                        systematicSetupVo.SubBrokerCode = "";
                    }

                    if (!string.IsNullOrEmpty(dr["CMFSS_IsHistoricalCreated"].ToString()))
                    {
                        systematicSetupVo.IsHistoricalCreated = dr["CMFSS_IsHistoricalCreated"].ToString();
                    }
                    else
                    {
                        systematicSetupVo.IsHistoricalCreated = "0";
                    }
                    if (!string.IsNullOrEmpty(dr["CMFSS_IsAutoTransaction"].ToString()))
                    {
                        systematicSetupVo.IsAutoTransaction = dr["CMFSS_IsAutoTransaction"].ToString();
                    }
                    else
                    {
                        systematicSetupVo.IsAutoTransaction = "0";
                    }
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "SystematicSetupDao.cs:GetSystematicSchemeSetupDetails()");

                object[] objects = new object[1];
                objects[0] = systematicSetupId;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(systematicSetupVo);
        }
コード例 #2
0
        /// <summary>
        /// Function to get all the Systematic Setup Schemes for a particular Customer
        /// </summary>
        /// <param name="portfolioId">The portfolioId of a particular Customer</param>
        /// <param name="CurrentPage">Gives the current page in the grid (Parameters for paging)</param>
        /// <param name="sortOrder">Gives the sort order ASC or DSC (Parameters for paging)</param>
        /// <param name="count">Number of records per page (Parameters for paging)</param>
        /// <returns></returns>
        public List <SystematicSetupVo> GetSystematicSchemeSetupList(int portfolioId)
        {
            SystematicSetupVo        systematicSetupVo;
            List <SystematicSetupVo> systematicSetupList = null;
            Database  db;
            DbCommand getSystematicSetupListCmd;
            DataSet   dsSystematicSetups;


            try
            {
                db = DatabaseFactory.CreateDatabase("wealtherp");
                getSystematicSetupListCmd = db.GetStoredProcCommand("SP_GetSystematicSetupSchemes");
                db.AddInParameter(getSystematicSetupListCmd, "@CP_PortfolioId", DbType.Int32, portfolioId);

                //db.AddInParameter(getSystematicSetupListCmd, "@CurrentPage", DbType.Int16, CurrentPage);
                //db.AddInParameter(getSystematicSetupListCmd, "@SortOrder", DbType.String, sortOrder);

                dsSystematicSetups = db.ExecuteDataSet(getSystematicSetupListCmd);
                //if (dsSystematicSetups.Tables[1] != null && dsSystematicSetups.Tables[1].Rows.Count > 0)
                //    count = Int32.Parse(dsSystematicSetups.Tables[1].Rows[0][0].ToString());
                //else
                //    count = 0;
                if (dsSystematicSetups.Tables[0].Rows.Count > 0)
                {
                    systematicSetupList = new List <SystematicSetupVo>();

                    foreach (DataRow dr in dsSystematicSetups.Tables[0].Rows)
                    {
                        systematicSetupVo = new SystematicSetupVo();
                        systematicSetupVo.SystematicSetupId = int.Parse(dr["CMFSS_SystematicSetupId"].ToString());
                        systematicSetupVo.SchemePlan        = dr["SchemeName"].ToString();
                        systematicSetupVo.SchemePlanCode    = int.Parse(dr["SchemeCode"].ToString());
                        if (!string.IsNullOrEmpty(dr["SchemeNameSwitch"].ToString()))
                        {
                            systematicSetupVo.SchemePlanSwitch = dr["SchemeNameSwitch"].ToString();
                        }
                        else
                        {
                            systematicSetupVo.SchemePlanSwitch = "";
                        }
                        if (!string.IsNullOrEmpty(dr["SchemePlanSwitch"].ToString()))
                        {
                            systematicSetupVo.SchemePlanCodeSwitch = int.Parse(dr["SchemePlanSwitch"].ToString());
                        }
                        else
                        {
                            systematicSetupVo.SchemePlanCodeSwitch = 0;
                        }
                        systematicSetupVo.Folio              = dr["CMFA_FolioNum"].ToString();
                        systematicSetupVo.AccountId          = int.Parse(dr["CMFA_AccountId"].ToString());
                        systematicSetupVo.SystematicType     = dr["XSTT_SystematicType"].ToString();
                        systematicSetupVo.SystematicTypeCode = dr["XSTT_SystematicTypeCode"].ToString();
                        systematicSetupVo.StartDate          = DateTime.Parse(dr["CMFSS_StartDate"].ToString());
                        systematicSetupVo.EndDate            = DateTime.Parse(dr["CMFSS_EndDate"].ToString());


                        if (!string.IsNullOrEmpty(dr["CMFSS_IsHistoricalCreated"].ToString()))
                        {
                            systematicSetupVo.IsHistoricalCreated = dr["CMFSS_IsHistoricalCreated"].ToString();
                        }
                        else
                        {
                            systematicSetupVo.IsHistoricalCreated = "0";
                        }
                        if (!string.IsNullOrEmpty(dr["CMFSS_IsAutoTransaction"].ToString()))
                        {
                            systematicSetupVo.IsAutoTransaction = dr["CMFSS_IsAutoTransaction"].ToString();
                        }
                        else
                        {
                            systematicSetupVo.IsAutoTransaction = "0";
                        }
                        systematicSetupVo.Amount        = double.Parse(dr["CMFSS_Amount"].ToString());
                        systematicSetupVo.IsManual      = int.Parse(dr["CMFSS_IsManual"].ToString());
                        systematicSetupVo.SourceName    = dr["XES_SourceName"].ToString();
                        systematicSetupVo.SourceCode    = dr["XES_SourceCode"].ToString();
                        systematicSetupVo.Frequency     = dr["XF_Frequency"].ToString();
                        systematicSetupVo.FrequencyCode = dr["XF_FrequencyCode"].ToString();

                        if (!string.IsNullOrEmpty(dr["CMFSS_SIPFirstChequeDate"].ToString()))
                        {
                            systematicSetupVo.SipChequeDate = DateTime.Parse(dr["CMFSS_SIPFirstChequeDate"].ToString());
                        }
                        else
                        {
                            systematicSetupVo.SipChequeDate = DateTime.MinValue;
                        }
                        if (!string.IsNullOrEmpty(dr["CMFSS_SIPFirstChequeNo"].ToString()))
                        {
                            systematicSetupVo.SipChequeNo = Int64.Parse(dr["CMFSS_SIPFirstChequeNo"].ToString());
                        }
                        else
                        {
                            systematicSetupVo.SipChequeNo = 0;
                        }
                        if (!string.IsNullOrEmpty(dr["CMFSS_RegistrationDate"].ToString()))
                        {
                            systematicSetupVo.RegistrationDate = DateTime.Parse(dr["CMFSS_RegistrationDate"].ToString());
                        }
                        else
                        {
                            systematicSetupVo.RegistrationDate = DateTime.MinValue;
                        }
                        systematicSetupVo.PaymentModeCode = dr["XPM_PaymentModeCode"].ToString();
                        if (dr["CMFSS_Tenure"].ToString() != "")
                        {
                            systematicSetupVo.Period = int.Parse(dr["CMFSS_Tenure"].ToString());
                        }
                        systematicSetupVo.PeriodSelection = dr["CMFSS_TenureCycle"].ToString();

                        if (!string.IsNullOrEmpty(dr["CMFSS_REMARKS"].ToString()))
                        {
                            systematicSetupVo.Remarks = dr["CMFSS_REMARKS"].ToString();
                        }
                        else
                        {
                            systematicSetupVo.Remarks = "";
                        }
                        if (!string.IsNullOrEmpty(dr["CMFSS_CEASEDATE"].ToString()))
                        {
                            systematicSetupVo.CeaseDate = DateTime.Parse(dr["CMFSS_CEASEDATE"].ToString());
                        }
                        else
                        {
                            systematicSetupVo.CeaseDate = DateTime.MinValue;
                        }
                        if (!string.IsNullOrEmpty(dr["CMFSS_SubBrokerCode"].ToString()))
                        {
                            systematicSetupVo.SubBrokerCode = dr["CMFSS_SubBrokerCode"].ToString();
                        }
                        else
                        {
                            systematicSetupVo.SubBrokerCode = "";
                        }

                        systematicSetupList.Add(systematicSetupVo);
                    }
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "SystematicSetupDao.cs:GetSystematicSchemeSetupList()");


                object[] objects = new object[1];
                objects[0] = portfolioId;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(systematicSetupList);
        }
コード例 #3
0
        /// <summary>
        /// Function to create an Systematic Setup for a particular User
        /// </summary>
        /// <param name="systematicSetupVo">Object that holds the Systematic for a particular customer</param>
        /// <param name="userId">UserIf of the creator</param>
        /// <returns>Returns a bool varible to tells if the process is successful or not</returns>
        public bool CreateSystematicSchemeSetup(SystematicSetupVo systematicSetupVo, int userId)
        {
            bool      bResult = false;
            Database  db;
            DbCommand createSystematicSchemeSetupCmd;

            try
            {
                db = DatabaseFactory.CreateDatabase("wealtherp");
                createSystematicSchemeSetupCmd = db.GetStoredProcCommand("SP_CreateSystematicSetup");

                db.AddInParameter(createSystematicSchemeSetupCmd, "@PASP_SchemePlanCode", DbType.Int32, systematicSetupVo.SchemePlanCode);
                if (systematicSetupVo.SchemePlanCodeSwitch != 0)
                {
                    db.AddInParameter(createSystematicSchemeSetupCmd, "@PASP_SchemePlanCodeSwitch", DbType.Int32, systematicSetupVo.SchemePlanCodeSwitch);
                }
                db.AddInParameter(createSystematicSchemeSetupCmd, "@CMFA_AccountId", DbType.Int32, systematicSetupVo.AccountId);
                db.AddInParameter(createSystematicSchemeSetupCmd, "@XSTT_SystematicTypeCode", DbType.String, systematicSetupVo.SystematicTypeCode);
                db.AddInParameter(createSystematicSchemeSetupCmd, "@CMFSS_StartDate", DbType.DateTime, systematicSetupVo.StartDate);
                db.AddInParameter(createSystematicSchemeSetupCmd, "@CMFSS_EndDate", DbType.DateTime, systematicSetupVo.EndDate);

                db.AddInParameter(createSystematicSchemeSetupCmd, "@CMFSS_IsHistoricalCreated", DbType.String, systematicSetupVo.IsHistoricalCreated);

                db.AddInParameter(createSystematicSchemeSetupCmd, "@CMFSS_Amount", DbType.Decimal, systematicSetupVo.Amount);
                db.AddInParameter(createSystematicSchemeSetupCmd, "@CMFSS_IsManual", DbType.Int32, systematicSetupVo.IsManual);
                db.AddInParameter(createSystematicSchemeSetupCmd, "@XES_SourceCode", DbType.String, systematicSetupVo.SourceCode);
                db.AddInParameter(createSystematicSchemeSetupCmd, "@XF_FrequencyCode", DbType.String, systematicSetupVo.FrequencyCode);
                db.AddInParameter(createSystematicSchemeSetupCmd, "@XPM_PaymentModeCode", DbType.String, systematicSetupVo.PaymentModeCode);
                db.AddInParameter(createSystematicSchemeSetupCmd, "@CMFSS_CreatedBy", DbType.Int32, userId);
                db.AddInParameter(createSystematicSchemeSetupCmd, "@CMFSS_ModifiedBy", DbType.Int32, userId);
                db.AddInParameter(createSystematicSchemeSetupCmd, "@CMFSS_Tenure", DbType.Int32, systematicSetupVo.Period);
                db.AddInParameter(createSystematicSchemeSetupCmd, "@IsAutoTranx", DbType.String, systematicSetupVo.IsAutoTransaction);
                db.AddInParameter(createSystematicSchemeSetupCmd, "@TenureCycle", DbType.String, systematicSetupVo.PeriodSelection);

                if (systematicSetupVo.SipChequeDate != DateTime.MinValue)
                {
                    db.AddInParameter(createSystematicSchemeSetupCmd, "@CMFSS_SIPFirstChequeDate", DbType.DateTime, systematicSetupVo.SipChequeDate);
                }
                else
                {
                    db.AddInParameter(createSystematicSchemeSetupCmd, "@CMFSS_SIPFirstChequeDate", DbType.DateTime, DBNull.Value);
                }
                if (systematicSetupVo.SipChequeNo != 0)
                {
                    db.AddInParameter(createSystematicSchemeSetupCmd, "@CMFSS_SIPFirstChequeNo", DbType.Int64, systematicSetupVo.SipChequeNo);
                }
                else
                {
                    db.AddInParameter(createSystematicSchemeSetupCmd, "@CMFSS_SIPFirstChequeNo", DbType.Int64, DBNull.Value);
                }
                if (systematicSetupVo.RegistrationDate != DateTime.MinValue)
                {
                    db.AddInParameter(createSystematicSchemeSetupCmd, "@CMFSS_RegistrationDate", DbType.DateTime, systematicSetupVo.RegistrationDate);
                }
                else
                {
                    db.AddInParameter(createSystematicSchemeSetupCmd, "@CMFSS_RegistrationDate", DbType.DateTime, DBNull.Value);
                }

                if (!string.IsNullOrEmpty(systematicSetupVo.Remarks))
                {
                    db.AddInParameter(createSystematicSchemeSetupCmd, "@Remarks", DbType.String, systematicSetupVo.Remarks);
                }
                else
                {
                    db.AddInParameter(createSystematicSchemeSetupCmd, "@Remarks", DbType.String, DBNull.Value);
                }
                if (systematicSetupVo.CeaseDate != DateTime.MinValue)
                {
                    db.AddInParameter(createSystematicSchemeSetupCmd, "@CeaseDate", DbType.DateTime, systematicSetupVo.CeaseDate);
                }
                else
                {
                    db.AddInParameter(createSystematicSchemeSetupCmd, "@CeaseDate", DbType.DateTime, DBNull.Value);
                }
                if (!string.IsNullOrEmpty(systematicSetupVo.SubBrokerCode))
                {
                    db.AddInParameter(createSystematicSchemeSetupCmd, "@CMFSS_SubBrokerCode", DbType.String, systematicSetupVo.SubBrokerCode);
                }
                else
                {
                    db.AddInParameter(createSystematicSchemeSetupCmd, "@CMFSS_SubBrokerCode", DbType.String, DBNull.Value);
                }

                db.ExecuteNonQuery(createSystematicSchemeSetupCmd);
                bResult = true;
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "SystematicSetupDao.cs:CreateSystematicSchemeSetup()");
                object[] objects = new object[2];
                objects[0]   = systematicSetupVo;
                objects[1]   = userId;
                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }

            return(bResult);
        }
コード例 #4
0
        public void LoadSystematicSetupGrid(int portfolioId)
        {
            List <SystematicSetupVo> systematicSetupList = new List <SystematicSetupVo>();

            try
            {
                string path = Server.MapPath(ConfigurationManager.AppSettings["xmllookuppath"].ToString());
                systematicSetupList = systematicSetupBo.GetSystematicSchemeSetupList(portfolioId);

                gvrSystematicSchemes.Visible = true;
                DataTable dtSystematicSetup = new DataTable();
                dtSystematicSetup.Columns.Add("SystematicSetupId");
                dtSystematicSetup.Columns.Add("Scheme Name");
                dtSystematicSetup.Columns.Add("Folio");
                dtSystematicSetup.Columns.Add("Systematic Transaction Type");
                dtSystematicSetup.Columns.Add("Start Date");
                dtSystematicSetup.Columns.Add("End Date");
                // dtSystematicSetup.Columns.Add("Systematic Date");
                dtSystematicSetup.Columns.Add("HistoricalCreated");
                dtSystematicSetup.Columns.Add("AutoTransaction");

                dtSystematicSetup.Columns.Add("Amount", typeof(double));
                dtSystematicSetup.Columns.Add("Frequency");
                dtSystematicSetup.Columns.Add("SubBrokerCode");
                DataRow drSystematicSetup;
                if (systematicSetupList != null)
                {
                    imgBtnrgHoldings.Visible = true;
                    for (int i = 0; i < systematicSetupList.Count; i++)
                    {
                        drSystematicSetup    = dtSystematicSetup.NewRow();
                        systematicSetupVo    = new SystematicSetupVo();
                        systematicSetupVo    = systematicSetupList[i];
                        drSystematicSetup[0] = systematicSetupVo.SystematicSetupId.ToString();
                        drSystematicSetup[1] = systematicSetupVo.SchemePlan.ToString();     //add to Vo scheme name and use join in SP
                        drSystematicSetup[2] = systematicSetupVo.Folio.ToString();          //add folio to Vo and use join in SP
                        drSystematicSetup[3] = systematicSetupVo.SystematicType.ToString(); //join
                        drSystematicSetup[4] = systematicSetupVo.StartDate.ToShortDateString();
                        drSystematicSetup[5] = systematicSetupVo.EndDate.ToShortDateString();

                        drSystematicSetup[6] = systematicSetupVo.IsHistoricalCreated.ToString();
                        drSystematicSetup[7] = systematicSetupVo.IsAutoTransaction.ToString();

                        drSystematicSetup[8] = systematicSetupVo.Amount;
                        drSystematicSetup[9] = systematicSetupVo.Frequency.ToString();    //join
                        drSystematicSetup["SubBrokerCode"] = systematicSetupVo.SubBrokerCode;

                        dtSystematicSetup.Rows.Add(drSystematicSetup);
                    }

                    gvrSystematicSchemes.DataSource = dtSystematicSetup;
                    gvrSystematicSchemes.DataBind();
                    if (Cache["SIP Details" + customerVo.CustomerId.ToString()] == null)
                    {
                        Cache.Insert("SIP Details" + customerVo.CustomerId.ToString(), dtSystematicSetup);
                    }
                    else
                    {
                        Cache.Remove("SIP Details" + customerVo.CustomerId.ToString());
                        Cache.Insert("SIP Details" + customerVo.CustomerId.ToString(), dtSystematicSetup);
                    }
                }
                else
                {
                    Cache.Remove("SIP Details" + customerVo.CustomerId.ToString());
                    imgBtnrgHoldings.Visible        = false;
                    gvrSystematicSchemes.DataSource = dtSystematicSetup;
                    gvrSystematicSchemes.DataBind();
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "PortfolioSystematicView.ascx:LoadSystematicSetupGrid()");
                object[] objects = new object[1];
                objects[0]   = systematicSetupVo;
                objects[1]   = systematicSetupList;
                FunctionInfo = exBase.AddObject(FunctionInfo, null);/*, objects*/
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
        }
コード例 #5
0
        /// <summary>
        /// Function to get the details of a particular Systematic Setup Scheme
        /// </summary>
        /// <param name="systematicSetupId"></param>
        /// <returns></returns>
        public SystematicSetupVo GetSystematicSchemeSetupDetails(int systematicSetupId)
        {
            SystematicSetupVo systematicSetupVo = new SystematicSetupVo();;
            Database          db;
            DbCommand         getSystematicSetupDetailsCmd;
            DataSet           dsSystematicSetups;
            DataRow           dr;

            try
            {
                db = DatabaseFactory.CreateDatabase("wealtherp");
                getSystematicSetupDetailsCmd = db.GetStoredProcCommand("SP_GetSystematicSetupDetails");
                db.AddInParameter(getSystematicSetupDetailsCmd, "@CMFSS_SystematicSetupId", DbType.Int32, systematicSetupId);


                dsSystematicSetups = db.ExecuteDataSet(getSystematicSetupDetailsCmd);
                if (dsSystematicSetups.Tables[0].Rows.Count > 0)
                {
                    dr = dsSystematicSetups.Tables[0].Rows[0];

                    systematicSetupVo.SystematicSetupId = int.Parse(dr["CMFSS_SystematicSetupId"].ToString());
                    systematicSetupVo.SchemePlan        = dr["PASP_SchemePlanName"].ToString();
                    systematicSetupVo.SchemePlanCode    = int.Parse(dr["PASP_SchemePlanCode"].ToString());
                    //systematicSetupVo.SystematicType = dr["XSTT_SystematicType"].ToString();
                    systematicSetupVo.SystematicTypeCode = dr["XSTT_SystematicTypeCode"].ToString();
                    //systematicSetupVo.Frequency = dr["XF_Frequency"].ToString();
                    systematicSetupVo.FrequencyCode        = dr["XF_FrequencyCode"].ToString();
                    systematicSetupVo.Folio                = dr["CMFA_FolioNum"].ToString();
                    systematicSetupVo.StartDate            = DateTime.Parse(dr["CMFSS_StartDate"].ToString());
                    systematicSetupVo.EndDate              = DateTime.Parse(dr["CMFSS_EndDate"].ToString());
                    systematicSetupVo.SystematicDate       = int.Parse(dr["CMFSS_SystematicDate"].ToString());
                    systematicSetupVo.Amount               = double.Parse(dr["CMFSS_Amount"].ToString());
                    systematicSetupVo.AccountId            = int.Parse(dr["CMFA_AccountId"].ToString());
                    systematicSetupVo.SchemePlanCodeSwitch = int.Parse(dr["SwitchSchemeCode"].ToString());
                    systematicSetupVo.SchemePlanSwitch     = dr["SwitchSchemePlanName"].ToString();
                    //systematicSetupVo.IsManual = int.Parse(dr["CMFSS_IsManual"].ToString());
                    //systematicSetupVo.SourceName = dr["XES_SourceName"].ToString();
                    //systematicSetupVo.SourceCode = dr["XES_SourceCode"].ToString();
                    //systematicSetupVo.PaymentMode = dr["XPM_PaymentMode"].ToString();
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "SystematicSetupDao.cs:GetSystematicSchemeSetupDetails()");

                object[] objects = new object[1];
                objects[0] = systematicSetupId;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(systematicSetupVo);
        }
コード例 #6
0
        /// <summary>
        /// Function to get all the Systematic Setup Schemes for a particular Customer
        /// </summary>
        /// <param name="portfolioId">The portfolioId of a particular Customer</param>
        /// <param name="CurrentPage">Gives the current page in the grid (Parameters for paging)</param>
        /// <param name="sortOrder">Gives the sort order ASC or DSC (Parameters for paging)</param>
        /// <param name="count">Number of records per page (Parameters for paging)</param>
        /// <returns></returns>
        public List <SystematicSetupVo> GetSystematicSchemeSetupList(int portfolioId, int CurrentPage, string sortOrder, out int count)
        {
            SystematicSetupVo        systematicSetupVo;
            List <SystematicSetupVo> systematicSetupList = null;
            Database  db;
            DbCommand getSystematicSetupListCmd;
            DataSet   dsSystematicSetups;

            try
            {
                db = DatabaseFactory.CreateDatabase("wealtherp");
                getSystematicSetupListCmd = db.GetStoredProcCommand("SP_GetSystematicSetupSchemes");
                db.AddInParameter(getSystematicSetupListCmd, "@CP_PortfolioId", DbType.Int32, portfolioId);
                db.AddInParameter(getSystematicSetupListCmd, "@CurrentPage", DbType.Int16, CurrentPage);
                db.AddInParameter(getSystematicSetupListCmd, "@SortOrder", DbType.String, sortOrder);

                dsSystematicSetups = db.ExecuteDataSet(getSystematicSetupListCmd);
                if (dsSystematicSetups.Tables[1] != null && dsSystematicSetups.Tables[1].Rows.Count > 0)
                {
                    count = Int32.Parse(dsSystematicSetups.Tables[1].Rows[0][0].ToString());
                }
                else
                {
                    count = 0;
                }
                if (dsSystematicSetups.Tables[0].Rows.Count > 0)
                {
                    systematicSetupList = new List <SystematicSetupVo>();

                    foreach (DataRow dr in dsSystematicSetups.Tables[0].Rows)
                    {
                        systematicSetupVo = new SystematicSetupVo();
                        systematicSetupVo.SystematicSetupId = int.Parse(dr["CMFSS_SystematicSetupId"].ToString());
                        systematicSetupVo.SchemePlan        = dr["SchemeName"].ToString();
                        systematicSetupVo.SchemePlanCode    = int.Parse(dr["SchemeCode"].ToString());
                        //systematicSetupVo.SchemePlanSwitch = dr["SchemeNameSwitch"].ToString();
                        systematicSetupVo.Folio              = dr["CMFA_FolioNum"].ToString();
                        systematicSetupVo.AccountId          = int.Parse(dr["CMFA_AccountId"].ToString());
                        systematicSetupVo.SystematicType     = dr["XSTT_SystematicType"].ToString();
                        systematicSetupVo.SystematicTypeCode = dr["XSTT_SystematicTypeCode"].ToString();
                        systematicSetupVo.StartDate          = DateTime.Parse(dr["CMFSS_StartDate"].ToString());
                        systematicSetupVo.EndDate            = DateTime.Parse(dr["CMFSS_EndDate"].ToString());
                        systematicSetupVo.SystematicDate     = int.Parse(dr["CMFSS_SystematicDate"].ToString());
                        systematicSetupVo.Amount             = double.Parse(dr["CMFSS_Amount"].ToString());
                        systematicSetupVo.IsManual           = int.Parse(dr["CMFSS_IsManual"].ToString());
                        systematicSetupVo.SourceName         = dr["XES_SourceName"].ToString();
                        systematicSetupVo.SourceCode         = dr["XES_SourceCode"].ToString();
                        systematicSetupVo.Frequency          = dr["XF_Frequency"].ToString();
                        systematicSetupVo.FrequencyCode      = dr["XF_FrequencyCode"].ToString();
                        //systematicSetupVo.PaymentMode = dr["XPM_PaymentMode"].ToString();

                        systematicSetupList.Add(systematicSetupVo);
                    }
                }
            }
            catch (BaseApplicationException Ex)
            {
                throw Ex;
            }
            catch (Exception Ex)
            {
                BaseApplicationException exBase       = new BaseApplicationException(Ex.Message, Ex);
                NameValueCollection      FunctionInfo = new NameValueCollection();
                FunctionInfo.Add("Method", "SystematicSetupDao.cs:GetSystematicSchemeSetupList()");


                object[] objects = new object[1];
                objects[0] = portfolioId;

                FunctionInfo = exBase.AddObject(FunctionInfo, objects);
                exBase.AdditionalInformation = FunctionInfo;
                ExceptionManager.Publish(exBase);
                throw exBase;
            }
            return(systematicSetupList);
        }