public static IQueryable <LinkOrderCampaignProductRecord> FilterByType( this IQueryable <LinkOrderCampaignProductRecord> query, OverviewType type, IQueryable <CampaignRecord> campaignsQuery = null) { var today = DateTime.UtcNow.Date; switch (type) { case OverviewType.Active: return(query.Where(p => campaignsQuery .Where(c => c.IsActive) .Select(c => c.Id).Contains(p.CampaignProductRecord.CampaignRecord_Id))); case OverviewType.Today: var nextDay = today.AddDays(1); return(query.Where(p => p.OrderRecord.Created.Date >= today && p.OrderRecord.Created.Date < nextDay)); case OverviewType.Yesterday: var yesterday = today.AddDays(-1); return (query.Where(p => p.OrderRecord.Created.Date >= yesterday && p.OrderRecord.Created.Date < today)); case OverviewType.AllTime: return(query); default: return(query); } }
private void NavListview_ItemClick(object sender, AdapterView.ItemClickEventArgs e) { browsingContext = OverviewType.Category; var cat = currentWebsite.Categories[e.Position]; refreshingLink = cat.Link; Title = $"{cat.Name} - {currentWebsite.Name}"; analysisModule.ReadCategory(UidGenerator(), currentWebsiteKey, cat, this); adapter.data = null; adapter.NotifyDataSetChanged(); drawerLayout.CloseDrawer((int)GravityFlags.Left); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.overview); //ActionBar.Hide(); if (Intent.Extras != null && Intent.Extras.ContainsKey(PassWebsiteKey)) { currentWebsite = Config.GetWebsite(currentWebsiteKey = Intent.Extras.GetString(PassWebsiteKey)); } browsingContext = OverviewType.IndexPage; analysisModule.ReadIndexPage(UidGenerator(), currentWebsiteKey, refreshingLink = currentWebsite.IndexPageLink, this); //make the request ChangeStatusBarColor(Window, currentWebsite.Color); toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.overviewToolbar); appBarLayout = FindViewById <AppBarLayout>(Resource.Id.overviewAppbar); toolbar.SetBackgroundColor(Android.Graphics.Color.ParseColor(currentWebsite.Color)); appBarLayout.SetBackgroundColor(Android.Graphics.Color.ParseColor(currentWebsite.Color)); toolbar.Title = currentWebsite.Name; swipeRefLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swiperefresh); swipeRefLayout.Refresh += SwipeRefLayout_Refresh; swipeRefLayout.SetColorSchemeColors(new int[] { Android.Graphics.Color.ParseColor(currentWebsite.Color).ToArgb() }); drawerLayout = FindViewById <DrawerLayout>(Resource.Id.overviewDrawerLayout); navListview = FindViewById <ListView>(Resource.Id.navigationDrawerListView); navData = new string[currentWebsite.Categories.Length]; int index = 0; foreach (var item in currentWebsite.Categories) { navData[index++] = item.Name; } navAdapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, navData); navListview.Adapter = navAdapter; navListview.ItemClick += NavListview_ItemClick; recyView = FindViewById <RecyclerView>(Resource.Id.overviewRecyclerView); recyView.SetLayoutManager(recyLayoutManager = new LinearLayoutManager(this, (int)Orientation.Vertical, false)); recyView.SetAdapter(adapter = new RecyclerViewAdpater(currentWebsite)); adapter.OnItemClick += RecyclerView_OnItemClick; adapter.LoadNextPage += (sender, e) => LoadNextPage(); }
private void OnCategorySelected(object sender, Category category) { MyLog.Log(this, nameof(OnCategorySelected)); if (browsingContext == OverviewType.Category && refreshingLink == category.Link) { return; } swipeRefLayout.Refreshing = true; browsingContext = OverviewType.Category; refreshingLink = category.Link; MyLog.Log(this, $"Read category url {refreshingLink}" + "..."); analysisModule.ReadCategory(refreshingRequestUid = UidGenerator(), websiteKey, category, this); MyLog.Log(this, $"Read category url {refreshingLink}" + "...Done"); adapter.data = null; adapter.NotifyDataSetChanged(); MyLog.Log(this, nameof(OnCategorySelected) + "...Done"); }
public static IQueryable<LinkOrderCampaignProductRecord> FilterByType(this IQueryable<LinkOrderCampaignProductRecord> query, OverviewType type, IQueryable<CampaignRecord> campaignsQuery = null) { var today = DateTime.UtcNow.Date; switch (type) { case OverviewType.Active: return query .Where(p => campaignsQuery .Where(c => c.IsActive) .Select(c => c.Id).Contains(p.CampaignProductRecord.CampaignRecord_Id)); case OverviewType.Today: var nextDay = today.AddDays(1); return query .Where(p => p.OrderRecord.Created.Date >= today && p.OrderRecord.Created.Date < nextDay); case OverviewType.Yesterday: var yesterday = today.AddDays(-1); return query .Where(p => p.OrderRecord.Created.Date >= yesterday && p.OrderRecord.Created.Date < today); default: return query; } }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { MyLog.Log(this, $"OnCreateView..."); swipeRefLayout = inflater.Inflate(Resource.Layout.main_offline_list, container, false) as SwipeRefreshLayout; swipeRefLayout.Refreshing = true; swipeRefLayout.Refresh += SwipeRefLayout_Refresh; swipeRefLayout.SetColorSchemeColors(new int[] { Android.Graphics.Color.ParseColor(website.Color).ToArgb() }); recyView = swipeRefLayout.FindViewById <RecyclerView>(Resource.Id.offlineRecyclerView); recyView.SetLayoutManager(recyLayoutManager = new LinearLayoutManager(this.Context, (int)Orientation.Vertical, false)); recyView.SetAdapter(adapter = new RecyclerViewAdpater(website)); adapter.OnItemClick += RecyclerView_OnItemClick; adapter.LoadNextPage += (sender, e) => LoadNextPage(); adapter.OnCategorySelected += OnCategorySelected; if (website.Categories == null) { MyLog.Log(this, $"Requesting index page data from analysisModule url {website.IndexPageLink}..."); browsingContext = OverviewType.IndexPage; analysisModule.ReadIndexPage(refreshingRequestUid = UidGenerator(), websiteKey, website.IndexPageLink, this); MyLog.Log(this, $"Requesting index page data from analysisModule url {website.IndexPageLink}...Done"); } else { MyLog.Log(this, $"Requesting index page data from analysisModule category {website?.Categories[0]?.Link}..."); browsingContext = OverviewType.Category; refreshingLink = website.Categories[0].Link; analysisModule.ReadCategory(refreshingRequestUid = UidGenerator(), websiteKey, website.Categories[0], this); MyLog.Log(this, $"Requesting index page data from analysisModule category {website?.Categories[0]?.Link}...Done"); } MyLog.Log(this, $"OnCreateView...Done"); return(swipeRefLayout); }
public void ArticalOverviewProcessedCallback(string uid, string url, ArticalOverview[] articalOverviews, OverviewType overviewType, string nextPageUrl) { MyLog.Log(this, nameof(ArticalOverviewProcessedCallback)); ArticalOverview[] newData = null; lock (NextPageRequestUids) { if (NextPageRequestUids == uid) { MyLog.Log(this, $"next page data received" + "..."); newData = new ArticalOverview[adapter.data.Length + articalOverviews.Length]; adapter.data.CopyTo(newData, 0); articalOverviews.CopyTo(newData, adapter.data.Length); NextPageRequestUids = string.Empty; MyLog.Log(this, $"next page data received" + "...Done"); } } if (nextPageUrl != null && nextPageUrl != string.Empty) { nextPageContext = new NextPageContext() { overviewType = overviewType, url = nextPageUrl }; //save the next page state } if (uid == refreshingRequestUid) { MyLog.Log(this, "refreshing content received" + "..."); newData = null; refreshingRequestUid = string.Empty; Activity.RunOnUiThread(new Action(() => { swipeRefLayout.Refreshing = false; })); MyLog.Log(this, "refreshing content received" + "...Done"); } MyLog.Log(this, "Updating adapter data" + "..."); adapter.data = newData == null ? articalOverviews : newData; database.IsSeen(UidGenerator(), adapter.data); //request a filter from DB Activity.RunOnUiThread(responseUpdate); MyLog.Log(this, "Updating adapter data" + "...Done"); MyLog.Log(this, nameof(ArticalOverviewProcessedCallback) + "...Done"); }
public static async Task <HttpResponseMessage> SendDeleteConfigurationRequestAsync(int orgId, OverviewType overviewType, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.LocalAdmin); var url = TestEnvironment.CreateUrl($"api/v1/kendo-organizational-configuration?organizationId={orgId}&overviewType={overviewType}"); return(await HttpApi.DeleteWithCookieAsync(url, cookie)); }
public static async Task <HttpResponseMessage> SendSaveConfigurationRequestAsync(int orgId, OverviewType overviewType, string configuration, Cookie optionalLogin = null) { var cookie = optionalLogin ?? await HttpApi.GetCookieAsync(OrganizationRole.LocalAdmin); var url = TestEnvironment.CreateUrl($"api/v1/kendo-organizational-configuration"); var body = new KendoOrganizationalConfigurationDTO { OverviewType = overviewType, Configuration = configuration, OrganizationId = orgId }; return(await HttpApi.PostWithCookieAsync(url, cookie, body)); }
public Result <KendoOrganizationalConfiguration, OperationError> CreateOrUpdate(int organizationId, OverviewType overviewType, string configuration) { var currentConfig = _kendoOrganizationRepository.Get(organizationId, overviewType); if (currentConfig.HasValue) { var modifiedConfig = currentConfig.Value; if (!_authorizationContext.AllowModify(modifiedConfig)) { return(new OperationError(OperationFailure.Forbidden)); } modifiedConfig.Configuration = configuration; _kendoOrganizationRepository.Update(modifiedConfig); return(modifiedConfig); } if (!_authorizationContext.AllowCreate <KendoOrganizationalConfiguration>(organizationId)) { return(new OperationError(OperationFailure.Forbidden)); } var createdConfig = new KendoOrganizationalConfiguration { OrganizationId = organizationId, OverviewType = overviewType, Configuration = configuration }; var created = _kendoOrganizationRepository.Add(createdConfig); return(created); }
private void TreasureBtn_Click(object sender, EventArgs e) { fType = OverviewType.Treasure; update_list(); }
/// <remarks/> public void FindStatOverviewAsync(string APIKey, string Title, OverviewType OverviewType) { this.FindStatOverviewAsync(APIKey, Title, OverviewType, null); }
public RequestPacket AddAnalisisModuleResponseUiArtical(IUiArticalResponseHandler responseHandler, OverviewType overviewType) { this.OverviewType = overviewType; this.AnalisisModuleResponseUiArtical = responseHandler; return(this); }
private void EncounterBtn_Click(object sender, EventArgs e) { fType = OverviewType.Encounters; update_list(); }
public static RequestPacket CreatePacket(string uid, string websiteKey, string url, bool onlineOnly, RequestPacketOwners owner, OverviewType overviewType, IUiArticalOverviewResponseHandler analisisModuleResponseUiArticalOverview = null, IResponseHandler offlineModuleResponse = null, IResponseHandler onlineModuleResponse = null) { var r = new RequestPacket() { Uid = uid, WebsiteKey = websiteKey, Url = url, Owner = owner, OverviewType = overviewType, OnlyOnline = onlineOnly }; if (analisisModuleResponseUiArticalOverview != null) { r.AnalisisModuleResponseUiArticalOverview = analisisModuleResponseUiArticalOverview; } if (offlineModuleResponse != null) { r.OfflineModuleResponse = offlineModuleResponse; } if (onlineModuleResponse != null) { r.OnlineModuleResponse = onlineModuleResponse; } //Android.Util.Log.Debug("RequestPacket", $"Created {++MyGlobal.requestPacketCount}"); return(r); }
private void TrapBtn_Click(object sender, EventArgs e) { this.fType = OverviewType.Traps; this.update_list(); }
public Maybe <KendoOrganizationalConfiguration> Get(int organizationId, OverviewType overviewType) { return(_repository.AsQueryable().Where(x => x.OrganizationId == organizationId && x.OverviewType == overviewType).SingleOrDefault()); }
/// <summary> /// Constructor /// </summary> /// <param name="type">Type</param> public HelpOverviewCommandAttribute(OverviewType type) { Type = type; }
public Result <KendoOrganizationalConfiguration, OperationError> Delete(int organizationId, OverviewType overviewType) { var currentConfig = _kendoOrganizationRepository.Get(organizationId, overviewType); if (currentConfig.HasValue) { var configToBeDeleted = currentConfig.Value; if (!_authorizationContext.AllowDelete(configToBeDeleted)) { return(new OperationError(OperationFailure.Forbidden)); } _kendoOrganizationRepository.Delete(configToBeDeleted); return(configToBeDeleted); } return(new OperationError(OperationFailure.NotFound)); }
private void ChallengeBtn_Click(object sender, EventArgs e) { fType = OverviewType.SkillChallenges; update_list(); }
public void ArticalOverviewProcessedCallback(string uid, string url, ArticalOverview[] articalOverviews, OverviewType overviewType, string nextPageUrl) { ArticalOverview[] newData = null; lock (NextPageRequestUids) { if (NextPageRequestUids == uid) { newData = new ArticalOverview[adapter.data.Length + articalOverviews.Length]; adapter.data.CopyTo(newData, 0); articalOverviews.CopyTo(newData, adapter.data.Length); NextPageRequestUids = string.Empty; } } if (nextPageUrl != null && nextPageUrl != string.Empty) { nextPageContext = new NextPageContext() { overviewType = overviewType, url = nextPageUrl }; //save the next page state } if (uid == refreshingRequestUid) { newData = null; refreshingRequestUid = string.Empty; RunOnUiThread(new Action(() => { swipeRefLayout.Refreshing = false; })); } adapter.data = newData == null ? articalOverviews : newData; database.IsSeen(UidGenerator(), adapter.data); //request a filter from DB RunOnUiThread(responseUpdate); }
public MessageResponse FindStatOverview(string APIKey, string Title, OverviewType OverviewType) { object[] results = this.Invoke("FindStatOverview", new object[] { APIKey, Title, OverviewType}); return ((MessageResponse)(results[0])); }
public void OverviewTypeInitCorrectly() { var overview = new OverviewType(); Assert.IsType <Guid>(overview.TypeID); }
/// <remarks/> public void FindStatOverviewAsync(string APIKey, string Title, OverviewType OverviewType, object userState) { if ((this.FindStatOverviewOperationCompleted == null)) { this.FindStatOverviewOperationCompleted = new System.Threading.SendOrPostCallback(this.OnFindStatOverviewOperationCompleted); } this.InvokeAsync("FindStatOverview", new object[] { APIKey, Title, OverviewType}, this.FindStatOverviewOperationCompleted, userState); }
public Result <KendoOrganizationalConfiguration, OperationError> Get(int organizationId, OverviewType overviewType) { var config = _kendoOrganizationRepository.Get(organizationId, overviewType); return(config.HasValue ? config.Value : Result <KendoOrganizationalConfiguration, OperationError> .Failure(OperationFailure.NotFound)); }