private async void lstRetailerGroup_ItemTapped(object sender, ItemTappedEventArgs e) { try { var appdate = Preferences.Get("appdatetime", String.Empty, "private_prefs"); if (string.IsNullOrEmpty(appdate)) { Preferences.Set("appdatetime", DateTime.Now.ToString(), "private_prefs"); } else { try { if (DateTime.Now >= DateTime.Parse(Preferences.Get("appdatetime", String.Empty, "private_prefs"))) { Preferences.Set("appdatetime", DateTime.Now.ToString(), "private_prefs"); RetailerGroupTable item = (RetailerGroupTable)e.Item; await Application.Current.MainPage.Navigation.PushModalAsync(new NavigationPage(new RetailerGroupDetails(item)) { BarBackgroundColor = Color.FromHex("#f1c40f") }); } else { await DisplayAlert("Application Error", "It appears you change the time/date of your phone. You will be logged out. Please restore the correct time/date", "Ok"); await Navigation.PopToRootAsync(); } } catch (Exception ex) { Crashes.TrackError(ex); await DisplayAlert("Application Error", "Error:\n\n" + ex.Message.ToString() + "\n\n Please contact your administrator", "Ok"); } } } catch (Exception ex) { Crashes.TrackError(ex); await DisplayAlert("Application Error", "Error:\n\n" + ex.Message.ToString() + "\n\n Please contact your administrator", "Ok"); } }
public RetailerGroupDetails(RetailerGroupTable item) { InitializeComponent(); GetRetailerGroupDetails(item.RetailerCode); }