public static async Task <HealthUpdate> GetSystemHealthAsync() { HealthUpdate objHealth = null; if (IsDataNetworkAvailable && IsRegisteredUser) { objHealth = await MembershipServiceWrapper.CheckPendingUpdates(CurrentProfile.ProfileId, CurrentProfile.LastSynced.HasValue?CurrentProfile.LastSynced.Value : DateTime.MinValue); } return(objHealth); }
public async void CheckPendingUpdatesFromServer() { try { if (Globals.IsRegisteredUser && Globals.IsDataNetworkAvailable) { this.PendingUpdates = null; this.PendingUpdates = await MembershipServiceWrapper.CheckPendingUpdates(Globals.User.CurrentProfileId, this.LastSyncDateTime); if (this.PendingUpdates != null) { if (!this.PendingUpdates.IsProfileActive) { SaveCurrentProfileSetting(ProfileSetting.MobileNumber, "+000000000000"); Deployment.Current.Dispatcher.BeginInvoke(() => Globals.DisplayToast(CustomMessage.ProfileDeactivatedText, "basicWrap", "Oops!")); this.LastSyncDateTime = DateTime.Now; } if (this.PendingUpdates.IsGroupModified) { //TODO } if (!string.IsNullOrEmpty(this.PendingUpdates.ServerVersion)) { var nameHelper = new AssemblyName(Assembly.GetExecutingAssembly().FullName); Version serverVersion = new Version(PendingUpdates.ServerVersion); var currentVersion = nameHelper.Version; if (serverVersion > currentVersion) { if (MessageBox.Show(CustomMessage.AppUpdateNotifyText, "Confirm", MessageBoxButton.OKCancel) == MessageBoxResult.OK) { MarketplaceDetailTask marketplaceDetailTask = new MarketplaceDetailTask(); marketplaceDetailTask.ContentType = MarketplaceContentType.Applications; marketplaceDetailTask.Show(); } } } } } } catch { } }