| | |
| | | return Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == palletCode).Includes(x => x.Details).First(); |
| | | } |
| | | |
| | | public Dt_StockInfo GetStockInfo(int id) |
| | | { |
| | | return Db.Queryable<Dt_StockInfo>().Where(x => x.Id == id).Includes(x => x.Details).First(); |
| | | } |
| | | |
| | | public List<Dt_StockInfo> GetStockInfos(string materielCode) |
| | | { |
| | | return Db.Queryable<Dt_StockInfo>().Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode)).ToList(); |
| | |
| | | //ISugarQueryable<Dt_StockInfo> sugarQueryable1 = Db.Queryable<Dt_StockInfo>().Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode)); |
| | | //return sugarQueryable.InnerJoin(sugarQueryable1, (a, b) => a.LocationCode == b.LocationCode).Select((a, b) => b).Includes(x => x.Details).ToList(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®è´§ä½ç¼å·è·åç»çåºåä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="locationCodes"></param> |
| | | /// <returns></returns> |
| | | public List<Dt_StockInfo> LocationCodesGetStockInfos(List<string> locationCodes, StockStatusEmun statusEmun = StockStatusEmun.å·²å
¥åº) |
| | | { |
| | | return Db.Queryable<Dt_StockInfo>().Where(x => locationCodes.Contains(x.LocationCode) /*&& x.StockStatus == statusEmun.ObjToInt()*/).Includes(x => x.Details).ToList(); |
| | | } |
| | | public List<Dt_StockInfo> GetStockInfos(string materielCode, List<string> locationCodes) |
| | | { |
| | | return Db.Queryable<Dt_StockInfo>().Where(x => locationCodes.Contains(x.LocationCode)).Includes(x => x.Details).Where(x => x.Details.Any(v => v.MaterielCode == materielCode)).ToList(); |
| | |
| | | { |
| | | return Db.UpdateNav(stockInfo).Include(x => x.Details).ExecuteCommand(); |
| | | } |
| | | public List<object> GetBatchNoStockInfo(string materielCode) |
| | | { |
| | | List<object> strings = new List<object>(); |
| | | var Dt_StockInfoDetails = Db.Queryable<Dt_StockInfoDetail>().Where(x => x.MaterielCode == materielCode && x.Status == StockStatusEmun.å·²å
¥åº.ObjToInt()).ToList().GroupBy(x => x.BatchNo).Select(x => x.Key); |
| | | foreach (var item in Dt_StockInfoDetails) |
| | | { |
| | | strings.Add(item); |
| | | } |
| | | return strings; |
| | | } |
| | | |
| | | public Dt_StockInfo GetPalletStockInfo(string roadwayNo) |
| | | { |