//Search Entities public async Task <IEnumerable <OverShortDetailsEX> > SearchOverShortDetailsEX(List <string> lst, List <string> includeLst = null) { using (var ctx = new OverShortDetailsEXService()) { return(await ctx.GetOverShortDetailsByExpressionLst(lst, includeLst).ConfigureAwait(false)); } }
internal async Task AutoMatch(IEnumerable <OversShortEX> slst) { IEnumerable <IGrouping <OversShortEX, OverShortDetailsEX> > lst; if (!slst.Any()) { using (var ctx = new OverShortDetailsEXService()) { var alst = await ctx.GetOverShortDetailsByExpressionNav("ReceivedQty < InvoiceQty", new Dictionary <string, string>() { { "OversShortEX", "OverShortSuggestedDocuments.ReferenceNumber != null || OverShortSuggestedDocuments.CNumber != null" } }, new List <string>() { "OversShort" }).ConfigureAwait(false); lst = alst.GroupBy(x => x.OversShortEX); } } else { lst = slst.SelectMany(x => x.OverShortDetailsEXes) .Where( x => x.ReceivedQty < x.InvoiceQty && string.IsNullOrEmpty(x.OversShortEX.OverShortSuggestedDocuments.ReferenceNumber) && string.IsNullOrEmpty(x.OversShortEX.OverShortSuggestedDocuments.CNumber)) .GroupBy(x => x.OversShortEX); } await AutoMatchAscyudaEntriesToShorts(lst).ConfigureAwait(false); }
public async Task SaveOverShortDetailsEX(OverShortDetailsEX i) { if (i == null) { return; } using (var ctx = new OverShortDetailsEXService()) { await ctx.UpdateOverShortDetailsEX(i).ConfigureAwait(false); } }
internal async Task MatchEntries(IEnumerable <OversShortEX> olst) { IEnumerable <IGrouping <OversShortEX, OverShortDetailsEX> > lst; if (!olst.Any()) { using (var ctx = new OverShortDetailsEXService()) { lst = (await ctx.GetOverShortDetailsByExpression("ReceivedQty < InvoiceQty", new List <string>() { "OverShort" }).ConfigureAwait(false)).GroupBy(x => x.OversShortEX); } } else { lst = olst.SelectMany(x => x.OverShortDetailsEXes) .Where(x => x.ReceivedQty < x.InvoiceQty) .GroupBy(x => x.OversShortEX); } await MatchAscyudaEntriesToShorts(lst).ConfigureAwait(false); }