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; }
/// <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)); }
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")); }
/// <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); }
/// <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); }
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"); }
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)); }
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)); }
private void FilterSettingsCtrl_OnUpdate(BaseFilter filter, PropertyCtrlViewModel viewModel) { Console.WriteLine(filter.GetPropertyStr()); filter.Invalidate(true); ShowGraphFilterResult(ImgSourceID); }
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); }
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"); }
/// <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); }
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"); }
/// <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); }
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); }
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")); }
public Task <IEnumerable <User> > GetSome(BaseFilter filter) => throw new NotImplementedException();
/// <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); }
public IList <CountryResult> Search(BaseFilter filter) { return(_countryRepository.Search(filter)); }
/// <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); }
/// <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)); }
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); }
/// <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); }
public async Task <IActionResult> GetListWithPager(BaseFilter filters) { var result = await _messageService.SearchAsync(filters); return(Json(result)); }
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"); }
/// <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)); }
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"); }
/// <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)); }
public void GetByFilterShouldThrowIfSortFieldNotFound() { InitRepositoryParams(true); int total; BaseFilter filter = new BaseFilter { SortDirection = ListSortDirection.Descending, SortField = "dsadsadsada" }; List<FakeEntity> list = repository.GetByFilter(filter, out total); }
public static int GetRecordCount(BaseFilter join, WhereClause where) { return((int)ContactsTable.Instance.GetRecordListCount(join, where.GetFilter(), null, null)); }
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"); }
/// <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)); }
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"); }
/// <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)); }
/// <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); }
/// <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); }
/// <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)); }
public DumpInputPin(string _name, BaseFilter _filter) :base(_name,_filter) { }
/// <summary> /// 返回存贮过程名 /// </summary> /// <param name="baseFilter"></param> /// <returns></returns> protected override string GetSearchSpName(BaseFilter baseFilter) { return("proc_FinanceManage_GetTable3ByDWJM"); }
/// <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); }
/// <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 }); }
/// <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; }
public async Task <IList <FarmTypeResult> > SearchAsync(BaseFilter filter) { return(await _farmTypeRepository.SearchAsync(filter)); }
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)); }
/// <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")); }
public async Task <int> GetCountAsync(BaseFilter filter) { return(await ApplyFilters(filter) .CountAsync()); }
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; }
public Task <IEnumerable <HouseholdExpense> > GetSome(BaseFilter filter) => Query(HouseholdExpenseResources.Some, filter);