예제 #1
0
        /// <summary>
        /// 发表咨询
        /// </summary>
        /// <returns></returns>
        public JsonResult CreateConsult()
        {
            ConsultationInfo info = new ConsultationInfo();

            info.ProductSysNo  = int.Parse(Request["ProductSysNo"].ToString());
            info.CustomerSysNo = this.CurrUser.UserSysNo;
            info.Content       = Request["Content"].ToString();
            info.Type          = Request["Type"].ToString();
            bool IsSuccess = ConsultationFacade.CreateProductConsult(info);

            if (IsSuccess)
            {
                return(new JsonResult()
                {
                    Data = 1
                });
            }
            else
            {
                return(new JsonResult()
                {
                    Data = 0
                });
            }
        }
예제 #2
0
 public static bool CreateProductConsultInfo(AddProductConsultInfoViewModel request)
 {
     if (request.ProductSysNo <= 0)
     {
         throw new BusinessException("商品编号不能为空!");
     }
     if (string.IsNullOrEmpty(request.Content))
     {
         throw new BusinessException("咨询内容不能为空!");
     }
     if (string.IsNullOrEmpty(request.Type))
     {
         throw new BusinessException("咨询类型不能为空!");
     }
     return(ConsultationFacade.CreateProductConsult(EntityConverter <AddProductConsultInfoViewModel, ConsultationInfo> .Convert(request)));
 }