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;
        }
예제 #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));
 }
예제 #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"));
        }
예제 #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);
        }
예제 #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);
 }
예제 #6
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)
 {
     EstimateRecord[] recs = GetRecords(join, where, orderBy);
     return  EstimateTable.Instance.CreateDataTable(recs, null);
 }
예제 #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");
 }
예제 #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");
 }
예제 #9
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)
 {
     UserRolesLinkRecord[] recs = GetRecords(join, where);
     return(UserRolesLinkTable.Instance.CreateDataTable(recs, null));
 }
예제 #10
0
        /// <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));
        }
예제 #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));
 }
예제 #14
0
 private void FilterSettingsCtrl_OnUpdate(BaseFilter filter, PropertyCtrlViewModel viewModel)
 {
     Console.WriteLine(filter.GetPropertyStr());
     filter.Invalidate(true);
     ShowGraphFilterResult(ImgSourceID);
 }
예제 #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);
 }
예제 #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");
 }
예제 #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);
 }
예제 #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");
 }
예제 #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);
 }
예제 #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);
 }
예제 #22
0
 GetPaginatedListAsync(BaseFilter filter)
 {
     VerifyManagementPermission();
     filter.SiteId = GetCurrentSiteId();
     return(await _authorizationCodeRepository.PageAsync(filter));
 }
예제 #23
0
        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"));
        }
예제 #24
0
 public Task <IEnumerable <User> > GetSome(BaseFilter filter) => throw new NotImplementedException();
예제 #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);
 }
예제 #26
0
 public IList <CountryResult> Search(BaseFilter filter)
 {
     return(_countryRepository.Search(filter));
 }
예제 #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);
 }
예제 #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));
 }
예제 #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);
        }
예제 #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);
 }
예제 #32
0
        public async Task <IActionResult> GetListWithPager(BaseFilter filters)
        {
            var result = await _messageService.SearchAsync(filters);

            return(Json(result));
        }
예제 #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");
        }
예제 #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));
 }
예제 #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");
 }
예제 #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));
 }
예제 #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);
 }
예제 #38
0
 public static int GetRecordCount(BaseFilter join, WhereClause where)
 {
     return((int)ContactsTable.Instance.GetRecordListCount(join, where.GetFilter(), null, null));
 }
예제 #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");
 }
예제 #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));
        }
예제 #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");
 }
예제 #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));
 }
예제 #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);
 }
예제 #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));
 }
예제 #45
0
 /// <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);
 }
예제 #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));
 }
예제 #47
0
 public DumpInputPin(string _name, BaseFilter _filter)
     :base(_name,_filter)
 {
 }
예제 #48
0
 /// <summary>
 /// 返回存贮过程名
 /// </summary>
 /// <param name="baseFilter"></param>
 /// <returns></returns>
 protected override string GetSearchSpName(BaseFilter baseFilter)
 {
     return("proc_FinanceManage_GetTable3ByDWJM");
 }
예제 #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);
 }
예제 #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
            });
        }
예제 #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;
        }
예제 #52
0
 public async Task <IList <FarmTypeResult> > SearchAsync(BaseFilter filter)
 {
     return(await _farmTypeRepository.SearchAsync(filter));
 }
예제 #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));
 }
예제 #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"));
        }
예제 #56
0
 public async Task <int> GetCountAsync(BaseFilter filter)
 {
     return(await ApplyFilters(filter)
            .CountAsync());
 }
예제 #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)
     });
 }
예제 #59
0
    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;
    }
예제 #60
0
 public Task <IEnumerable <HouseholdExpense> > GetSome(BaseFilter filter) => Query(HouseholdExpenseResources.Some, filter);