Пример #1
0
 public void Create(OrderInfo orderInfo)
 {
     if (orderInfo == null)
     {
         throw new ArgumentNullException("订单信息有误");
     }
     _orderInfoRepository.Add(orderInfo);
     _orderInfoRepository.UnitOfWork.Commit();
 }
Пример #2
0
        public IActionResult Add([FromBody] OrderInfo model)
        {
            try
            {
                model.Status     = (int)OrderStatusEnum.已下单;
                model.CreateTime = DateTime.Now;
                model.OrderNo    = "";

                _orderInfoRepository.Add(model);
                _orderInfoRepository.Commit();

                return(Ok());
            }
            catch (Exception ex)
            {
                Response.StatusCode = 500;
                return(null);
            }
        }