示例#1
0
        public void AddSendReport(InvRecommendationSend invRecommendationSend)
        {
            try
            {
                // DataBase.DBService.BeginTransaction();
                string filePath = getInvestmentRecommendationSendReportPath(invRecommendationSend.ClientId.ToString(), invRecommendationSend.Pid.ToString());

                if (invRecommendationSend.ReportDataPath != null)
                {
                    byte[] arrBytes = Convert.FromBase64String(invRecommendationSend.ReportDataPath);
                    File.WriteAllBytes(filePath, arrBytes);
                }

                DataBase.DBService.ExecuteCommandString(string.Format(ADD_SEND_INVESTMENT_RECOMMENDATION, invRecommendationSend.Pid, invRecommendationSend.SendDate.ToString("yyyy-MM-dd hh:mm:ss"), filePath, Path.GetFileName(filePath)));
                // DataBase.DBService.CommitTransaction();
            }
            catch (Exception ex)
            {
                //DataBase.DBService.RollbackTransaction();
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                MethodBase currentMethodName = sf.GetMethod();
                LogDebug(currentMethodName.Name, ex);
                throw ex;
            }
        }
示例#2
0
        private InvRecommendationSend convertToInvRecSendObject(DataRow dr)
        {
            InvRecommendationSend recommendationSend = new InvRecommendationSend();

            recommendationSend.Id             = dr.Field <int>("Id");
            recommendationSend.Pid            = dr.Field <int>("PID");
            recommendationSend.SendDate       = dr.Field <DateTime>("SendDate");
            recommendationSend.ReportDataPath = dr.Field <string>("ReportDataPath");
            recommendationSend.FileName       = dr.Field <string>("FileName");
            return(recommendationSend);
        }
示例#3
0
        public IList <InvRecommendationSend> GetSendReports(int plannerId)
        {
            IList <InvRecommendationSend> recommendationSends = new List <InvRecommendationSend>();

            DataTable dtAppConfig = DataBase.DBService.ExecuteCommand(string.Format(GET_SEND_INVESTMENT_RECOMMENDATION, plannerId));

            foreach (DataRow dr in dtAppConfig.Rows)
            {
                InvRecommendationSend recommendationSend = convertToInvRecSendObject(dr);
                recommendationSends.Add(recommendationSend);
            }
            return(recommendationSends);
        }
示例#4
0
        public Result AddSendReport(InvRecommendationSend invRecommendationSend)
        {
            var result = new Result();

            try
            {
                InvestmentRecommendationService investmentRecommendationService = new InvestmentRecommendationService();
                investmentRecommendationService.AddSendReport(invRecommendationSend);
                result.IsSuccess = true;
            }
            catch (Exception exception)
            {
                result.IsSuccess     = false;
                result.ExceptionInfo = exception;
            }
            return(result);
        }