Пример #1
0
        public ResultDTO ReviewNofityComOnlyExt(ReviewNofityDTO rnDto)
        {
            ResultDTO result = new ResultDTO();

            try
            {
                if (rnDto == null)
                {
                    result.ResultCode = 1;
                    result.Message    = "参数错误,参数不能为空!";
                    return(result);
                }
                if (rnDto.CommodityId == Guid.Empty)
                {
                    result.ResultCode = 2;
                    result.Message    = "参数错误,商品id不能为空!";
                    return(result);
                }

                ContextSession contextSession = ContextFactory.CurrentThreadContext;
                //增加商品评价数
                Commodity com = Commodity.ObjectSet().FirstOrDefault(n => n.Id == rnDto.CommodityId);
                if (com == null)
                {
                    result.ResultCode = 4;
                    result.Message    = "未找到要评价的商品!";
                    return(result);
                }
                com.TotalReview += 1;
                com.ModifiedOn   = DateTime.Now;
                contextSession.SaveChanges();

                com.RefreshCache(EntityState.Modified);
            }
            catch (Exception ex)
            {
                LogHelper.Error(string.Format("ReviewSV.ReviewNofityComOnlyExt:{0}", JsonHelper.JsonSerializer(rnDto)), ex);

                result.ResultCode = -1;
                result.Message    = "服务异常,请稍后重试!";
            }
            return(result);
        }
Пример #2
0
        /// <summary>
        /// 评价成功后的通知更新商品评价数
        /// <para>Service Url: http://devbtp.iuoooo.com/Jinher.AMP.BTP.SV.ReviewSV.svc/ReviewNofityComOnly
        /// </para>
        /// </summary>
        /// <param name="rnDto"></param>
        /// <returns></returns>
        public ResultDTO ReviewNofityComOnly(ReviewNofityDTO rnDto)
        {
            //定义返回值
            ResultDTO result;

            try
            {
                //调用代理方法
                result = base.Channel.ReviewNofityComOnly(rnDto);
            }
            catch
            {
                //抛异常
                throw;
            }
            finally
            {
                //关链接
                ChannelClose();
            }            //返回结果
            return(result);
        }
Пример #3
0
 /// <summary>
 /// 评价成功后的通知更新商品评价数
 /// <para>Service Url: http://devbtp.iuoooo.com/Jinher.AMP.BTP.SV.ReviewSV.svc/ReviewNofityComOnly
 /// </para>
 /// </summary>
 /// <param name="rnDto"></param>
 /// <returns></returns>
 public ResultDTO ReviewNofityComOnly(ReviewNofityDTO rnDto)
 {
     base.Do();
     return(this.Command.ReviewNofityComOnly(rnDto));
 }
Пример #4
0
 /// <summary>
 /// 评价成功后的通知更新商品评价数
 /// <para>Service Url: http://devbtp.iuoooo.com/Jinher.AMP.BTP.SV.ReviewSV.svc/ReviewNofityComOnly
 /// </para>
 /// </summary>
 /// <param name="rnDto"></param>
 /// <returns></returns>
 public ResultDTO ReviewNofityComOnly(ReviewNofityDTO rnDto)
 {
     base.Do(false);
     return(this.ReviewNofityComOnlyExt(rnDto));
 }