private void DeleteAnswers(string attributeId) { foreach (var answer in Answers.SelectMain().Where(a => a.AttributeID == attributeId)) { Answers.Cache.Delete(answer); } }
public static IEnumerable <APPayment> GetGeneratedPayments(PXGraph graph, string invoiceReferenceNumber) { var query = new PXSelectJoin <APPayment, InnerJoin <APAdjust, On <APAdjust.adjgRefNbr, Equal <APPayment.refNbr>, And <APAdjust.adjgDocType, Equal <APPayment.docType> > >, InnerJoin <APInvoice, On <APAdjust.adjdRefNbr, Equal <APInvoice.refNbr>, And <APAdjust.adjdDocType, Equal <APInvoice.docType> > > > >, Where <APInvoice.refNbr, Equal <Required <APInvoice.refNbr> > > >(graph); return(query.SelectMain(invoiceReferenceNumber)); }
protected virtual List <AdjustmentStubGroup> AddPOAdjustments(IEnumerable <AdjustmentStubGroup> adjustmentStubs) { var poadjustments = POAdjustments.SelectMain(); var result = adjustmentStubs.Where(r => !poadjustments.Any( p => p.AdjdDocType == r.GroupedStubs.Key.AdjdDocType && p.AdjdRefNbr == r.GroupedStubs.Key.AdjdRefNbr)) .Union( poadjustments.GroupBy(adj => new AdjustmentGroupKey { Source = AdjustmentGroupKey.AdjustmentType.POAdjustment, AdjdDocType = adj.AdjdOrderType, AdjdRefNbr = adj.AdjdOrderNbr, AdjdCuryInfoID = adj.AdjdCuryInfoID }, adj => (IAdjustmentStub)adj).Select(g => new AdjustmentStubGroup() { GroupedStubs = g })).ToList(); return(result); }