private async void Load(GetStatisticsBy by) { try { var statistic = await GetStatisticsService.GetStatisticAsync(by); Statistic = statistic.Select(o => new Entry(o.Correct) { Color = SKColor.Parse("#FF0000"), Label = string.Format("{0}.{1}.{2} {3}:{4}", o.Time.Day, o.Time.Month, o.Time.Year, o.Time.Hour, o.Time.Minute), ValueLabel = (o.Correct + o.Incorrect).ToString() }).ToList(); Chart.Chart = new LineChart { Entries = Statistic, BackgroundColor = SKColor.Parse("#000000") }; } catch (SQLite.SQLiteException) { Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this); alert.SetTitle("სტატისტიკა"); alert.SetMessage("ჯერ გაიარე ტესტი"); Dialog dialog = alert.Create(); dialog.Show(); } }
public async Task OnButtonVisibleCheck() { try { await GetStatisticsService.GetStatisticAsync(DrivingLicenceAndroidPCL.Enums.GetStatisticsBy.ByMin); } catch (Exception) { FindViewById <CardView>(Resource.Id.StatisticCardView).Visibility = Android.Views.ViewStates.Gone; } var offline = await new GetTopicService(null).GetAllOfflineCategoryAsync(); if (offline == null || offline.Count() == 0) { FindViewById <CardView>(Resource.Id.DownloadedCardView).Visibility = Android.Views.ViewStates.Gone; } }