Beispiel #1
0
 void AddProductsComment(long orderId, IEnumerable <ProductCommentModel> productComments)
 {
     foreach (var productComment in productComments)
     {
         Entities.ProductCommentInfo model = new Entities.ProductCommentInfo();
         model.ReviewDate    = DateTime.Now;
         model.ReviewContent = productComment.Content;
         model.UserId        = CurrentUser.Id;
         model.UserName      = CurrentUser.UserName;
         model.Email         = CurrentUser.Email;
         model.SubOrderId    = productComment.OrderItemId;
         model.ReviewMark    = productComment.Mark;
         model.ProductId     = productComment.ProductId;
         if (productComment.Images != null && productComment.Images.Length > 0)
         {
             model.ProductCommentImageInfo = productComment.Images.Select(item => new Entities.ProductCommentImageInfo
             {
                 CommentType  = 0,//0代表默认的表示评论的图片
                 CommentImage = MoveImages(item, CurrentUser.Id)
             }).ToList();
         }
         CommentApplication.AddComment(model);
     }
 }