示例#1
0
        public IHttpActionResult CustomerGetAllTransacts()
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }


            //var a = new BookSearch();
            var session = HttpContext.Current.Request.Cookies.Get("sessionId");

            if (session == null)
            {
                return(BadRequest("请重新登录!"));
            }

            var customerId = CustomerSession.GetCustomerIdFromSession(int.Parse(session.Value));

            if (customerId < 0)
            {
                return(BadRequest("请先登录!"));
            }


            Transact[] transacts = TransactService.CustomerGetAllTransacts(customerId);
            if (transacts.Length == 0)
            {
                return(BadRequest("没有订单信息!"));
            }
            return(Ok(transacts));
        }
示例#2
0
 public IHttpActionResult GetAllComments(GetRequest data)
 {
     TransactService.CommentInfo[] comments = TransactService.GetCommentsOfMerchandise(data.MerchandiseId);
     if (comments.Length == 0)
     {
         return(BadRequest("还没有人发表评论哦"));
     }
     return(Ok(comments));
 }