public List<MonthlyUserStatisticData> GetPageFromMonthlyStats(int pageNumber, int pageSize, int month, int year)
        {
            var filter = new BaseFilter() { CurrentPage = pageNumber, ItemsPerPage = pageSize };
            List<MonthlyUserStatisticData> items = GetItemsByFilterCM(filter, SortBy.Descending("score"), month, year);

            //DateTime previousPeriod = new DateTime(year, month, 1).AddDays(-1);

            return items;
        }
Esempio n. 2
0
 /// <summary>
 /// This is a shared function that can be used to get a DataTable to bound with a data bound control using a where clause.
 /// </summary>
 public static System.Data.DataTable GetDataTable(BaseFilter join, string where)
 {
     FieldTripChoicesRecord[] recs = GetRecords(join, where);
     return(FieldTripChoicesTable.Instance.CreateDataTable(recs, null));
 }
Esempio n. 3
0
        public static UsersRecord[] GetRecords(
        BaseFilter join,
		WhereClause where,
		OrderBy orderBy,
		int pageIndex,
		int pageSize,
		ref int totalRecords)
        {
            ArrayList recList = UsersTable.Instance.GetRecordList(join, where.GetFilter(), null, orderBy, pageIndex, pageSize, ref totalRecords);

            return (UsersRecord[])recList.ToArray(Type.GetType("FPCEstimate.Business.UsersRecord"));
        }
Esempio n. 4
0
        /// <summary>
        /// This is a shared function that can be used to get total number of records that will be returned using the where clause.
        /// </summary>
        public static int GetRecordCount(BaseFilter join, string where)
        {
            SqlFilter whereFilter = null;
            if (where != null && where.Trim() != "")
            {
               whereFilter = new SqlFilter(where);
            }

            return (int)UsersTable.Instance.GetRecordListCount(join, whereFilter, null, null);
        }
Esempio n. 5
0
 /// <summary>
 /// This is a shared function that can be used to get a DataTable to bound with a data bound control using a where clause.
 /// </summary>
 public static System.Data.DataTable GetDataTable(BaseFilter join, string where)
 {
     UsersRecord[] recs = GetRecords(join, where);
     return  UsersTable.Instance.CreateDataTable(recs, null);
 }
 /// <summary>
 /// This is a shared function that can be used to get a DataTable to bound with a data bound control using a where and order by clause.
 /// </summary>
 public static System.Data.DataTable GetDataTable(BaseFilter join, string where, OrderBy orderBy)
 {
     EstimateRecord[] recs = GetRecords(join, where, orderBy);
     return  EstimateTable.Instance.CreateDataTable(recs, null);
 }
Esempio n. 7
0
 public void GetByFilterShouldFilterEntitiesByName()
 {
     InitRepositoryParams(false);
     int total;
     var filter = new BaseFilter
     {
         Search = "Entity 10"
     };
     List<FakeEntity> list = repository.GetByFilter(filter, out total);
     Assert.IsNotNull(list, "Result is null");
     Assert.AreEqual(11, total, "Count is incorrect");
 }
Esempio n. 8
0
 public void GetByFilterShouldReturnEmptyListWhenNoEntitiesFound()
 {
     InitRepositoryParams(false);
     int total;
     BaseFilter filter = new BaseFilter
     {
         Page = 100,
         PageSize = 200
     };
     List<FakeEntity> list = repository.GetByFilter(filter, out total);
     Assert.IsNotNull(list, "Result is null");
     Assert.AreEqual(0, list.Count, "Result is not empty");
     Assert.AreEqual(150, total, "Total incorrect");
     Assert.AreEqual(100, filter.Page, "Page incorrect");
     Assert.AreEqual(200, filter.PageSize, "PageSize incorrect");
 }
 /// <summary>
 /// This is a shared function that can be used to get a DataTable to bound with a data bound control using a where clause.
 /// </summary>
 public static System.Data.DataTable GetDataTable(BaseFilter join, string where)
 {
     UserRolesLinkRecord[] recs = GetRecords(join, where);
     return(UserRolesLinkTable.Instance.CreateDataTable(recs, null));
 }
        /// <summary>
        /// This is a shared function that can be used to get a UserRolesLinkRecord record using a where clause.
        /// </summary>
        public static UserRolesLinkRecord GetRecord(BaseFilter join, string where)
        {
            OrderBy orderBy = null;

            return(GetRecord(join, where, orderBy));
        }
        public async Task <IActionResult> Criteria(string search,
                                                   int?systemId, int?branchId, bool?mine, int?programId, int page = 1)
        {
            PageTitle = "Drawing Criteria";

            var filter = new BaseFilter(page);

            if (!string.IsNullOrWhiteSpace(search))
            {
                filter.Search = search;
            }

            if (mine == true)
            {
                filter.UserIds = new List <int> {
                    GetId(ClaimType.UserId)
                };
            }
            else if (branchId.HasValue)
            {
                filter.BranchIds = new List <int> {
                    branchId.Value
                };
            }
            else if (systemId.HasValue)
            {
                filter.SystemIds = new List <int> {
                    systemId.Value
                };
            }

            if (programId.HasValue)
            {
                if (programId.Value > 0)
                {
                    filter.ProgramIds = new List <int?> {
                        programId.Value
                    };
                }
                else
                {
                    filter.ProgramIds = new List <int?> {
                        null
                    };
                }
            }

            var criterionList = await _drawingService.GetPaginatedCriterionListAsync(filter);

            PaginateViewModel paginateModel = new PaginateViewModel()
            {
                ItemCount    = criterionList.Count,
                CurrentPage  = page,
                ItemsPerPage = filter.Take.Value
            };

            if (paginateModel.PastMaxPage)
            {
                return(RedirectToRoute(
                           new
                {
                    page = paginateModel.LastPage ?? 1
                }));
            }

            var systemList = (await _siteService.GetSystemList())
                             .OrderByDescending(_ => _.Id == GetId(ClaimType.SystemId)).ThenBy(_ => _.Name);

            CriterionListViewModel viewModel = new CriterionListViewModel()
            {
                Criteria      = criterionList.Data,
                PaginateModel = paginateModel,
                Search        = search,
                SystemId      = systemId,
                BranchId      = branchId,
                ProgramId     = programId,
                Mine          = mine,
                SystemList    = systemList,
                ProgramList   = await _siteService.GetProgramList()
            };

            if (mine == true)
            {
                viewModel.BranchList = (await _siteService.GetBranches(GetId(ClaimType.SystemId)))
                                       .OrderByDescending(_ => _.Id == GetId(ClaimType.BranchId))
                                       .ThenBy(_ => _.Name);
                viewModel.ActiveNav = "Mine";
            }
            else if (branchId.HasValue)
            {
                var branch = await _siteService.GetBranchByIdAsync(branchId.Value);

                viewModel.BranchName = branch.Name;
                viewModel.SystemName = systemList
                                       .Where(_ => _.Id == branch.SystemId).SingleOrDefault().Name;
                viewModel.BranchList = (await _siteService.GetBranches(branch.SystemId))
                                       .OrderByDescending(_ => _.Id == GetId(ClaimType.BranchId))
                                       .ThenBy(_ => _.Name);
                viewModel.ActiveNav = "Branch";
            }
            else if (systemId.HasValue)
            {
                viewModel.SystemName = systemList
                                       .Where(_ => _.Id == systemId.Value).SingleOrDefault().Name;
                viewModel.BranchList = (await _siteService.GetBranches(systemId.Value))
                                       .OrderByDescending(_ => _.Id == GetId(ClaimType.BranchId))
                                       .ThenBy(_ => _.Name);
                viewModel.ActiveNav = "System";
            }
            else
            {
                viewModel.BranchList = (await _siteService.GetBranches(GetId(ClaimType.SystemId)))
                                       .OrderByDescending(_ => _.Id == GetId(ClaimType.BranchId))
                                       .ThenBy(_ => _.Name);
                viewModel.ActiveNav = "All";
            }
            if (programId.HasValue)
            {
                if (programId.Value > 0)
                {
                    viewModel.ProgramName =
                        (await _siteService.GetProgramByIdAsync(programId.Value)).Name;
                }
                else
                {
                    viewModel.ProgramName = "Not Limited";
                }
            }

            return(View(viewModel));
        }
Esempio n. 12
0
        public async Task <ActionResult> Index(int page = 1, int booksPerPage = 20)
        {
            BaseFilter <Book> filter = new BaseFilter <Book>(page, booksPerPage);

            return(Ok(new { books = await booksService.FindAll(filter) }));
        }
 private IQueryable <Model.Questionnaire> ApplyFilters(BaseFilter filter)
 {
     return(DbSet
            .AsNoTracking()
            .Where(_ => !_.IsDeleted && _.SiteId == filter.SiteId));
 }
Esempio n. 14
0
 private void FilterSettingsCtrl_OnUpdate(BaseFilter filter, PropertyCtrlViewModel viewModel)
 {
     Console.WriteLine(filter.GetPropertyStr());
     filter.Invalidate(true);
     ShowGraphFilterResult(ImgSourceID);
 }
Esempio n. 15
0
        public MainViewModel()
        {
            ProgressBarValue = 0;
            ProgressBarInfo  = "";


            FileManager.OnChange += FileMng_OnChange;

            foreach (var filterName in GraphFilter.GetFilterNames())
            {
                FilterToAdd.Add(new ComboBoxItem()
                {
                    Content = filterName
                });
            }
            SelectAddFilter = FilterToAdd[0];

            var bitmap = new Bitmap(@"Res\default.png");

            SetImageSource(bitmap, "default.png");

            LoadFilter = graphFilter.Add(FilterType.File, "MainFile");
            FilterSequence.Add(LoadFilter);

            bitmap.Dispose();


            ExportButton = new SyncButtonViewModel()
            {
                Text     = "Export",
                Enabled  = true,
                PressCmd = async(SyncButtonViewModel button) =>
                {
                    if (!m_exportInProgress)
                    {
                        button.Enabled = false;
                        ExportDlgView  dlg      = new ExportDlgView();
                        ExportDlgModel dlgModel = new ExportDlgModel(dlg, "export_settigs.xml");
                        dlg.DataContext = dlgModel;
                        var res = dlg.ShowDialog();

                        button.Enabled = true;

                        if (res == true)
                        {
                            m_exportInProgress = true;
                            button.Text        = "Cancel";

                            ExportSettings exportSettings = dlgModel.Result;


                            await Task.Run(() =>
                            {
                                int totalCnt = FileManager.FileListInfo.Count;
                                for (int infoId = 0; m_exportInProgress && (infoId < totalCnt); infoId++)
                                {
                                    string infoStr = FileManager.FileListInfo[infoId].Info;

                                    App.Current.Dispatcher.Invoke(() =>
                                    {
                                        ProgressBarValue = (100 * infoId) / totalCnt;
                                        ProgressBarInfo  = infoStr;
                                    });

                                    ExportGraphFilterResult(infoId, infoStr, exportSettings);
                                }
                            });

                            ProgressBarValue   = 0;
                            m_exportInProgress = false;
                            button.Text        = "Export";
                        }
                    }
                    else
                    {
                        m_exportInProgress = false;
                        ProgressBarValue   = 0;
                    }
                }
            };
        }
 /// <summary>
 /// This is a shared function that can be used to get a ReportEstimateRecord record using a where clause.
 /// </summary>
 public static ReportEstimateRecord GetRecord(BaseFilter join, string where)
 {
     OrderBy orderBy = null;
     return GetRecord(join, where, orderBy);
 }
Esempio n. 17
0
 public void GetByFilterShouldHaveCorrectOffsetWhenPageIsSpecified()
 {
     InitRepositoryParams(true);
     int total;
     BaseFilter filter = new BaseFilter
     {
         PageSize = 20,
         Page = 2
     };
     List<FakeEntity> list = repository.GetByFilter(filter, out total);
     Assert.IsNotNull(list, "Result is null");
     Assert.AreEqual(21, list.Min(d => d.Id), "Minimal ID is wrong");
     Assert.AreEqual(2, filter.Page, "Page incorrect");
     Assert.AreEqual(20, filter.PageSize, "PageSize incorrect");
 }
Esempio n. 18
0
 /// <summary>
 /// This is a shared function that can be used to get a PhotoClubsRecord record using a where clause.
 /// </summary>
 public static PhotoClubsRecord GetRecord(BaseFilter join, string where)
 {
     OrderBy orderBy = null;
     return GetRecord(join, where, orderBy);
 }
Esempio n. 19
0
 public void GetByFilterShouldUseDefaultIfPageSizeIfItIsIncorrect()
 {
     ISelpConfiguration configuration = new InMemoryConfiguration();
     configuration.DefaultPageSize = 11;
     InitRepositoryParams(true, configuration);
     int total;
     var filter = new BaseFilter
     {
         PageSize = -55
     };
     List<FakeEntity> list = repository.GetByFilter(filter, out total);
     Assert.IsNotNull(list, "Result is null");
     Assert.AreEqual(11, list.Count, "Result count is wrong");
     Assert.AreEqual(11, filter.PageSize, "Filter hasn't been normalized");
     Assert.AreEqual(100, total, "Total is incorrect");
     Assert.AreEqual(11, filter.PageSize, "Returned PageSize incorrect");
 }
Esempio n. 20
0
 /// <summary>
 /// This is a shared function that can be used to get a DataTable to bound with a data bound control using a where clause.
 /// </summary>
 public static System.Data.DataTable GetDataTable(BaseFilter join, string where)
 {
     PhotoClubsRecord[] recs = GetRecords(join, where);
     return  PhotoClubsTable.Instance.CreateDataTable(recs, null);
 }
Esempio n. 21
0
 public DataForExport(BaseTable tbl, WhereClause wc, OrderBy orderBy, BaseColumn[] columns, BaseFilter join)
 {
     this.DBTable = tbl;
     this.SelectWhereClause = wc;
     this.SelectOrderBy = orderBy;
     this.SelectJoin = join;
     if (columns != null)
         ColumnList.AddRange(columns);
 }
Esempio n. 22
0
 GetPaginatedListAsync(BaseFilter filter)
 {
     VerifyManagementPermission();
     filter.SiteId = GetCurrentSiteId();
     return(await _authorizationCodeRepository.PageAsync(filter));
 }
        public static EstimateRecord[] GetRecords(
        BaseFilter join,
		WhereClause where,
		OrderBy orderBy,
		int pageIndex,
		int pageSize)
        {
            ArrayList recList = EstimateTable.Instance.GetRecordList(join, where.GetFilter(), null, orderBy, pageIndex, pageSize);

            return (EstimateRecord[])recList.ToArray(Type.GetType("FPCEstimate.Business.EstimateRecord"));
        }
Esempio n. 24
0
 public Task <IEnumerable <User> > GetSome(BaseFilter filter) => throw new NotImplementedException();
Esempio n. 25
0
 /// <summary>
 /// This is a shared function that can be used to get a UsersRecord record using a where clause.
 /// </summary>
 public static UsersRecord GetRecord(BaseFilter join, string where)
 {
     OrderBy orderBy = null;
     return GetRecord(join, where, orderBy);
 }
Esempio n. 26
0
 public IList <CountryResult> Search(BaseFilter filter)
 {
     return(_countryRepository.Search(filter));
 }
Esempio n. 27
0
 /// <summary>
 /// This is a shared function that can be used to get an array of UsersRecord records using a where and order by clause.
 /// </summary>
 public static UsersRecord[] GetRecords(BaseFilter join, string where, OrderBy orderBy)
 {
     return GetRecords(join, where, orderBy, BaseTable.MIN_PAGE_NUMBER, BaseTable.MAX_BATCH_SIZE);
 }
Esempio n. 28
0
 /// <summary>
 /// This is a shared function that can be used to get an array of SexRecord records using a where clause.
 /// </summary>
 public static SexRecord[] GetRecords(BaseFilter join, string where)
 {
     return(GetRecords(join, where, null, BaseTable.MIN_PAGE_NUMBER, BaseTable.MAX_BATCH_SIZE));
 }
Esempio n. 29
0
        public static String[] GetValues(
		BaseColumn col,
		BaseFilter join,
		WhereClause where,
		OrderBy orderBy,
		int maxItems)
        {
            // Create the filter list.
            SqlBuilderColumnSelection retCol = new SqlBuilderColumnSelection(false, true);
            retCol.AddColumn(col);

            return UsersTable.Instance.GetColumnValues(retCol, join, where.GetFilter(), null, orderBy, BaseTable.MIN_PAGE_NUMBER, maxItems);
        }
Esempio n. 30
0
 /// <summary>
 /// This is a shared function that can be used to get a DataTable to bound with a data bound control using a where and order by clause.
 /// </summary>
 public static System.Data.DataTable GetDataTable(BaseFilter join, string where, OrderBy orderBy)
 {
     SexRecord[] recs = GetRecords(join, where, orderBy);
     return(SexTable.Instance.CreateDataTable(recs, null));
 }
 /// <summary>
 /// This is a shared function that can be used to get a DataTable to bound with a data bound control using a where clause.
 /// </summary>
 public static System.Data.DataTable GetDataTable(BaseFilter join, string where)
 {
     ReportEstimateRecord[] recs = GetRecords(join, where);
     return  ReportEstimateTable.Instance.CreateDataTable(recs, null);
 }
Esempio n. 32
0
        public async Task <IActionResult> GetListWithPager(BaseFilter filters)
        {
            var result = await _messageService.SearchAsync(filters);

            return(Json(result));
        }
Esempio n. 33
0
        public void GetByFilterShouldHaveCorrectCountWhenPageSizeIsSpecified()
        {
            InitRepositoryParams(true);
            int total;
            BaseFilter filter = new BaseFilter
            {
                PageSize = 20
            };
            List<FakeEntity> list = repository.GetByFilter(filter, out total);

            Assert.IsNotNull(list, "Result is null");
            Assert.AreEqual(20, list.Count, "Result count is wrong");
            Assert.AreEqual(100, total, "Result total is wrong");
            Assert.AreEqual(20, filter.PageSize, "PageSize incorrect");
        }
Esempio n. 34
0
 /// <summary>
 /// This is a shared function that can be used to get an array of ContactsRecord records using a where and order by clause.
 /// </summary>
 public static ContactsRecord[] GetRecords(BaseFilter join, string where, OrderBy orderBy)
 {
     return(GetRecords(join, where, orderBy, BaseTable.MIN_PAGE_NUMBER, BaseTable.MAX_BATCH_SIZE));
 }
Esempio n. 35
0
 public void GetByFilterShouldHaveCorrectOrderWhenItIsSpecifiedDescending()
 {
     InitRepositoryParams(true);
     int total;
     BaseFilter filter = new BaseFilter
     {
         PageSize = 20,
         Page = 3,
         SortDirection = ListSortDirection.Descending,
         SortField = "Id"
     };
     List<FakeEntity> list = repository.GetByFilter(filter, out total);
     Assert.IsNotNull(list, "Result is null");
     Assert.AreEqual(60, list[0].Id, "First item id is wrong");
     Assert.AreEqual(3, filter.Page, "Page incorrect");
     Assert.AreEqual(20, filter.PageSize, "PageSize incorrect");
 }
Esempio n. 36
0
 /// <summary>
 /// This is a shared function that can be used to get total number of records that will be returned using the where clause.
 /// </summary>
 public static int PostGetRecordCount(SqlBuilderColumnSelection selectCols, BaseFilter join, BaseFilter finalFilter)
 {
     return((int)ContactsTable.Instance.GetCountResponseForPost(ContactsTable.Instance.TableDefinition, selectCols, join, finalFilter));
 }
Esempio n. 37
0
 public void GetByFilterShouldThrowIfSortFieldNotFound()
 {
     InitRepositoryParams(true);
     int total;
     BaseFilter filter = new BaseFilter
     {
         SortDirection = ListSortDirection.Descending,
         SortField = "dsadsadsada"
     };
     List<FakeEntity> list = repository.GetByFilter(filter, out total);
 }
Esempio n. 38
0
 public static int GetRecordCount(BaseFilter join, WhereClause where)
 {
     return((int)ContactsTable.Instance.GetRecordListCount(join, where.GetFilter(), null, null));
 }
Esempio n. 39
0
 public void GetByFilterShouldUseFirstPageIfItIsIncorrect()
 {
     InitRepositoryParams(true);
     int total;
     var filter = new BaseFilter
     {
         Page = -5,
         PageSize = 20
     };
     List<FakeEntity> list = repository.GetByFilter(filter, out total);
     Assert.IsNotNull(list, "Result is null");
     Assert.AreEqual(1, list.Min(d => d.Id), "Minimal ID is incorrect");
     Assert.AreEqual(1, filter.Page, "Filter hasn't been normalized");
     Assert.AreEqual(20, filter.PageSize, "Returned PageSize incorrect");
 }
Esempio n. 40
0
        /// <summary>
        /// This is a shared function that can be used to get a ContactsRecord record using a where clause.
        /// </summary>
        public static ContactsRecord GetRecord(BaseFilter join, string where)
        {
            OrderBy orderBy = null;

            return(GetRecord(join, where, orderBy));
        }
Esempio n. 41
0
 public void GetByFilterShouldFilterEntitiesByNameNotIncludedDeleted()
 {
     InitRepositoryParams(true);
     int total;
     var filter = new BaseFilter
     {
         Search = "125"
     };
     List<FakeEntity> list = repository.GetByFilter(filter, out total);
     Assert.IsNotNull(list, "Result is null");
     Assert.AreEqual(0, total, "Count is incorrect");
 }
Esempio n. 42
0
 /// <summary>
 /// This is a shared function that can be used to get a DataTable to bound with a data bound control using a where clause.
 /// </summary>
 public static System.Data.DataTable GetDataTable(BaseFilter join, string where)
 {
     ContactsRecord[] recs = GetRecords(join, where);
     return(ContactsTable.Instance.CreateDataTable(recs, null));
 }
Esempio n. 43
0
 /// <summary>
 /// This is a shared function that can be used to get a DataTable to bound with a data bound control using a where clause.
 /// </summary>
 public static System.Data.DataTable GetDataTable(BaseFilter join, string where)
 {
     VwBldgRecord[] recs = GetRecords(join, where);
     return  VwBldgView.Instance.CreateDataTable(recs, null);
 }
Esempio n. 44
0
 /// <summary>
 /// This is a shared function that can be used to get a DataTable to bound with a data bound control using a where and order by clause with pagination.
 /// </summary>
 public static System.Data.DataTable GetDataTable(BaseFilter join, string where, OrderBy orderBy, int pageIndex, int pageSize)
 {
     ContactsRecord[] recs = GetRecords(join, where, orderBy, pageIndex, pageSize);
     return(ContactsTable.Instance.CreateDataTable(recs, null));
 }
 /// <summary>
 /// This is a shared function that can be used to get an array of EstimateRecord records using a where clause.
 /// </summary>
 public static EstimateRecord[] GetRecords(BaseFilter join, string where)
 {
     return GetRecords(join, where, null, BaseTable.MIN_PAGE_NUMBER, BaseTable.MAX_BATCH_SIZE);
 }
Esempio n. 46
0
 /// <summary>
 /// Executes specified filter on an image (without using parallel processor). As destination image size may be different from source in-place filtering is not allowed.
 /// </summary>
 /// <param name="img">Image.</param>
 /// <param name="filter">AForge <see cref="BaseFilter"/>.</param>
 public static Image <TColor, TDepth> ApplyFilter <TColor, TDepth>(this Image <TColor, TDepth> img, BaseFilter filter)
     where TColor : IColor
     where TDepth : struct
 {
     return(ApplyFilter <TColor, TDepth, BaseFilter>(img, filter, false));
 }
Esempio n. 47
0
 public DumpInputPin(string _name, BaseFilter _filter)
     :base(_name,_filter)
 {
 }
Esempio n. 48
0
 /// <summary>
 /// 返回存贮过程名
 /// </summary>
 /// <param name="baseFilter"></param>
 /// <returns></returns>
 protected override string GetSearchSpName(BaseFilter baseFilter)
 {
     return("proc_FinanceManage_GetTable3ByDWJM");
 }
Esempio n. 49
0
 /// <summary>
 /// This is a shared function that can be used to get a DataTable to bound with a data bound control using a where and order by clause with pagination.
 /// </summary>
 public static System.Data.DataTable GetDataTable(BaseFilter join, string where, OrderBy orderBy, int pageIndex, int pageSize)
 {
     UsersRecord[] recs = GetRecords(join, where, orderBy, pageIndex, pageSize);
     return  UsersTable.Instance.CreateDataTable(recs, null);
 }
Esempio n. 50
0
        /// <inheritdoc />
        public async Task <PaginationResult <PatientForViewDto> > GetPatientsByFilterAsync(BaseFilter filter)
        {
            PaginationResult <Patient> domainResult = await _patientRepository.GetPaginationByBaseFilterAsync(filter);

            return(new PaginationResult <PatientForViewDto>()
            {
                CurrentPage = domainResult.CurrentPage,
                Items = Mapper.Map <List <PatientForViewDto> >(domainResult.Items),
                TotalPages = domainResult.TotalPages,
                TotalRecords = domainResult.TotalRecords
            });
        }
Esempio n. 51
0
        /// <summary>
        /// This is a shared function that can be used to get a UsersRecord record using a where and order by clause.
        /// </summary>
        public static UsersRecord GetRecord(BaseFilter join, string where, OrderBy orderBy)
        {
            SqlFilter whereFilter = null;
            if (where != null && where.Trim() != "")
            {
               whereFilter = new SqlFilter(where);
            }

            ArrayList recList = UsersTable.Instance.GetRecordList(join, whereFilter, null, orderBy, BaseTable.MIN_PAGE_NUMBER, BaseTable.MIN_BATCH_SIZE);

            UsersRecord rec = null;
            if (recList.Count > 0)
            {
            rec = (UsersRecord)recList[0];
            }

            return rec;
        }
Esempio n. 52
0
 public async Task <IList <FarmTypeResult> > SearchAsync(BaseFilter filter)
 {
     return(await _farmTypeRepository.SearchAsync(filter));
 }
Esempio n. 53
0
 public static int GetRecordCount(BaseFilter join, WhereClause where)
 {
     return (int)UsersTable.Instance.GetRecordListCount(join, where.GetFilter(), null, null);
 }
 private IQueryable <Model.VendorCodeType> ApplyFilters(BaseFilter filter)
 {
     return(DbSet
            .AsNoTracking()
            .Where(_ => _.SiteId == filter.SiteId));
 }
Esempio n. 55
0
        /// <summary>
        /// This is a shared function that can be used to get an array of UsersRecord records using a where and order by clause clause with pagination.
        /// </summary>
        public static UsersRecord[] GetRecords(BaseFilter join, string where, OrderBy orderBy, int pageIndex, int pageSize)
        {
            SqlFilter whereFilter = null;
            if (where != null && where.Trim() != "")
            {
               whereFilter = new SqlFilter(where);
            }

            ArrayList recList = UsersTable.Instance.GetRecordList(join, whereFilter, null, orderBy, pageIndex, pageSize);

            return (UsersRecord[])recList.ToArray(Type.GetType("FPCEstimate.Business.UsersRecord"));
        }
Esempio n. 56
0
 public async Task <int> GetCountAsync(BaseFilter filter)
 {
     return(await ApplyFilters(filter)
            .CountAsync());
 }
Esempio n. 57
0
        public static string GetSum(
		BaseColumn col,
		BaseFilter join, 
		WhereClause where,
		OrderBy orderBy,
		int pageIndex,
		int pageSize)
        {
            SqlBuilderColumnSelection colSel = new SqlBuilderColumnSelection(false, false);
            colSel.AddColumn(col, SqlBuilderColumnOperation.OperationType.Sum);

            return UsersTable.Instance.GetColumnStatistics(colSel, join, where.GetFilter(), null, orderBy, pageIndex, pageSize);
        }
 public async Task <DataWithCount <ICollection <TriggerRequirement> > > PageRequirementAsync(BaseFilter filter)
 {
     filter.SiteId = GetCurrentSiteId();
     return(new DataWithCount <ICollection <TriggerRequirement> >()
     {
         Data = await _triggerRepository.PageRequirementsAsync(filter),
         Count = await _triggerRepository.CountRequirementsAsync(filter)
     });
 }
    public DotNetStreamOutputPin(string name, BaseFilter filter, Stream sourceStream)
      : base(name, filter, filter.FilterLock, PinDirection.Output)
    {
      if (sourceStream == null)
        throw new ArgumentException("Parameter cannot be null!", "sourceStream");

      _sourceStream = sourceStream;
    }
Esempio n. 60
0
 public Task <IEnumerable <HouseholdExpense> > GetSome(BaseFilter filter) => Query(HouseholdExpenseResources.Some, filter);