public PagedResult <TransactionsRow> Get([FromQuery] TransactionsArgs args) { var sql = GetSQL(args); var transactions = PageExtensions.FetchPagedResult <TransactionsRow>(_db, args.Page, args.PageSize, sql, args); return(transactions); }
public PagedResult <TransactionsEligibleForRefundApprovalRow> Get([FromQuery] TransactionsEligibleForRefundApprovalArgs args) { var sql = GetSQL(args); var transactions = PageExtensions.FetchPagedResult <TransactionsEligibleForRefundApprovalRow>(_db, args.Page, args.PageSize, sql, args); return(transactions); }
public NewsListViewModel GetNewsListViewModel(int?page, int?pagesize, string category = null) { int pageIndex = 0; if (page > 0) { pageIndex = page.Value - 1; } var pageSize = pagesize.GetValueOrDefault(10); var pinnedNews = GetAllPinnedNewsByCategory(category); var newsCount = _newsService.GetTotalNewsCount(category); var records = GetManyNewsItemViewModel(category, pageIndex * pageSize, pagesize.GetValueOrDefault(5)); var list = new PagedList <NewsItemViewModel>(records, pageIndex, pageSize, newsCount); var model = new NewsListViewModel { CategoryId = category, News = list, PinnedNews = pinnedNews, PagerModel = new PagerViewModel { PageSize = list.PageSize, TotalRecords = list.TotalCount, PageIndex = list.PageIndex, RouteValues = new RouteValues { page = pageIndex, category = category }, } }; PageExtensions.Pager(model.PagerModel); return(model); }
private async void OnCountrySelect(object sender, ItemTappedEventArgs e) { Country selectedCountry = (Country)e.Item; countryListView.SelectedItem = null; if (PageExtensions.IsModal(this)) { MyProfilePage parentPage = (MyProfilePage)modalParentPage; parentPage.OnNationalitySelected(selectedCountry.IsoCode); await Navigation.PopModalAsync(); } else { var realm = Realm.GetInstance(); User user = realm.Find<User>(DBLocalID.USER_TEMP_SIGN_UP); realm.Write(() => { user.country = selectedCountry.IsoCode; realm.Add(user, update: true); }); await Navigation.PushAsync(new SignUpProfilePicturePage()); } }
protected void Page_Load(object sender, EventArgs e) { //Page.AddIconStyleSheet(); PageExtensions.AddIconStyleSheet(this); if (!Page.IsPostBack) { //uiCssClass16.CssClass = Icon.AcceptButton.GetCssClass16(); // required web.config setup //uiCssClass32.CssClass = Icon.AcceptButton.GetCssClass32(); // required web.config setup //uiUrl16.ImageUrl = Icon.AcceptButton.GetUrl16(); // required web.config setup //uiUrl32.ImageUrl = Icon.AcceptButton.GetUrl32(); // required web.config setup //uiWebResourceUrl16.ImageUrl = Icon.AcceptButton.GetWebResourceUrl16(); // no requirement //uiWebResourceUrl32.ImageUrl = Icon.AcceptButton.GetWebResourceUrl32(); // no requirement //IEnumerable<Icon> values = Enum.GetValues(typeof(Icon)).Cast<Icon>().ToList().Take(100); //uiCssClass16.CssClass = IconExtensions.GetCssClass16(Icon.AcceptButton); // required web.config setup //uiCssClass32.CssClass = IconExtensions.GetCssClass32(Icon.AcceptButton); // required web.config setup //uiUrl16.ImageUrl = IconExtensions.GetUrl16(Icon.AcceptButton); // required web.config setup //uiUrl32.ImageUrl = IconExtensions.GetUrl32(Icon.AcceptButton); // required web.config setup //uiWebResourceUrl16.ImageUrl = IconExtensions.GetWebResourceUrl16(Icon.AcceptButton); // no requirement //uiWebResourceUrl32.ImageUrl = IconExtensions.GetWebResourceUrl32(Icon.AcceptButton); // no requirement //uiCssClass16.CssClass = Icon.Accept.GetCssClass(); // required web.config setup //uiUrl16.ImageUrl = Icon.Accept.GetUrl(); // required web.config setup //uiWebResourceUrl16.ImageUrl = Icon.Accept.GetWebResourceUrl(); // no requirement uiCssClass16.CssClass = IconExtensions.GetCssClass(Z.IconLibrary.Fugue.Icon.Acorn); // required web.config setup uiUrl16.ImageUrl = IconExtensions.GetUrl(Z.IconLibrary.Fugue.Icon.Acorn); // required web.config setup uiWebResourceUrl16.ImageUrl = IconExtensions.GetWebResourceUrl(Z.IconLibrary.Fugue.Icon.Acorn); // no requirement //uiCssClass16.CssClass = IconExtensions.GetCssClass16(Icon.AcceptButton); // required web.config setup //uiUrl16.ImageUrl = IconExtensions.GetUrl16(Icon.AcceptButton); // required web.config setup //uiWebResourceUrl16.ImageUrl = IconExtensions.GetWebResourceUrl16(Icon.AcceptButton); // no requirement IEnumerable <Z.IconLibrary.Fugue.Icon> values = Enum.GetValues(typeof(Z.IconLibrary.Fugue.Icon)).Cast <Z.IconLibrary.Fugue.Icon>().ToList().Take(100); //uiCssClass16.CssClass = Icon.AcceptButton.GetCssClass(); // required web.config setup //uiUrl16.ImageUrl = Icon.AcceptButton.GetUrl(); // required web.config setup //uiWebResourceUrl16.ImageUrl = Icon.AcceptButton.GetWebResourceUrl(); // no requirement //uiCssClass16.CssClass = Icon.Accept.GetCssClass(); // required web.config setup //uiUrl16.ImageUrl = Icon.Accept.GetUrl(); // required web.config setup //uiWebResourceUrl16.ImageUrl = Icon.Accept.GetWebResourceUrl(); // no requirement uiIcon.DataSource = values; uiIcon.DataBind(); } uiIcon.SelectedIndexChanged += uiIcon_SelectedIndexChanged; }
public SelectCustomerPage() { try { InitializeComponent(); ToolbarItems?.Clear(); ToolbarItems.Add(PageExtensions.GetRefreshItem(ViewModel)); } catch (Exception ex) { Crashes.TrackError(ex); } }
public PagedResult <APIResponseTimesRow> Get([FromQuery] APIResponseTimesArgs args) { var criteria = new List <string>(); criteria.Add("tx.amount > 0"); criteria.AddIfNotNull(args.DateFrom, "tx.req_rcv_at_main_flw >= @DateFrom"); criteria.AddIfNotNull(args.DateTo, "tx.req_rcv_at_main_flw <= @DateTo"); criteria.AddIfNotNull(args.GlobalIds, "tx.global_id IN (@GlobalIds)"); criteria.AddIfNotNull(args.BankIds, "tx.mongo_bank_id IN (@BankIds)"); criteria.AddIfNotNull(args.CorporateIds, "tx.corp_id IN (@CorporateIds)"); criteria.AddIfNotNull(args.MerchantIds, "tx.mongo_m_id = (@MerchantIds)"); var where = criteria.ToWhereClause(); var groupBy = args.GroupByBankId ? "tx.mongo_bank_id, tx.bank_name, tx.mid" : "tx.mid, tx.mongo_bank_id, tx.bank_name"; var sql = $@"SELECT tx.mid AS MID, tx.global_id AS GlobalId, tx.global_name AS Global, tx.mongo_bank_id AS BankId, tx.bank_name AS Bank, tx.mongo_m_id AS MerchantId, tx.corp_id AS CorporateId, tx.corp_name AS Corporate, round(avg((DATE_PART('day', tx.res_snt_back_to_mrchnt + (@TimeZoneOffset ||' minutes')::interval - tx.req_rcv_at_main_flw + (@TimeZoneOffset ||' minutes')::interval) * 24*60*60 + DATE_PART('hour', tx.res_snt_back_to_mrchnt + (@TimeZoneOffset ||' minutes')::interval - tx.req_rcv_at_main_flw + (@TimeZoneOffset ||' minutes')::interval) * 3600 + DATE_PART('minute', tx.res_snt_back_to_mrchnt + (@TimeZoneOffset ||' minutes')::interval - tx.req_rcv_at_main_flw + (@TimeZoneOffset ||' minutes')::interval) * 60 + DATE_PART('second', tx.res_snt_back_to_mrchnt + (@TimeZoneOffset ||' minutes')::interval - tx.req_rcv_at_main_flw + (@TimeZoneOffset ||' minutes')::interval))):: numeric,2) as TotalDurationTransaction, round(avg(ts.ext_Apis_Total)::numeric, 3) as TotalDurationProviders, round(((avg((DATE_PART('day', tx.res_snt_back_to_mrchnt + (@TimeZoneOffset ||' minutes')::interval - tx.req_rcv_at_main_flw + (@TimeZoneOffset ||' minutes')::interval) * 24*60*60 + DATE_PART('hour', tx.res_snt_back_to_mrchnt + (@TimeZoneOffset ||' minutes')::interval - tx.req_rcv_at_main_flw + (@TimeZoneOffset ||' minutes')::interval) * 3600 + DATE_PART('minute', tx.res_snt_back_to_mrchnt + (@TimeZoneOffset ||' minutes')::interval - tx.req_rcv_at_main_flw + (@TimeZoneOffset ||' minutes')::interval) * 60 + DATE_PART('second', tx.res_snt_back_to_mrchnt + (@TimeZoneOffset ||' minutes')::interval - tx.req_rcv_at_main_flw + (@TimeZoneOffset ||' minutes')::interval)))) - avg(ts.ext_Apis_Total)):: numeric, 3) as TotalDurationAPC, count(tx.cs_rpt_txn_id) as NumberOfRequests FROM cs_rpt_txn tx LEFT JOIN (SELECT tsi.cs_rpt_txn_id, SUM((DATE_PART('day', tsi.res_rcv_frm_ext_api + (@TimeZoneOffset ||' minutes')::interval - tsi.req_snt_to_ext_api + (@TimeZoneOffset ||' minutes')::interval) * 24*60*60 + DATE_PART('hour', tsi.res_rcv_frm_ext_api + (@TimeZoneOffset ||' minutes')::interval - tsi.req_snt_to_ext_api + (@TimeZoneOffset ||' minutes')::interval) * 3600 + DATE_PART('minute', tsi.res_rcv_frm_ext_api + (@TimeZoneOffset ||' minutes')::interval - tsi.req_snt_to_ext_api + (@TimeZoneOffset ||' minutes')::interval) * 60 + DATE_PART('second', tsi.res_rcv_frm_ext_api + (@TimeZoneOffset ||' minutes')::interval - tsi.req_snt_to_ext_api + (@TimeZoneOffset ||' minutes')::interval))) AS ext_Apis_Total FROM cs_rpt_timestamp tsi GROUP BY tsi.cs_rpt_txn_id) ts ON tx.cs_rpt_txn_id = ts.cs_rpt_txn_id {where} GROUP BY {groupBy}, tx.mongo_m_id, tx.corp_id, tx.corp_name, tx.global_id, tx.global_name"; var transactions = PageExtensions.FetchPagedResult <APIResponseTimesRow>(_db, args.Page, args.PageSize, sql, args); return(transactions); }
public override void AddPage <T>(string title, object data = null) { Page page = FreshPageModelResolver.ResolvePageModel <T>(data); PageExtensions.GetModel(page).CurrentNavigationServiceName = this.NavigationServiceName; Page containerPage = this.CreateContainerPage(page); Pages.Add(title, containerPage); PageNames.Add(title); if (this.Pages.Count != 1) { return; } this.Detail = containerPage; }
// Not for Mac /* * public override void OnResignActivation (NSApplication uiApplication) * { * if (this.application == null) * return; * this.isSuspended = true; * this.application.SendSleepAsync ().Wait (); * } */ private void UpdateMainPage() { if (this.application.MainPage == null) { return; } PlatformRenderer platformRenderer = (PlatformRenderer)this.window.WindowController; this.window.WindowController = PageExtensions.CreateViewController(this.application.MainPage); if (platformRenderer == null) { return; } ((IDisposable)platformRenderer.Platform).Dispose(); }
public void PushPage(Page page) { var activity = FormsNavigationActivity.Instance; Android.Support.V4.App.Fragment fragment; if (page is ContentPage contentPage) { fragment = PageExtensions.CreateSupportFragment(contentPage, activity); } else { fragment = new ThirdTestPage().CreateSupportFragment(activity); } activity.SupportFragmentManager.BeginTransaction() .Replace(Resource.Id.fragmentContainer, fragment, page.ToString()).AddToBackStack(null) .Commit(); }
public VisitStorePage() { try { InitializeComponent(); _locationService = App.Resolve <IBaiduLocationService>(); ToolbarItems?.Clear(); var bar = PageExtensions.BulidButton("\uf017", () => { if (ViewModel != null) { ((ICommand)ViewModel.HistoryCommand)?.Execute(null); } }); ToolbarItems.Add(bar); } catch (Exception ex) { Crashes.TrackError(ex); } }
public void GetParentPage_WhenPageIsNull() { Assert.Null(PageExtensions.GetParentPage(null)); }
public void DataTests(bool isValid, string title, string result) { var generatedTitle = PageExtensions.GenerateTitle(isValid, title); generatedTitle.Should().Be(result); }