public TS_17TradeAndLoading1[] GetTSTradeAndLoading1(string turnId) { using (var dataContext = new AusterlitzDbContext()) { var listRepository = new GenericRepository <TS_17TradeAndLoading1>(dataContext); var tsItems = listRepository.GetItems(x => x.TurnId == turnId).OrderBy(y => y.OrderNo); if (tsItems.Count() == 0) { var newItems = new TS_17TradeAndLoading1[18]; for (var itemCount = 1; itemCount <= newItems.Count(); itemCount++) { TS_17TradeAndLoading1 item = new TS_17TradeAndLoading1() { TurnId = turnId, OrderNo = itemCount }; newItems[itemCount - 1] = item; } listRepository.InsertRange(newItems); dataContext.SaveChanges(); tsItems = listRepository.GetItems(x => x.TurnId == turnId).OrderBy(y => y.OrderNo); } return(tsItems.ToArray()); } }
public TS_17TradeAndLoading1[] PostTSTradeAndLoading1(TS_17TradeAndLoading1[] saveRecords) { var turnReportManager = new Austerlitz.Domain.TurnSheetManager(); return turnReportManager.PostTSTradeAndLoading1(saveRecords); }