/// <summary> /// Gets the order details that has the given order id. /// </summary> /// <param name="orderId">Order id in type of ineteger</param> /// <returns>If founds any matching data, returns SuccessDataResult with the data of OrderDetailDto object, else returns ErrorDataResult with an not found message.</returns> public IDataResult <OrderDetailDto> GetOrderDetail(int orderId) { var result = _orderDal.Get(o => o.OrderId == orderId); if (result != null) { return(new SuccessDataResult <OrderDetailDto>(_orderDal.GetOrderDetail(orderId))); } return(new ErrorDataResult <OrderDetailDto>(Messages.NotFound)); }
/// <summary> /// 设置或获取订单详情 /// </summary> /// <param name="orderId"></param> /// <returns></returns> public OrderDetailModel GetOrderDetail(string orderId) { var result = _orderDal.GetOrderDetail(orderId); if (result == null) { _LogFactory.Error($"{GetType().Name}:{new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Name}", "获取订单详情失败", new { OrderId = orderId }); Function.ExceptionThrow("Error", "获取订单详情失败,请重试"); } return(result); }
public IDataResult <List <OrderDto> > GetOrdersDto() { return(new SuccessDataResult <List <OrderDto> >(_orderDal.GetOrderDetail())); }