protected virtual IEnumerable GetRecords() { PXCache cache = _Graph.Caches[_CacheType]; object extCurrentRow = PXView.Currents.FirstOrDefault(c => _CacheType.IsAssignableFrom(c.GetType())); FABookPeriod.Key periodKey = ReportParametersMask != ReportParametersFlag.None ? BookPeriodKeyProvider.GetKeyFromReportParameters(_Graph, PXView.Parameters, ReportParametersMask) : BookPeriodKeyProvider.GetKey(_Graph, cache, extCurrentRow); int startRow = PXView.StartRow; int totalRows = 0; List <object> parameters = new List <object>(); BqlCommand cmd = GetCommand(cache, extCurrentRow, parameters, periodKey); PXView view = new PXView(_Graph, PXView.View?.IsReadOnly ?? true, cmd); try { return(view.Select(PXView.Currents, parameters.ToArray(), PXView.Searches, PXView.SortColumns, PXView.Descendings, PXView.Filters, ref startRow, PXView.MaximumRows, ref totalRows)); } finally { PXView.StartRow = 0; } }
protected virtual BqlCommand GetCommand(PXCache cache, object extRow, List <object> parameters, FABookPeriod.Key periodKey) { BqlCommand cmd = BqlCommand.CreateInstance(OrigSearchType); cmd = cmd.WhereAnd <Where <FABookPeriod.organizationID, Equal <Required <FABookPeriod.organizationID> >, And <FABookPeriod.bookID, Equal <Required <FABookPeriod.bookID> > > > >(); parameters.Add(periodKey.OrganizationID); parameters.Add(periodKey.BookID); return(cmd); }