예제 #1
0
        public static List <PXSearchColumn> GetContextualExternalSearchColumns(this PXView view, IEnumerable <PXSearchColumn> contextualSorts = null)
        {
            string[]         externalSortColumns = view.GetExternalSorts() ?? (new string[] { });
            bool[]           externalDescendings = view.GetExternalDescendings() ?? (new bool[] { });
            HashSet <string> existingSortColumns = new HashSet <string>(externalSortColumns);

            return(externalSortColumns
                   .Zip(externalDescendings, (sortColumn, descending) => new PXSearchColumn(sortColumn, descending, null))
                   .Concat((contextualSorts ?? SearchColumns).Where(searchColumn => !existingSortColumns.Contains(searchColumn.Column)))
                   .ToList());
        }
예제 #2
0
        private static IEnumerable SelectWithExternalParameters(PXView view, ref int startRow, ref int totalRows, object [] pars = null)
        {
            IEnumerable list = view.Select(
                PXView.Currents,
                pars ?? PXView.Parameters,
                PXView.Searches,
                view.GetExternalSorts(),
                view.GetExternalDescendings(),
                view.GetExternalFilters(),
                ref startRow,
                PXView.MaximumRows,
                ref totalRows);

            return(list);
        }