/// <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 load the app level persistent data /// </summary> public void LoadAppLevelPersistantData() { PersistentDataStorage <string> persistData = new PersistentDataStorage <string>(); App.ApId = (null == persistData.Restore <string>(_apIdKey)) ? string.Empty : persistData.Restore <string>(_apIdKey); App.PIN = (null == persistData.Restore <string>(_pinKey)) ? string.Empty : persistData.Restore <string>(_pinKey); App.LoginPharId = (null == persistData.Restore <string>(_loginInPharmacyKey)) ? string.Empty : persistData.Restore <string>(_loginInPharmacyKey); App.BrandingHash = (null == persistData.Restore <string>(_brandHashKey)) ? string.Empty : persistData.Restore <string>(_brandHashKey); App.AdvtHash = (null == persistData.Restore <string>(_advtHashKey)) ? string.Empty : persistData.Restore <string>(_advtHashKey); App.HashPIN = (null == persistData.Restore <string>(_hashedPinKey)) ? string.Empty : persistData.Restore <string>(_hashedPinKey); App.StaticSplashURL = (null == persistData.Restore <string>(_staticSplashURLKey)) ? string.Empty : persistData.Restore <string>(_staticSplashURLKey); App.HeaderPillsReminder = (null == persistData.Restore <string>(_pillsReminderHeaderKey)) ? string.Empty : persistData.Restore <string>(_pillsReminderHeaderKey); App.LoginPharmacyAddress1 = (null == persistData.Restore <string>(_pharmacyAddress1Key)) ? string.Empty : persistData.Restore <string>(_pharmacyAddress1Key); App.LoginPharmacyAddress2 = (null == persistData.Restore <string>(_pharmacyAddress2Key)) ? string.Empty : persistData.Restore <string>(_pharmacyAddress2Key); App.LoginPharmacyAddress3 = (null == persistData.Restore <string>(_pharmacyAddress3Key)) ? string.Empty : persistData.Restore <string>(_pharmacyAddress3Key); App.DrugsData = (null == persistData.Restore <string>(_drugsDataKey)) ? string.Empty : persistData.Restore <string>(_drugsDataKey); App.DrugDBHash = (null == persistData.Restore <string>(_drugsDBDataHashKey)) ? string.Empty : persistData.Restore <string>(_drugsDBDataHashKey); App.ReminderToDisplay = (null == persistData.Restore <string>(_isReminderToDisplayKey)) ? string.Empty : persistData.Restore <string>(_isReminderToDisplayKey); App.Bgcolor = (null == persistData.Restore <string>(_bgColorKey)) ? string.Empty : persistData.Restore <string>(_bgColorKey); App.LoginEmailId = (null == persistData.Restore <string>(_loginEmailId)) ? string.Empty : persistData.Restore <string>(_loginEmailId); App.DailyMorningReminderOnOff = (null == persistData.Restore <string>(_isReminderDMOnOffKey)) ? intializeReminderStatus : persistData.Restore <string>(_isReminderDMOnOffKey); App.DailyAfternoonReminderOnOff = (null == persistData.Restore <string>(_isReminderDANOnOffKey)) ? intializeReminderStatus : persistData.Restore <string>(_isReminderDANOnOffKey); App.DailyEveningReminderOnOff = (null == persistData.Restore <string>(_isReminderDEOnOffKey)) ? intializeReminderStatus : persistData.Restore <string>(_isReminderDEOnOffKey); App.DailyNightReminderOnOff = (null == persistData.Restore <string>(_isReminderDNOnOffKey)) ? intializeReminderStatus : persistData.Restore <string>(_isReminderDNOnOffKey); App.WeeklyReminderOnOff = (null == persistData.Restore <string>(_isReminderWOnOffKey)) ? intializeReminderStatus : persistData.Restore <string>(_isReminderWOnOffKey); App.MonthlyReminderOnOff = (null == persistData.Restore <string>(_isReminderMOnOffKey)) ? intializeReminderStatus : persistData.Restore <string>(_isReminderMOnOffKey); App.Every28DaysReminderOnOff = (null == persistData.Restore <string>(_isReminderE28OnOffKey)) ? intializeReminderStatus : persistData.Restore <string>(_isReminderE28OnOffKey); App.SurgeonSaved = (null == persistData.Restore <string>(_surgeonSavedKey)) ? string.Empty : persistData.Restore <string>(_surgeonSavedKey); PersistentDataStorage <int> persistIntData = new PersistentDataStorage <int>(); App.NoofTriesLeft = (0 == persistIntData.Restore <int>(_noofTriesLeftKey)) ? intializeNoofTriesLeft : persistIntData.Restore <int>(_noofTriesLeftKey); App.LocalServiceDistance = (0 == persistIntData.Restore <int>(_localServiceDistanceKey)) ? intializeLocalServicesDistance : persistIntData.Restore <int>(_localServiceDistanceKey); PersistentDataStorage <bool> persistboolData = new PersistentDataStorage <bool>(); App.IsUserRegistered = (false == persistboolData.Restore <bool>(_isUserRegisteredKey)) ? false : persistboolData.Restore <bool>(_isUserRegisteredKey); App.IsPageHomePanorama = (false == persistboolData.Restore <bool>(_isPageHomePanoramaKey)) ? false : persistboolData.Restore <bool>(_isPageHomePanoramaKey); App.IsPageUpdateYourDetailsafterLogin = (false == persistboolData.Restore <bool>(_isPageUpdateYourDetailsafterLoginKey)) ? false : persistboolData.Restore <bool>(_isPageUpdateYourDetailsafterLoginKey); App.IsPageYourDetailsafterLoginSaved = (false == persistboolData.Restore <bool>(_isPageYourDetailsafterLoginSaved)) ? false : persistboolData.Restore <bool>(_isPageYourDetailsafterLoginSaved); App.IsChangePharmacy = (false == persistboolData.Restore <bool>(_isChangePharmacyKey)) ? false : persistboolData.Restore <bool>(_isChangePharmacyKey); App.IsVerifiedBySms = (false == persistboolData.Restore <bool>(_isVerifiedBySmsKey)) ? false : persistboolData.Restore <bool>(_isVerifiedBySmsKey); App.IsVerifiedByEmail = (false == persistboolData.Restore <bool>(_isVerifiedByEmailKey)) ? false : persistboolData.Restore <bool>(_isVerifiedByEmailKey); App.IsReminderToSet = (false == persistboolData.Restore <bool>(_isReminderToSetKey)) ? false : persistboolData.Restore <bool>(_isReminderToSetKey); App.IsChecked = (false == persistboolData.Restore <bool>(_isCheckedKey)) ? false : persistboolData.Restore <bool>(_isCheckedKey); App.IsFromLoginScreen = (false == persistboolData.Restore <bool>(_isFromLoginScreenKey)) ? false : persistboolData.Restore <bool>(_isFromLoginScreenKey); App.IsDisableSearchsurgen = (false == persistboolData.Restore <bool>(_isDisableSearchsurgenKey)) ? false : persistboolData.Restore <bool>(_isDisableSearchsurgenKey); App.IsNavigatedFromYourDetailsLogin = (false == persistboolData.Restore <bool>(_isNavigatedFromYourDetailsLoginKey)) ? false : persistboolData.Restore <bool>(_isNavigatedFromYourDetailsLoginKey); App.IsNavigatedFromYourDetailsLoginwithTC = (false == persistboolData.Restore <bool>(_isNavigatedFromYourDetailsLoginwithTCKey)) ? false : persistboolData.Restore <bool>(_isNavigatedFromYourDetailsLoginwithTCKey); App.IsNavigatedFromYourDetailsUpdate = (false == persistboolData.Restore <bool>(_isNavigatedFromYourDetailsUpdateKey)) ? false : persistboolData.Restore <bool>(_isNavigatedFromYourDetailsUpdateKey); App.IsDisplaySelectedSurgenOnSearchBox = (false == persistboolData.Restore <bool>(_isDisplaySelectedSurgenOnSearchBoxKey)) ? false : persistboolData.Restore <bool>(_isDisplaySelectedSurgenOnSearchBoxKey); PersistentDataStorage <SelectSurgenFeedDataCollection> persistSelectedSurgenColl = new PersistentDataStorage <SelectSurgenFeedDataCollection>(); App.SelectSurgenCollectionGlobalvar = (null == persistSelectedSurgenColl.Restore <SelectSurgenFeedDataCollection>(_selectSurgenCollectionGlobalvarKey)) ? null : persistSelectedSurgenColl.Restore <SelectSurgenFeedDataCollection>(_selectSurgenCollectionGlobalvarKey); PersistentDataStorage <LoginResponse> persistLoginResponseData = new PersistentDataStorage <LoginResponse>(); App.ObjLgResponse = (null == persistLoginResponseData.Restore <LoginResponse>(_objLoginResponseKey)) ? null : persistLoginResponseData.Restore <LoginResponse>(_objLoginResponseKey); PersistentDataStorage <GetPharmacyInformationResponse> persistPharmacyInformationResponseData = new PersistentDataStorage <GetPharmacyInformationResponse>(); App.ObjBrandingResponse = (null == persistPharmacyInformationResponseData.Restore <GetPharmacyInformationResponse>(_objPharmacyBrandInfoKey)) ? null : persistPharmacyInformationResponseData.Restore <GetPharmacyInformationResponse>(_objPharmacyBrandInfoKey); PersistentDataStorage <List <string> > persistAdvImageData = new PersistentDataStorage <List <string> >(); App.AdImages = (null == persistAdvImageData.Restore <List <string> >(_lstAdvtImagesKey)) ? null : persistAdvImageData.Restore <List <string> >(_lstAdvtImagesKey); PersistentDataStorage <PillsReminderModelCol> persistPillsColl = new PersistentDataStorage <PillsReminderModelCol>(); App.DailyMorningPillsCollection = (null == persistPillsColl.Restore <PillsReminderModelCol>(_pillsCollectionDMKey)) ? null : persistPillsColl.Restore <PillsReminderModelCol>(_pillsCollectionDMKey); App.DailyAfternoonPillsCollection = (null == persistPillsColl.Restore <PillsReminderModelCol>(_pillsCollectionDAKey)) ? null : persistPillsColl.Restore <PillsReminderModelCol>(_pillsCollectionDAKey); App.DailyEveningPillsCollection = (null == persistPillsColl.Restore <PillsReminderModelCol>(_pillsCollectionDEKey)) ? null : persistPillsColl.Restore <PillsReminderModelCol>(_pillsCollectionDEKey); App.DailyNightPillsCollection = (null == persistPillsColl.Restore <PillsReminderModelCol>(_pillsCollectionDNKey)) ? null : persistPillsColl.Restore <PillsReminderModelCol>(_pillsCollectionDNKey); App.WeeklyPillsCollection = (null == persistPillsColl.Restore <PillsReminderModelCol>(_pillsCollectionWeeklyKey)) ? null : persistPillsColl.Restore <PillsReminderModelCol>(_pillsCollectionWeeklyKey); App.MonthlyPillsCollection = (null == persistPillsColl.Restore <PillsReminderModelCol>(_pillsCollectionMonthlyKey)) ? null : persistPillsColl.Restore <PillsReminderModelCol>(_pillsCollectionMonthlyKey); App.Every28DaysPillsCollection = (null == persistPillsColl.Restore <PillsReminderModelCol>(_pillsCollectionE28DaysKey)) ? null : persistPillsColl.Restore <PillsReminderModelCol>(_pillsCollectionE28DaysKey); PersistentDataStorage <DateTime> persistDateTimeData = new PersistentDataStorage <DateTime>(); App.DailyMorningReminderDate = (new DateTime() == persistDateTimeData.Restore <DateTime>(_dailyMorningreminderDateKey)) ? initializeDate : persistDateTimeData.Restore <DateTime>(_dailyMorningreminderDateKey); App.DailyMorningReminderTime = (new DateTime() == persistDateTimeData.Restore <DateTime>(_dailyMorningreminderTimeKey)) ? initializeTime : persistDateTimeData.Restore <DateTime>(_dailyMorningreminderTimeKey); App.DailyAfternoonReminderDate = (new DateTime() == persistDateTimeData.Restore <DateTime>(_dailyAfternoonreminderDateKey)) ? initializeDate : persistDateTimeData.Restore <DateTime>(_dailyAfternoonreminderDateKey); App.DailyAfternoonReminderTime = (new DateTime() == persistDateTimeData.Restore <DateTime>(_dailyAfternoonreminderTimeKey)) ? initializeTime : persistDateTimeData.Restore <DateTime>(_dailyAfternoonreminderTimeKey); App.DailyEveningReminderDate = (new DateTime() == persistDateTimeData.Restore <DateTime>(_dailyEveningreminderDateKey)) ? initializeDate : persistDateTimeData.Restore <DateTime>(_dailyEveningreminderDateKey); App.DailyEveningReminderTime = (new DateTime() == persistDateTimeData.Restore <DateTime>(_dailyEveningreminderTimeKey)) ? initializeTime : persistDateTimeData.Restore <DateTime>(_dailyEveningreminderTimeKey); App.DailyNightReminderDate = (new DateTime() == persistDateTimeData.Restore <DateTime>(_dailyNightreminderDateKey)) ? initializeDate : persistDateTimeData.Restore <DateTime>(_dailyNightreminderDateKey); App.DailyNightReminderTime = (new DateTime() == persistDateTimeData.Restore <DateTime>(_dailyNightreminderTimeKey)) ? initializeTime : persistDateTimeData.Restore <DateTime>(_dailyNightreminderTimeKey); App.WeeklyReminderDate = (new DateTime() == persistDateTimeData.Restore <DateTime>(_weeklyreminderDateKey)) ? initializeDate : persistDateTimeData.Restore <DateTime>(_weeklyreminderDateKey); App.WeeklyReminderTime = (new DateTime() == persistDateTimeData.Restore <DateTime>(_weeklyreminderTimeKey)) ? initializeTime : persistDateTimeData.Restore <DateTime>(_weeklyreminderTimeKey); App.MonthlyReminderDate = (new DateTime() == persistDateTimeData.Restore <DateTime>(_monthlyreminderDateKey)) ? initializeDate : persistDateTimeData.Restore <DateTime>(_monthlyreminderDateKey); App.MonthlyReminderTime = (new DateTime() == persistDateTimeData.Restore <DateTime>(_monthlyreminderTimeKey)) ? initializeTime : persistDateTimeData.Restore <DateTime>(_monthlyreminderTimeKey); App.Every28DaysReminderDate = (new DateTime() == persistDateTimeData.Restore <DateTime>(_every28DaysreminderDateKey)) ? initializeDate : persistDateTimeData.Restore <DateTime>(_every28DaysreminderTimeKey); App.Every28DaysReminderTime = (new DateTime() == persistDateTimeData.Restore <DateTime>(_every28DaysreminderTimeKey)) ? initializeTime : persistDateTimeData.Restore <DateTime>(_every28DaysreminderTimeKey); }