/// <summary> /// For Restoring page values /// </summary> /// <typeparam name="T"></typeparam> /// <param name="key"></param> /// <returns></returns> public T RestorePageLevelData <T>(string key) { TransientDataStorage <T> store = new TransientDataStorage <T>(); var data = store.Restore <T>(key); return((T)data); }
/// <summary> /// ClearAllTransientData /// </summary> public void ClearAllTransientData() { TransientDataStorage <string> transientData = new TransientDataStorage <string>(); transientData.Clear(); TransientDataStorage <bool> boolData = new TransientDataStorage <bool>(); boolData.Clear(); TransientDataStorage <OrderedPillDetails> orderedPilltransientData = new TransientDataStorage <OrderedPillDetails>(); orderedPilltransientData.Clear(); TransientDataStorage <OrderedPillDetailsCollection> orderedPillsCollectiontransientData = new TransientDataStorage <OrderedPillDetailsCollection>(); orderedPillsCollectiontransientData.Clear(); TransientDataStorage <PrescriptionCollection> prescriptionCollectiontransientData = new TransientDataStorage <PrescriptionCollection>(); prescriptionCollectiontransientData.Clear(); TransientDataStorage <int> intTransientData = new TransientDataStorage <int>(); intTransientData.Clear(); TransientDataStorage <List <string> > autoCompleteOrderRepeatTransientData = new TransientDataStorage <List <string> >(); autoCompleteOrderRepeatTransientData.Clear(); }
public void ClearPageLevelData <T>(string key, T value) { TransientDataStorage <T> store = new TransientDataStorage <T>(); store.Remove(key); }
/// <summary> /// For saving page values on tombstoning /// </summary> /// <typeparam name="T"></typeparam> /// <param name="key"></param> /// <param name="value"></param> public void SavePageLevelData <T>(string key, T value) { TransientDataStorage <T> store = new TransientDataStorage <T>(); store.Backup(key, value); }
/// <summary> /// Method to load app level transient data /// </summary> public void LoadAppLevelTransientData() { TransientDataStorage <string> transientData = new TransientDataStorage <string>(); App.SignUpPharId = (null == transientData.Restore <string>(_signUpPharmacyKey)) ? string.Empty : transientData.Restore <string>(_signUpPharmacyKey); App.LoginPharmacyname = (null == transientData.Restore <string>(_pharmacyNameKey)) ? string.Empty : transientData.Restore <string>(_pharmacyNameKey); App.LoginPharmacyAddress1 = (null == transientData.Restore <string>(_pharmacyAddress1Key)) ? string.Empty : transientData.Restore <string>(_pharmacyAddress1Key); App.LoginPharmacyAddress2 = (null == transientData.Restore <string>(_pharmacyAddress2Key)) ? string.Empty : transientData.Restore <string>(_pharmacyAddress2Key); App.LoginPharmacyAddress3 = (null == transientData.Restore <string>(_pharmacyAddress3Key)) ? string.Empty : transientData.Restore <string>(_pharmacyAddress3Key); App.PostCode = (null == transientData.Restore <string>(_postCodekey)) ? string.Empty : transientData.Restore <string>(_postCodekey); App.TombStonedPageURL = (null == transientData.Restore <string>(_tombStonedPageURLKey)) ? string.Empty : transientData.Restore <string>(_tombStonedPageURLKey); App.PIN = (null == transientData.Restore <string>(_pinKey)) ? string.Empty : transientData.Restore <string>(_pinKey); App.HashPIN = (null == transientData.Restore <string>(_hashedPinKey)) ? string.Empty : transientData.Restore <string>(_hashedPinKey); App.SelectedSurgen = (null == transientData.Restore <string>(_selectedSurgenKey)) ? string.Empty : transientData.Restore <string>(_selectedSurgenKey); App.PharmacyBranchName = (null == transientData.Restore <string>(_pharmacyBranchNameKey)) ? string.Empty : transientData.Restore <string>(_pharmacyBranchNameKey); App.LeafletWebLink = (null == transientData.Restore <string>(_leafletWebLinkKey)) ? string.Empty : transientData.Restore <string>(_leafletWebLinkKey); App.SurgeonAddress = (null == transientData.Restore <string>(_surgeonAddressKey)) ? string.Empty : transientData.Restore <string>(_surgeonAddressKey); App.LocalServiceLatitude = (null == transientData.Restore <string>(_localServiceLatitudeKey)) ? string.Empty : transientData.Restore <string>(_localServiceLatitudeKey); App.LocalServiceLongitude = (null == transientData.Restore <string>(_localServiceLongitudeKey)) ? string.Empty : transientData.Restore <string>(_localServiceLongitudeKey); App.SearchTerm = (null == transientData.Restore <string>(_searchTermKey)) ? string.Empty : transientData.Restore <string>(_searchTermKey); App.transientMailId = (null == transientData.Restore <string>(_transientMailIdKey)) ? string.Empty : transientData.Restore <string>(_transientMailIdKey); App.MailIdToFillAfterPin = (null == transientData.Restore <string>(_mailIdToFillAfterPin)) ? string.Empty : transientData.Restore <string>(_mailIdToFillAfterPin); TransientDataStorage <GeoCoordinate> transientDataGeoCoordinate = new TransientDataStorage <GeoCoordinate>(); App.LocalServiceCentreCoordinates = (null == transientDataGeoCoordinate.Restore <GeoCoordinate>(_localServiceCentreCoordinatesKey)) ? null : transientDataGeoCoordinate.Restore <GeoCoordinate>(_localServiceCentreCoordinatesKey); TransientDataStorage <double> transientDataZoomLevel = new TransientDataStorage <double>(); App.LocalServiceZoomLevel = (0 == transientDataZoomLevel.Restore <double>(_localServiceZoomLevelKey)) ? 0 : transientDataZoomLevel.Restore <double>(_localServiceZoomLevelKey); TransientDataStorage <bool> boolData = new TransientDataStorage <bool>(); App.IsChecked = (false == boolData.Restore <bool>(_isCheckedKey)) ? false : boolData.Restore <bool>(_isCheckedKey); App.IsCheckedTempStore = (false == boolData.Restore <bool>(_isCheckedTempKey)) ? false : boolData.Restore <bool>(_isCheckedTempKey); App.PinResetFromSettingsPage = (false == boolData.Restore <bool>(_pinResetFromSettingsPageKey)) ? false : boolData.Restore <bool>(_pinResetFromSettingsPageKey); App.IsFromRejected = (false == boolData.Restore <bool>(_isFromRejected)) ? false : boolData.Restore <bool>(_isFromRejected); App.IsPillUpdated = (false == boolData.Restore <bool>(_ispillUpdatedKey)) ? false : boolData.Restore <bool>(_ispillUpdatedKey); App.IsEditCancelled = (false == boolData.Restore <bool>(_isEditCancelledKey)) ? false : boolData.Restore <bool>(_isEditCancelledKey); App.IsUserNotExist = (false == boolData.Restore <bool>(_isUserNotExistKey)) ? false : boolData.Restore <bool>(_isUserNotExistKey); App.IsFromsignUp = (false == boolData.Restore <bool>(_isFromsignUpKeyKey)) ? false : boolData.Restore <bool>(_isFromsignUpKeyKey); TransientDataStorage <OrderedPillDetails> orderedPilltransientData = new TransientDataStorage <OrderedPillDetails>(); App.selectedOrder = (null == orderedPilltransientData.Restore <OrderedPillDetails>(_selectedOrderKey)) ? null : orderedPilltransientData.Restore <OrderedPillDetails>(_selectedOrderKey); TransientDataStorage <List <PillsReminderModel> > transientPillsColl = new TransientDataStorage <List <PillsReminderModel> >(); App.PillsReminderModelColLocalStorage = (null == transientPillsColl.Restore <List <PillsReminderModel> >(_pillsReminderModelColLocalStorageKey)) ? null : transientPillsColl.Restore <List <PillsReminderModel> >(_pillsReminderModelColLocalStorageKey); TransientDataStorage <PillsReminderModel> transientPillModel = new TransientDataStorage <PillsReminderModel>(); App.objPillsReminderModel = (null == transientPillModel.Restore <PillsReminderModel>(_objPillsReminderModelKey)) ? null : transientPillModel.Restore <PillsReminderModel>(_objPillsReminderModelKey); TransientDataStorage <OrderedPillDetailsCollection> orderedPillsCollectiontransientData = new TransientDataStorage <OrderedPillDetailsCollection>(); App.OrderedPillDetailsCollection = (null == orderedPillsCollectiontransientData.Restore <OrderedPillDetailsCollection>(_orderedPillDetailsCollectionKey)) ? null : orderedPillsCollectiontransientData.Restore <OrderedPillDetailsCollection>(_orderedPillDetailsCollectionKey); TransientDataStorage <PrescriptionCollection> prescriptionCollectiontransientData = new TransientDataStorage <PrescriptionCollection>(); App.prescriptionCollection = (null == prescriptionCollectiontransientData.Restore <PrescriptionCollection>(_prescriptionCollectionKey)) ? null : prescriptionCollectiontransientData.Restore <PrescriptionCollection>(_prescriptionCollectionKey); TransientDataStorage <int> intTransientData = new TransientDataStorage <int>(); App.selectedDrugIndex = (0 == intTransientData.Restore <int>(_selectedDrugIndexKey)) ? 0 : intTransientData.Restore <int>(_selectedDrugIndexKey); App.SelectedIndexToEdit = (0 == intTransientData.Restore <int>(_selectedIndexToEdit)) ? 0 : intTransientData.Restore <int>(_selectedIndexToEdit); TransientDataStorage <List <string> > autoCompleteOrderRepeatTransientData = new TransientDataStorage <List <string> >(); App.autoCompleteListDrug = (null == autoCompleteOrderRepeatTransientData.Restore <List <string> >(_autoCompleteListDrugKey)) ? null : autoCompleteOrderRepeatTransientData.Restore <List <string> >(_autoCompleteListDrugKey); App.autoCompleteEditListDrug = (null == autoCompleteOrderRepeatTransientData.Restore <List <string> >(_autoCompleteEditListDrugKey)) ? null : autoCompleteOrderRepeatTransientData.Restore <List <string> >(_autoCompleteEditListDrugKey); TransientDataStorage <DateTime> transientDateTimeData = new TransientDataStorage <DateTime>(); App.ReminderDateTemp = (new DateTime() == transientDateTimeData.Restore <DateTime>(_reminderDateTempKey)) ? initializeDate : transientDateTimeData.Restore <DateTime>(_reminderDateTempKey); App.ReminderTimeTemp = (new DateTime() == transientDateTimeData.Restore <DateTime>(_reminderTimeTempKey)) ? initializeTime : transientDateTimeData.Restore <DateTime>(_reminderTimeTempKey); }
/// <summary> /// Method to save app level transient data /// </summary> public void SaveAppLevelTransientData() { TransientDataStorage <string> transientData = new TransientDataStorage <string>(); transientData.Backup(_signUpPharmacyKey, App.SignUpPharId); transientData.Backup(_pharmacyNameKey, App.LoginPharmacyname); transientData.Backup(_pharmacyAddress1Key, App.LoginPharmacyAddress1); transientData.Backup(_pharmacyAddress2Key, App.LoginPharmacyAddress2); transientData.Backup(_pharmacyAddress3Key, App.LoginPharmacyAddress3); transientData.Backup(_postCodekey, App.PostCode); transientData.Backup(_tombStonedPageURLKey, App.TombStonedPageURL); transientData.Backup(_pinKey, App.PIN); transientData.Backup(_hashedPinKey, App.HashPIN); transientData.Backup(_selectedSurgenKey, App.SelectedSurgen); transientData.Backup(_pharmacyBranchNameKey, App.PharmacyBranchName); transientData.Backup(_leafletWebLinkKey, App.LeafletWebLink); transientData.Backup(_surgeonAddressKey, App.SurgeonAddress); transientData.Backup(_localServiceLatitudeKey, App.LocalServiceLatitude); transientData.Backup(_localServiceLongitudeKey, App.LocalServiceLongitude); transientData.Backup(_searchTermKey, App.SearchTerm); transientData.Backup(_transientMailIdKey, App.transientMailId); transientData.Backup(_mailIdToFillAfterPin, App.MailIdToFillAfterPin); TransientDataStorage <GeoCoordinate> transientDataGeoCoordinate = new TransientDataStorage <GeoCoordinate>(); transientDataGeoCoordinate.Backup(_localServiceCentreCoordinatesKey, App.LocalServiceCentreCoordinates); TransientDataStorage <double> transientDataZoomLevel = new TransientDataStorage <double>(); transientDataZoomLevel.Backup(_localServiceZoomLevelKey, App.LocalServiceZoomLevel); TransientDataStorage <List <PillsReminderModel> > transientPillsColl = new TransientDataStorage <List <PillsReminderModel> >(); transientPillsColl.Backup(_pillsReminderModelColLocalStorageKey, App.PillsReminderModelColLocalStorage); TransientDataStorage <PillsReminderModel> transientPillModel = new TransientDataStorage <PillsReminderModel>(); transientPillModel.Backup(_objPillsReminderModelKey, App.objPillsReminderModel); TransientDataStorage <bool> boolData = new TransientDataStorage <bool>(); boolData.Backup(_isCheckedTempKey, App.IsCheckedTempStore); boolData.Backup(_isCheckedKey, App.IsChecked); boolData.Backup(_pinResetFromSettingsPageKey, App.PinResetFromSettingsPage); boolData.Backup(_isFromRejected, App.IsFromRejected); boolData.Backup(_ispillUpdatedKey, App.IsPillUpdated); boolData.Backup(_isEditCancelledKey, App.IsEditCancelled); boolData.Backup(_isUserNotExistKey, App.IsUserNotExist); boolData.Backup(_isFromsignUpKeyKey, App.IsFromsignUp); TransientDataStorage <OrderedPillDetails> orderedPilltransientData = new TransientDataStorage <OrderedPillDetails>(); orderedPilltransientData.Backup(_selectedOrderKey, App.selectedOrder); TransientDataStorage <OrderedPillDetailsCollection> orderedPillsCollectiontransientData = new TransientDataStorage <OrderedPillDetailsCollection>(); orderedPillsCollectiontransientData.Backup(_orderedPillDetailsCollectionKey, App.OrderedPillDetailsCollection); TransientDataStorage <PrescriptionCollection> prescriptionCollectiontransientData = new TransientDataStorage <PrescriptionCollection>(); prescriptionCollectiontransientData.Backup(_prescriptionCollectionKey, App.prescriptionCollection); TransientDataStorage <int> intTransientData = new TransientDataStorage <int>(); intTransientData.Backup(_selectedDrugIndexKey, App.selectedDrugIndex); intTransientData.Backup(_selectedIndexToEdit, App.SelectedIndexToEdit); TransientDataStorage <DateTime> transientDateTimeData = new TransientDataStorage <DateTime>(); transientDateTimeData.Backup(_reminderDateTempKey, App.ReminderDateTemp); transientDateTimeData.Backup(_reminderTimeTempKey, App.ReminderTimeTemp); TransientDataStorage <List <string> > autoCompleteOrderRepeatTransientData = new TransientDataStorage <List <string> >(); autoCompleteOrderRepeatTransientData.Backup(_autoCompleteListDrugKey, App.autoCompleteListDrug); autoCompleteOrderRepeatTransientData.Backup(_autoCompleteListDrugKey, App.autoCompleteEditListDrug); }