| namespace WIDESEA_StorageOutOrderRepository; | 
|   | 
| public class Dt_OutOrderAndStockRepository : RepositoryBase<Dt_OutOrderAndStock>, IDt_OutOrderAndStockRepository | 
| { | 
|     public Dt_OutOrderAndStockRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) | 
|     { | 
|     } | 
|   | 
|     /// <summary> | 
|     /// 根据特定条件获取出库物料信息 | 
|     /// </summary> | 
|     /// <param name="locationID">货位ID</param> | 
|     /// <param name="orderNum">出库订单</param> | 
|     /// <param name="palletCode">托盘号</param> | 
|     /// <returns>出库物料信息</returns> | 
|     public async Task<Dt_OutOrderAndStock> GetOrderAndStock(string locationID = null, string orderNum = null, string palletCode = null) | 
|     { | 
|         return await Db.Queryable<Dt_OutOrderAndStock>() | 
|             .Includes(x => x.OrderList) | 
|             //.Includes(x => x.StockList) | 
|             //.Includes(x => x.LocationList) | 
|             .WhereIF(locationID != null, x => x.LocationCode == locationID) | 
|             .WhereIF(orderNum != null, x => x.OrderNumber == orderNum) | 
|             .WhereIF(palletCode != null, x => x.PalletCode == palletCode) | 
|             .FirstAsync(); | 
|     } | 
|   | 
|     /// <summary> | 
|     /// 导航删除 | 
|     /// </summary> | 
|     /// <param name="stock">出库物料信息</param> | 
|     /// <returns>成功/失败</returns> | 
|     public bool DeleteNavOrderStock(Dt_OutOrderAndStock stock) | 
|     { | 
|         return Db.DeleteNav<Dt_OutOrderAndStock>(x => x.Id == stock.Id) | 
|             .Include(x => x.OrderList).ThenInclude(x => x.OrderDetailList) | 
|             //.Include(x => x.StockList).ThenInclude(x => x.Dt_BillGroupStockDetailList) | 
|             .ExecuteCommand(); | 
|     } | 
|   | 
|     /// <summary> | 
|     /// 导航更新 | 
|     /// </summary> | 
|     /// <param name="stock">出库物料信息</param> | 
|     /// <returns>成功/失败</returns> | 
|     public bool UpdateNavOrderStock(Dt_OutOrderAndStock stock) | 
|     { | 
|         return Db.UpdateNav(stock) | 
|             .Include(x => x.OrderList) | 
|             //.Include(x => x.StockList) | 
|             .ExecuteCommand(); | 
|     } | 
| } |