private async void RefreshAction(object obj) { try { if (IsBusy) { return; } IsBusy = true; SourceView.Clear(); var results = await LayananServices.GetItemsAsync(); var group = results.GroupBy(O => O.Kategori.Nama); Kategories.Clear(); foreach (var d in group) { Kategories.Add(d.Key); } } catch (Exception ex) { Helper.ShowMessageError(ex.Message); } finally { IsBusy = false; } }
internal async void Filter(string result) { try { if (IsBusy) { return; } IsBusy = true; await Task.Delay(300); SourceView.Clear(); var results = await LayananServices.GetItemsAsync(); foreach (var item in results.Where(O => O.Kategori.Nama == result)) { SourceView.Add(item); } } finally { IsBusy = false; } }
internal async void ShowTahapanInfo(int pos) { try { if (IsBusy) { return; } IsBusy = true; var layanan = await LayananServices.GetItemAsync(CurrentItem.IdLayanan.ToString()); if (layanan != null) { var c = layanan.Tahapans[pos - 1]; if (c != null) { Helper.ShowMessage(c.Nama); } } } catch (Exception ex) { Helper.ShowMessageError(ex.Message); } finally { IsBusy = false; } }
private async void RefreshAction(object obj) { await Task.Delay(300); try { if (IsBusy) { return; } IsBusy = true; SourceView.Clear(); var results = await LayananServices.GetItemsAsync(); var group = results.GroupBy(O => O.Kategori.Nama); kategori.Clear(); kategori.Add("All"); foreach (var d in group) { kategori.Add(d.Key); } foreach (var item in results) { SourceView.Add(item); } } finally { IsBusy = false; } }
internal async void Filter(string result) { try { if (IsBusy) { return; } IsBusy = true; await Task.Delay(300); SourceView.Clear(); if (result != "Cancel" && result != "All") { var results = await LayananServices.GetItemsAsync(); foreach (var item in results.Where(O => O.Kategori.Nama == result)) { SourceView.Add(item); } } else if (result == "All") { RefreshCommand.Execute(null); } } finally { IsBusy = false; } }
private async void LoadAsync() { try { await Task.Delay(300); if (IsBusy) { return; } IsBusy = true; if (lastPermohonan == null) { lastPermohonan = await PermohonanService.GetLastPermohonan(); CurrentItem = lastPermohonan; } if (CurrentItem != null) { CurrentItem = await PermohonanService.GetPermohonanById(CurrentItem.Id); var layanan = await LayananServices.GetItemAsync(CurrentItem.IdLayanan.ToString()); if (layanan != null) { StepBar.Steps = 0; StepBar.Children.Clear(); StepBar.StepSelected = 0; StepBar.Steps = layanan.Tahapans.Count(); NextTahapan = null; if (CurrentItem.NextTahapan != null) { NextTahapan = CurrentItem.NextTahapan; } ShowSertifikat = false; if (CurrentItem.Tahapans != null && layanan.Tahapans.Count == CurrentItem.Tahapans.Count) { NextTahapan = new tahapan { Nama = "Tidak Ada", Keterangan = "Proses Telah Selesai" }; ShowSertifikat = true; StepBar.Complete(); } if (CurrentItem.CurrentTahapan != null && layanan.Tahapans.Count > CurrentItem.Tahapans.Count) { var c = layanan.Tahapans.Where(O => O.Id == CurrentItem.CurrentTahapan.Id).FirstOrDefault(); if (c != null) { var index = layanan.Tahapans.IndexOf(c); StepBar.StepSelected = index + 1; } } } } var result = await PermohonanService.GetPermohonans(); Permohonans.Clear(); if (result != null) { foreach (var item in result) { Permohonans.Add(item); } } var message = await InboxServices.GetItemsAsync(CurrentItem.Id); LastMessage = null; if (message != null && message.Count() > 0) { LastMessage = message.FirstOrDefault(); } } catch (Exception ex) { Helper.ShowMessageError(ex.Message); } finally { IsBusy = false; } }