protected override async Task OnInitializedAsync() { UnturnedItem = await HttpClient.GetFromJsonAsync <UnturnedItem>($"api/unturneditems/{ItemId}"); UnturnedItem.MarketItems.ToList().ForEach(x => x.Item = UnturnedItem); FiltersData = new FiltersData <MarketItem>(UnturnedItem.MarketItems, 10, false); }
protected override async Task OnInitializedAsync() { BuyerItems = await HttpClient.GetFromJsonAsync <IEnumerable <MarketItem> >("api/marketitems/buyer"); SellerItems = await HttpClient.GetFromJsonAsync <IEnumerable <MarketItem> >("api/marketitems/seller"); BuyerData = new FiltersData <MarketItem>(BuyerItems.ToList(), 10, true, new ShowOnlyClaimedFilter()); SellerData = new FiltersData <MarketItem>(SellerItems.ToList(), 10, true, new ShowOnlyNotSoldFilter()); }
public static string GetFiltersData() { var jss = new JavaScriptSerializer(); var fc = new FilterCollection(); AddRangeSafe(fc, AdHocContext.CurrentReportSet.Filters); var filtersData = new FiltersData(); filtersData.Initialize(fc, AdHocContext.CurrentReportSet); return(jss.Serialize(filtersData)); }
protected override async Task OnInitializedAsync() { MarketItems = (await HttpClient.GetFromJsonAsync <List <MarketItem> >("api/marketitems")).ToList(); FiltersData = new FiltersData <MarketItem>(MarketItems, 10, true, new LatestOrderFilter(), new PriceOrderFilter()); }
protected override async Task OnInitializedAsync() { Items = await HttpClient.GetFromJsonAsync <List <UnturnedItem> >("api/unturneditems"); Data = new FiltersData <UnturnedItem>(Items, 20, true, new ShowOnlyOffersFilter(), new QuantityOrderFilter(), new ItemIdOrderFilter()); }
public static string GetActiveAdditionalFilters(List <string> wsArgs) { var reportName = wsArgs[0]; var reportSet = AdHocSettings.AdHocConfig.LoadFilteredReportSet(Utility.ReportWebNameToNormal(reportName)); var isDrillDown = false; string masterName = null; string ddValue = null; if (wsArgs != null) { if (wsArgs.Count > 2) { isDrillDown = true; masterName = wsArgs[1]; ddValue = wsArgs[2]; // not used yet, but reserved for future } } var jss = new JavaScriptSerializer(); var fc = new FilterCollection(); if (reportSet != null && reportSet.Filters.Count > 0) { AddRangeSafe(fc, reportSet.Filters); } // get stored additional filters var ownFilters = AdditionalFiltersStorage.GetAdditionalFiltersFromSession(reportName); AddRangeSafe(fc, ownFilters); // process drilldown data if (reportSet != null && isDrillDown) { var masterFilters = AdditionalFiltersStorage.GetAdditionalFiltersAllFromSession(masterName); foreach (Filter filter in masterFilters) { foreach (JoinedTable joinedTable in reportSet.JoinedTables) { var tableName = joinedTable.TableName; if (filter.dbColumn.Table.FullName == tableName) { AddFilterSafe(fc, filter); } // check linked columns if (!string.IsNullOrEmpty(filter.LinkedColumns)) { var linkedColumns = filter.LinkedColumns.Split(','); foreach (var linkedColumn in linkedColumns) { if (linkedColumn.IndexOf('.') >= 0) { var linkedColumnTable = linkedColumn.Substring(0, linkedColumn.LastIndexOf('.')); if (linkedColumnTable == tableName) { var newFilter = (Filter)filter.Clone(); newFilter.Column = linkedColumn; AddFilterSafe(fc, newFilter); } } } } } } if (ddValue != null && reportSet.DrillDownKey != null) { var ddKey = reportSet.DrillDownKey; var ddFilter = new AdditionalFilter { Operator = OperatorTypes.Equals, Value = ddValue, Column = ddKey }; AddFilterSafe(fc, ddFilter); } } foreach (Filter f in fc) { f.Parameter = true; } var filtersData = new FiltersData(); if (reportSet != null) { filtersData.Initialize(fc, reportSet); } return(jss.Serialize(filtersData)); }
protected override async Task OnInitializedAsync() { Transactions = await HttpClient.GetFromJsonAsync <IEnumerable <ProductTransaction> >("api/products/transactions"); FiltersData = new FiltersData <ProductTransaction>(Transactions.ToList(), 15, true, new ShowOnlyCompleteTransactionFilter()); }