Ejemplo n.º 1
0
 /// <summary>
 /// 修改订单状态
 /// </summary>
 /// <param name="Id"></param>
 /// <param name="status"></param>
 /// <returns></returns>
 public IActionResult ChangeStatus([FromBody]OrderInfo oldModel)
 {
     try
     {
         var orderModel = _orderInfoRepository.GetSingle(oldModel.Id);
         orderModel.Status = oldModel.Status;
         _orderInfoRepository.Update(orderModel);
         _orderInfoRepository.Commit();
         return JsonOk("", "操作成功");
     }
     catch (Exception)
     {
         return JsonOk("", "操作失败");
     }           
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 删除订单
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public IActionResult DelOrderInfo([FromBody] OrderInfo model)
        {
            try
            {
                var oldModel = _orderInfoRepository.GetSingle(e => e.Id == model.Id);
                oldModel.IsDel = 1;
                _orderInfoRepository.Update(oldModel);

                return(JsonOk(""));
            }
            catch (Exception ex)
            {
                return(JsonError(ex.Message));
            }
        }