コード例 #1
0
ファイル: WeiXinController.cs プロジェクト: OpuZm/NHRTest
        /// <summary>
        /// 获取订单相关信息
        /// </summary>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public JsonResult GetOrderInfo(int orderId)
        {
            var res = new Response()
            {
                Data = null, Successed = false
            };

            if (ModelState.IsValid)
            {
                try
                {
                    var ordTabList                  = _orderRepository.GetOrderTableListBy(orderId, SearchTypeBy.订单Id);
                    var tabIdList                   = ordTabList.Select(x => x.R_Table_Id).ToList();
                    CheckOutOrderDTO order          = _checkOutService.GetCheckOutOrderDTO(orderId, tabIdList, OrderTableStatus.所有);
                    OrderSearchDTO   orderSearchDTO = new OrderSearchDTO(order);
                    res.Data      = orderSearchDTO;
                    res.Successed = true;
                }
                catch (Exception e)
                {
                    res.Message = e.Message;
                }
            }
            else
            {
                res.Message = string.Join(",", ModelState.SelectMany(ms => ms.Value.Errors).Select(e => e.ErrorMessage));
            }
            return(Json(res, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
ファイル: CheckOutController.cs プロジェクト: OpuZm/NHRTest
        private CheckOutOrderDTO GetCheckOutOrder(CheckoutReqDTO checkoutReqDTO)
        {
            CheckOutOrderDTO checkoutOrder = _checkOutService.GetCheckOutOrderDTO(checkoutReqDTO.OrderId, checkoutReqDTO.TableIds, checkoutReqDTO.OrderTableStatus);

            return(checkoutOrder);
        }