private async void GetRcord() { var Wait = UserDialogs.Instance.Loading("Wait..", Cancel(), "Cancel", true, MaskType.Black); Wait.Show(); try { var version = DependencyService.Get <IAppVersionProvider>(); var versionString = version.AppVersion; JObject result = await _IAllDataServices.GetHomeRecord(versionString); if (result != null) { string type = result["Type"].ToString(); if (type == "Success") { if (!string.IsNullOrEmpty((string)result["ResponseMessage"])) { await App.Current.MainPage.DisplayAlert("Opps!", (string)result["ResponseMessage"], "Ok"); } var data = JsonConvert.DeserializeObject <List <FranchiseAchieveRewardDetail_Class> >(result["Result"].ToString()); if (data != null && data.Count != 0) { for (int i = 0; i < data.Count; i++) { FranchiseAchieveRewardDetail_Class_Date[i].Totla_Amount = data[i].Totla_Amount; FranchiseAchieveRewardDetail_Class_Date[i].Purchase_Point = data[i].Purchase_Point; total = total + data[i].Totla_Amount; } _FranchiseAchieveRewardDetail_Class_Date = FranchiseAchieveRewardDetail_Class_Date; Total = total; } else { _FranchiseAchieveRewardDetail_Class_Date = FranchiseAchieveRewardDetail_Class_Date; Total = total; } } else if (type == "NotFound") { if (!string.IsNullOrEmpty((string)result["ResponseMessage"])) { await App.Current.MainPage.DisplayAlert("Opps!", (string)result["ResponseMessage"], "Ok"); } _FranchiseAchieveRewardDetail_Class_Date = FranchiseAchieveRewardDetail_Class_Date; Total = total; } else if (type == "NewVersion") { Wait.Hide(); var output = await UserDialogs.Instance.ConfirmAsync(new ConfirmConfig { Message = "Application new version available at play store you need to update new version of app.", OkText = "Yes", CancelText = "No", Title = "New Version" }); if (output) { Device.OpenUri(new Uri("https://play.google.com/store/apps/details?id=com.companyname.theshirtshopApp")); if (Application.Current.Properties.ContainsKey("Key")) { Application.Current.Properties["Key"] = null; Application.Current.Properties["UserName"] = null; Application.Current.Properties["Password"] = null; Application.Current.Properties["OtherId"] = null; Application.Current.Properties.Remove("Key"); Application.Current.Properties.Remove("UserName"); Application.Current.Properties.Remove("Password"); Application.Current.Properties.Remove("OtherId"); } App.Current.MainPage = new MainPage(); } else { _FranchiseAchieveRewardDetail_Class_Date = FranchiseAchieveRewardDetail_Class_Date; Total = total; if (Application.Current.Properties.ContainsKey("Key")) { Application.Current.Properties["Key"] = null; Application.Current.Properties["UserName"] = null; Application.Current.Properties["Password"] = null; Application.Current.Properties["OtherId"] = null; Application.Current.Properties.Remove("Key"); Application.Current.Properties.Remove("UserName"); Application.Current.Properties.Remove("Password"); Application.Current.Properties.Remove("OtherId"); } //if (_navigation.ModalStack.Count > 0) //{ // await _navigation.PopModalAsync(); //} //await _navigation.PushModalAsync(new MainPage()); App.Current.MainPage = new MainPage(); } } else if (!string.IsNullOrEmpty(type)) { _FranchiseAchieveRewardDetail_Class_Date = FranchiseAchieveRewardDetail_Class_Date; Total = total; if (Application.Current.Properties.ContainsKey("Key")) { Application.Current.Properties["Key"] = null; Application.Current.Properties["UserName"] = null; Application.Current.Properties["Password"] = null; Application.Current.Properties["OtherId"] = null; Application.Current.Properties.Remove("Key"); Application.Current.Properties.Remove("UserName"); Application.Current.Properties.Remove("Password"); Application.Current.Properties.Remove("OtherId"); } App.Current.MainPage = new MainPage(); } } Wait.Hide(); } catch (Exception ex) { } }