예제 #1
0
        public static Tuple <bool, string> CreateProductComment(Guid userId, int orderId, int pkid, string title,
                                                                string content, string imgStr)
        {
            var result = false;
            var msg    = string.Empty;

            try
            {
                if (pkid > 0)
                {
                    var info = DalZeroActivity.SelectZeroActivityDetail(pkid);
                    if (info != null && info.UserID == userId && info.OrderId == orderId)
                    {
                        var orderList = OrderService.FetchOrderAndListByOrderId(orderId);
                        var getResult = CommentService.CreateProductComment(new CreateProductCommentRequest()
                        {
                            ProductFamilyId = info.PID.Split('|').FirstOrDefault(),
                            ProductId       = info.PID,
                            CommentImages   = imgStr.TrimStart(';'),
                            CommentContent  = content,
                            CommentType     = 3,
                            OrderListId     = orderList?.OrderListModel?.FirstOrDefault()?.OrderListId ?? 0,
                            OrderId         = info.OrderId,
                            CommentR1       = 5,
                            CommentR2       = 5,
                            CommentR3       = 5,
                            CommentR4       = 5,
                            CommentR5       = 5,
                            CommentStatus   = 1,
                            UserName        = info.UserName,
                            UserId          = userId,
                            SingleTitle     = title
                        });
                        result = getResult.IsSuccess;
                        msg    = getResult.ErrorMessage;
                    }
                    else
                    {
                        msg = "信息异常";
                    }
                }
            }
            catch (Exception ex)
            {
                msg = "系统异常";
                logger.Error(ex);
            }
            return(Tuple.Create(result, msg));
        }
예제 #2
0
 /// <summary>
 /// 查询0元购活动详情
 /// </summary>
 /// <returns></returns>
 public static List <ZeroActivityDetail> SelectZeroActivityDetail()
 {
     return(DalZeroActivity.SelectZeroActivityDetail());
 }