/// <summary>
        ///     Creates a new comment <see cref="OrderCommentModelItem" /> of order
        /// </summary>
        public virtual async Task <OrderCommentModelItem> CreateAsync(int orderId, OrderCommentModel orderComment)
        {
            var req     = PrepareRequest($"orders/{orderId}/comments");
            var body    = orderComment.ToDictionary();
            var content = new JsonContent(body);

            return(await ExecuteRequestAsync <OrderCommentModelItem>(req, HttpMethod.Post, content, "data"));
        }
        /// <summary>
        ///     Updates the given <see cref="OrderCommentModel" />.
        /// </summary>
        /// <param name="orderId">Id of the object being updated.</param>
        /// <param name="commentId">commentId of the order</param>
        /// <param name="orderCommentModel">The <see cref="OrderCommentModel" /> to update.</param>
        /// <returns>The updated <see cref="OrderCommentModel" />.</returns>
        public virtual async Task <OrderModel> PatchAsync(int orderId, int commentId,
                                                          OrderCommentModel orderCommentModel)
        {
            var req     = PrepareRequest($"orders/{orderId}/comments/{commentId}");
            var body    = orderCommentModel.ToDictionary();
            var content = new JsonContent(body);

            return(await ExecuteRequestAsync <OrderModel>(req, HttpMethod.Patch, content, "data"));
        }
 void AddOrderComment(OrderCommentModel comment)
 {
     TradeCommentApplication.Add(new OrderComment()
     {
         OrderId      = comment.OrderId,
         DeliveryMark = comment.DeliveryMark,
         ServiceMark  = comment.ServiceMark,
         PackMark     = comment.PackMark,
         UserId       = CurrentUser.Id,
     });
 }
 void AddOrderComment(OrderCommentModel comment)
 {
     ServiceProvider.Instance <ITradeCommentService> .Create.AddOrderComment(new OrderCommentInfo()
     {
         OrderId      = comment.OrderId,
         DeliveryMark = comment.DeliveryMark,
         ServiceMark  = comment.ServiceMark,
         PackMark     = comment.PackMark,
         UserId       = CurrentUser.Id,
     });
 }
Esempio n. 5
0
 void AddOrderComment(OrderCommentModel comment, int productNum)
 {
     TradeCommentApplication.Add(new DTO.OrderComment()
     {
         OrderId      = comment.OrderId,
         DeliveryMark = comment.DeliveryMark,
         ServiceMark  = comment.ServiceMark,
         PackMark     = comment.PackMark,
         UserId       = CurrentUser.Id
     }, productNum);
 }
Esempio n. 6
0
 void AddOrderComment(OrderCommentModel comment)
 {
     ServiceProvider.Instance <ITradeCommentService> .Create.AddOrderComment(new Mall.Entities.OrderCommentInfo()
     {
         OrderId      = comment.OrderId,
         DeliveryMark = comment.DeliveryMark,
         ServiceMark  = comment.ServiceMark,
         PackMark     = comment.PackMark,
         UserId       = CurrentUser.Id,
     }, comment.ProductComments.Count());
 }
Esempio n. 7
0
        private void AddOrderComment(OrderCommentModel comment)
        {
            ITradeCommentService tradeCommentService = ServiceHelper.Create <ITradeCommentService>();
            OrderCommentInfo     orderCommentInfo    = new OrderCommentInfo()
            {
                OrderId      = comment.OrderId,
                DeliveryMark = comment.DeliveryMark,
                ServiceMark  = comment.ServiceMark,
                PackMark     = comment.PackMark,
                UserId       = base.CurrentUser.Id
            };

            tradeCommentService.AddOrderComment(orderCommentInfo);
        }
Esempio n. 8
0
        public JsonResult AddComment(string comment)
        {
            bool flag = false;
            OrderCommentModel orderCommentModel = JsonConvert.DeserializeObject <OrderCommentModel>(comment);

            if (orderCommentModel != null)
            {
                using (TransactionScope transactionScope = new TransactionScope())
                {
                    AddOrderComment(orderCommentModel);
                    AddProductsComment(orderCommentModel.OrderId, orderCommentModel.ProductComments);
                    transactionScope.Complete();
                }
                flag = true;
            }
            return(Json(new { success = flag }));
        }