Esempio n. 1
0
        public JsonResult List(int page, int rows, string Keywords, bool?isReply = null)
        {
            ConsultationQuery consultationQuery = new ConsultationQuery()
            {
                PageNo   = page,
                PageSize = rows,
                KeyWords = Keywords,
                ShopID   = base.CurrentSellerManager.ShopId,
                IsReply  = isReply
            };
            PageModel <ProductConsultationInfo>    consultations = ServiceHelper.Create <IConsultationService>().GetConsultations(consultationQuery);
            IEnumerable <ProductConsultationModel> list          =
                from item in consultations.Models.ToList()
                select new ProductConsultationModel()
            {
                Id = item.Id,
                ConsultationContent = ProductConsultationController.HTMLEncode(item.ConsultationContent),
                ConsultationDate    = item.ConsultationDate,
                ConsultationDateStr = item.ConsultationDate.ToString("yyyy-MM-dd HH:mm"),
                ProductName         = item.ProductInfo.ProductName,
                ProductPic          = item.ProductInfo.ImagePath,
                ProductId           = item.ProductId,
                UserName            = item.UserName,
                ReplyContent        = ProductConsultationController.HTMLEncode(item.ReplyContent),
                ImagePath           = item.ProductInfo.ImagePath,
                ReplyDate           = item.ReplyDate
            };
            DataGridModel <ProductConsultationModel> dataGridModel = new DataGridModel <ProductConsultationModel>()
            {
                rows  = list,
                total = consultations.Total
            };

            return(Json(dataGridModel));
        }
Esempio n. 2
0
        public JsonResult ReplyConsultation(long id, string replycontent)
        {
            long shopId = base.CurrentSellerManager.ShopId;

            ServiceHelper.Create <IConsultationService>().ReplyConsultation(id, ProductConsultationController.HTMLEncode(replycontent), shopId);
            Result result = new Result()
            {
                success = true,
                msg     = "回复成功!"
            };

            return(Json(result));
        }