/// <summary> ///Method to get Gps location /// </summary> /// <returns></returns> public void GetGpsLocation() { if (_watcher == null) { _watcher = new GeoCoordinateWatcher(); } if (!_watcher.Position.Location.IsUnknown && _watcher.Status == GeoPositionStatus.Ready) { objData.Backup(StateHelper._gpsPOSITIONKey, new MyLocalPharmacy.Entities.GPSPosition(_watcher.Position.Location.Latitude, _watcher.Position.Location.Longitude)); App.GPSCoordinatesAvailable = true; App.LastGPSPingedTime = DateTime.Now; } else { if (objData.Restore <GPSPosition>(StateHelper._gpsPOSITIONKey) == null) { App.GPSCoordinatesAvailable = false; //SimulatorTesting(); } else { App.GPSCoordinatesAvailable = true; } } }
/// <summary> /// Method to save app level Persistent data /// </summary> public void SaveAppLevelPersistantData() { PersistentDataStorage <string> persistData = new PersistentDataStorage <string>(); persistData.Backup(_apIdKey, App.ApId); persistData.Backup(_pinKey, App.PIN); persistData.Backup(_loginInPharmacyKey, App.LoginPharId); persistData.Backup(_brandHashKey, App.BrandingHash); persistData.Backup(_advtHashKey, App.AdvtHash); persistData.Backup(_hashedPinKey, App.HashPIN); persistData.Backup(_staticSplashURLKey, App.StaticSplashURL); persistData.Backup(_drugsDataKey, App.DrugsData); persistData.Backup(_pillsReminderHeaderKey, App.HeaderPillsReminder); persistData.Backup(_isReminderToDisplayKey, App.ReminderToDisplay); persistData.Backup(_bgColorKey, App.Bgcolor); persistData.Backup(_drugsDBDataHashKey, App.DrugDBHash); persistData.Backup(_loginEmailId, App.LoginEmailId); persistData.Backup(_isReminderDMOnOffKey, App.DailyMorningReminderOnOff); persistData.Backup(_isReminderDANOnOffKey, App.DailyAfternoonReminderOnOff); persistData.Backup(_isReminderDEOnOffKey, App.DailyEveningReminderOnOff); persistData.Backup(_isReminderDNOnOffKey, App.DailyNightReminderOnOff); persistData.Backup(_isReminderWOnOffKey, App.WeeklyReminderOnOff); persistData.Backup(_isReminderMOnOffKey, App.MonthlyReminderOnOff); persistData.Backup(_isReminderE28OnOffKey, App.Every28DaysReminderOnOff); persistData.Backup(_surgeonSavedKey, App.SurgeonSaved); persistData.Backup(_pharmacyAddress1Key, App.LoginPharmacyAddress1); persistData.Backup(_pharmacyAddress2Key, App.LoginPharmacyAddress2); persistData.Backup(_pharmacyAddress3Key, App.LoginPharmacyAddress3); PersistentDataStorage <int> persistIntData = new PersistentDataStorage <int>(); persistIntData.Backup(_noofTriesLeftKey, App.NoofTriesLeft); persistIntData.Backup(_localServiceDistanceKey, App.LocalServiceDistance); PersistentDataStorage <bool> persistboolData = new PersistentDataStorage <bool>(); persistboolData.Backup(_isUserRegisteredKey, App.IsUserRegistered); persistboolData.Backup(_isPageHomePanoramaKey, App.IsPageHomePanorama); persistboolData.Backup(_isPageUpdateYourDetailsafterLoginKey, App.IsPageUpdateYourDetailsafterLogin); persistboolData.Backup(_isPageYourDetailsafterLoginSaved, App.IsPageYourDetailsafterLoginSaved); persistboolData.Backup(_isReminderToSetKey, App.IsReminderToSet); persistboolData.Backup(_isCheckedKey, App.IsChecked); persistboolData.Backup(_isVerifiedBySmsKey, App.IsVerifiedBySms); persistboolData.Backup(_isVerifiedByEmailKey, App.IsVerifiedByEmail); persistboolData.Backup(_isChangePharmacyKey, App.IsChangePharmacy); persistboolData.Backup(_isFromLoginScreenKey, App.IsFromLoginScreen); persistboolData.Backup(_isDisableSearchsurgenKey, App.IsDisableSearchsurgen); persistboolData.Backup(_isNavigatedFromYourDetailsLoginKey, App.IsNavigatedFromYourDetailsLogin); persistboolData.Backup(_isNavigatedFromYourDetailsLoginwithTCKey, App.IsNavigatedFromYourDetailsLoginwithTC); persistboolData.Backup(_isNavigatedFromYourDetailsUpdateKey, App.IsNavigatedFromYourDetailsUpdate); persistboolData.Backup(_isDisplaySelectedSurgenOnSearchBoxKey, App.IsDisplaySelectedSurgenOnSearchBox); PersistentDataStorage <LoginResponse> persistLoginResponseData = new PersistentDataStorage <LoginResponse>(); persistLoginResponseData.Backup(_objLoginResponseKey, App.ObjLgResponse); PersistentDataStorage <GetPharmacyInformationResponse> persistPharmacyInformationResponseData = new PersistentDataStorage <GetPharmacyInformationResponse>(); persistPharmacyInformationResponseData.Backup(_objPharmacyBrandInfoKey, App.ObjBrandingResponse); PersistentDataStorage <SelectSurgenFeedDataCollection> persistSelectedSurgenColl = new PersistentDataStorage <SelectSurgenFeedDataCollection>(); persistSelectedSurgenColl.Backup(_selectSurgenCollectionGlobalvarKey, App.SelectSurgenCollectionGlobalvar); PersistentDataStorage <List <string> > persistAdvImageData = new PersistentDataStorage <List <string> >(); persistAdvImageData.Backup(_lstAdvtImagesKey, App.AdImages); PersistentDataStorage <PillsReminderModelCol> persistPillsColl = new PersistentDataStorage <PillsReminderModelCol>(); persistPillsColl.Backup(_pillsCollectionDMKey, App.DailyMorningPillsCollection); persistPillsColl.Backup(_pillsCollectionDAKey, App.DailyAfternoonPillsCollection); persistPillsColl.Backup(_pillsCollectionDEKey, App.DailyEveningPillsCollection); persistPillsColl.Backup(_pillsCollectionDNKey, App.DailyNightPillsCollection); persistPillsColl.Backup(_pillsCollectionWeeklyKey, App.WeeklyPillsCollection); persistPillsColl.Backup(_pillsCollectionMonthlyKey, App.MonthlyPillsCollection); persistPillsColl.Backup(_pillsCollectionE28DaysKey, App.Every28DaysPillsCollection); PersistentDataStorage <DateTime> persistDateTimeData = new PersistentDataStorage <DateTime>(); persistDateTimeData.Backup(_dailyMorningreminderDateKey, App.DailyMorningReminderDate); persistDateTimeData.Backup(_dailyMorningreminderTimeKey, App.DailyMorningReminderTime); persistDateTimeData.Backup(_dailyAfternoonreminderDateKey, App.DailyAfternoonReminderDate); persistDateTimeData.Backup(_dailyAfternoonreminderTimeKey, App.DailyAfternoonReminderTime); persistDateTimeData.Backup(_dailyEveningreminderDateKey, App.DailyEveningReminderDate); persistDateTimeData.Backup(_dailyEveningreminderTimeKey, App.DailyEveningReminderTime); persistDateTimeData.Backup(_dailyNightreminderDateKey, App.DailyNightReminderDate); persistDateTimeData.Backup(_dailyNightreminderTimeKey, App.DailyNightReminderTime); persistDateTimeData.Backup(_weeklyreminderDateKey, App.WeeklyReminderDate); persistDateTimeData.Backup(_weeklyreminderTimeKey, App.WeeklyReminderTime); persistDateTimeData.Backup(_monthlyreminderDateKey, App.MonthlyReminderDate); persistDateTimeData.Backup(_monthlyreminderTimeKey, App.MonthlyReminderTime); persistDateTimeData.Backup(_every28DaysreminderDateKey, App.Every28DaysReminderDate); persistDateTimeData.Backup(_every28DaysreminderTimeKey, App.Every28DaysReminderTime); }