public static TTable SelectSingle <TTable>(this BqlCommand command, PXGraph graph, bool isReadonly, IBqlTable[] currents, params object[] parameters) where TTable : IBqlTable { object data = command.CreateView(graph, mergeCache: !isReadonly).SelectSingleBound(currents, parameters); PXResult result = data as PXResult; return(result != null ? (TTable)result[typeof(TTable)] : (TTable)data); }
public virtual IEnumerable items() { SchedulesFilter filter = this.Filter.Current; if (filter != null) { PXSelectBase <DRScheduleDetail> select = new PXSelectJoin < DRScheduleDetail, InnerJoin <DRSchedule, On <DRSchedule.scheduleID, Equal <DRScheduleDetail.scheduleID> >, InnerJoin <DRDeferredCode, On <DRDeferredCode.deferredCodeID, Equal <DRScheduleDetail.defCode> > > >, Where < DRDeferredCode.accountType, Equal <Current <DRDraftScheduleProc.SchedulesFilter.accountType> >, And <DRScheduleDetail.status, Equal <DRScheduleStatus.DraftStatus>, And <DRSchedule.isCustom, Equal <True> > > >, OrderBy < Asc <DRScheduleDetail.scheduleID, Asc <DRScheduleDetail.componentID, Asc <DRScheduleDetail.detailLineNbr> > > > > (this); BqlCommand command = select.View.BqlSelect; if (!string.IsNullOrEmpty(filter.DeferredCode)) { command = command.WhereAnd <Where <DRScheduleDetail.defCode, Equal <Current <SchedulesFilter.deferredCode> > > >(); } if (filter.BranchID != null) { command = command.WhereAnd <Where <DRScheduleDetail.branchID, Equal <Current <SchedulesFilter.branchID> > > >(); } if (filter.AccountID != null) { command = command.WhereAnd <Where <DRScheduleDetail.defAcctID, Equal <Current <SchedulesFilter.accountID> > > >(); } if (filter.SubID != null) { command = command.WhereAnd <Where <DRScheduleDetail.defSubID, Equal <Current <SchedulesFilter.subID> > > >(); } if (filter.BAccountID != null) { command = command.WhereAnd <Where <DRScheduleDetail.bAccountID, Equal <Current <SchedulesFilter.bAccountID> > > >(); } if (filter.ComponentID != null) { command = command.WhereAnd <Where <DRScheduleDetail.componentID, Equal <Current <SchedulesFilter.componentID> > > >(); } return(command.CreateView(this, mergeCache: !select.View.IsReadOnly).SelectExternalWithPaging()); } else { return(null); } }
public static bool Any(this BqlCommand command, PXGraph graph, bool isReadonly, IBqlTable[] currents, params object[] parameters) { return(command.CreateView(graph, mergeCache: !isReadonly).SelectSingleBound(currents, parameters) != null); }
public static IEnumerable <TTable> Select <TTable>(this BqlCommand command, PXGraph graph, bool isReadonly, params object[] parameters) where TTable : IBqlTable { return(command.CreateView(graph, mergeCache: !isReadonly).SelectMulti(parameters).RowCast <TTable>()); }