Exemplo n.º 1
0
        public void Add(SwitchTypeInvestmentRecommendation switchTypeInvestment)
        {
            try
            {
                //string clientName = DataBase.DBService.ExecuteCommandScalar(string.Format(GET_CLIENT_NAME_QUERY, lumsumInvestmentRecomendation.Pid));

                DataBase.DBService.ExecuteCommand(string.Format(INSERT_QUERY,
                                                                switchTypeInvestment.Pid,
                                                                switchTypeInvestment.FromSchemeId,
                                                                switchTypeInvestment.ToSchemeId,
                                                                switchTypeInvestment.Amount,
                                                                switchTypeInvestment.CreatedOn.ToString("yyyy-MM-dd hh:mm:ss"),
                                                                switchTypeInvestment.CreatedBy,
                                                                switchTypeInvestment.UpdatedOn.ToString("yyyy-MM-dd hh:mm:ss"),
                                                                switchTypeInvestment.UpdatedBy));

                Activity.ActivitiesService.Add(ActivityType.CreateInvestmentRecommendation, EntryStatus.Success,
                                               Source.Server, switchTypeInvestment.UpdatedByUserName, switchTypeInvestment.ToSchemeName, switchTypeInvestment.MachineName);
            }
            catch (Exception ex)
            {
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                MethodBase currentMethodName = sf.GetMethod();
                LogDebug(currentMethodName.Name, ex);
                throw ex;
            }
        }
Exemplo n.º 2
0
        private SwitchTypeInvestmentRecommendation convertToSTPInvestmentRecomendationObject(DataRow dr)
        {
            SwitchTypeInvestmentRecommendation switchTypeInvestmentRecommendation = new SwitchTypeInvestmentRecommendation();

            switchTypeInvestmentRecommendation.Pid            = dr.Field <int>("PId");
            switchTypeInvestmentRecommendation.FromSchemeId   = dr.Field <int>("FromSchemeId");
            switchTypeInvestmentRecommendation.FromSchemeName = dr.Field <string>("FromScheme");
            switchTypeInvestmentRecommendation.ToSchemeId     = dr.Field <int>("ToSchemeId");
            switchTypeInvestmentRecommendation.ToSchemeName   = getSchemeName(switchTypeInvestmentRecommendation.ToSchemeId);
            switchTypeInvestmentRecommendation.Amount         = double.Parse(dr["Amount"].ToString());
            return(switchTypeInvestmentRecommendation);
        }
        public Result Delete(SwitchTypeInvestmentRecommendation lumsumInvestmentRecomendation)
        {
            var result = new Result();

            try
            {
                SwitchInvestmentRecommendationService switchInvestmentRecomendationService = new SwitchInvestmentRecommendationService();
                switchInvestmentRecomendationService.Delete(lumsumInvestmentRecomendation);
                result.IsSuccess = true;
            }
            catch (Exception exception)
            {
                result.IsSuccess     = false;
                result.ExceptionInfo = exception;
            }
            return(result);
        }
Exemplo n.º 4
0
        public void Delete(SwitchTypeInvestmentRecommendation switchTypeInvestment)
        {
            try
            {
                string clientName = DataBase.DBService.ExecuteCommandScalar(string.Format(GET_CLIENT_NAME_QUERY, switchTypeInvestment.Pid));

                DataBase.DBService.ExecuteCommand(string.Format(DELETE_QUERY,
                                                                switchTypeInvestment.Pid, switchTypeInvestment.ToSchemeId, switchTypeInvestment.Amount));

                Activity.ActivitiesService.Add(ActivityType.DeleteInvestmentRecommendation, EntryStatus.Success,
                                               Source.Server, switchTypeInvestment.UpdatedByUserName, switchTypeInvestment.ToSchemeName,
                                               switchTypeInvestment.MachineName);
            }
            catch (Exception ex)
            {
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                MethodBase currentMethodName = sf.GetMethod();
                LogDebug(currentMethodName.Name, ex);
                throw ex;
            }
        }
Exemplo n.º 5
0
        public IList <SwitchTypeInvestmentRecommendation> GetAll(int plannerId)
        {
            IList <SwitchTypeInvestmentRecommendation> lumsumInvestmentRecomendations = new List <SwitchTypeInvestmentRecommendation>();

            try
            {
                Logger.LogInfo("Get: STP investment process start");
                DataTable dtAppConfig = DataBase.DBService.ExecuteCommand(string.Format(SELECT_ALL, plannerId));
                foreach (DataRow dr in dtAppConfig.Rows)
                {
                    SwitchTypeInvestmentRecommendation switchType = convertToSTPInvestmentRecomendationObject(dr);
                    lumsumInvestmentRecomendations.Add(switchType);
                }
                Logger.LogInfo("Get: STP investment process completed.");
            }
            catch (Exception ex)
            {
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                MethodBase currentMethodName = sf.GetMethod();
                LogDebug(currentMethodName.Name, ex);
            }
            return(lumsumInvestmentRecomendations);
        }