Example #1
0
 public void LoadSettingsData()
 {
     _data = LoadXML(_FileLocation + "/" + _SettingsDataFileName);
     if (_data.ToString() != "")
     {
         mySettingsData   = (SaveSettingsData)DeserializeObject(_data, "SaveSettingsData");
         UserSettingsData = mySettingsData.UserSettingsData;
     }
 }
        public void TrySaveSettings(SaveSettingsData saveSettingsData)
        {
            var searchedObjects = MedicalTypesConverter.ToDatabaseService(saveSettingsData.SearchedObjects);
            var lastSearch = new MedicalLocatorUserLastSearch
                                 {
                                     Address = saveSettingsData.Address,
                                     CenterType = CenterTypeConverter.ToDatabaseService(saveSettingsData.CenterType),
                                     Latitude = saveSettingsData.Latitude,
                                     Longitude = saveSettingsData.Longitude,
                                     Range = saveSettingsData.Range,
                                     SearchedObjects = new ObservableCollection<MedicalTypeDatabaseService>(searchedObjects)
                                 };

            var client = new DatabaseConnectionServiceClient();
            var saveSettingsResponse = client.SaveSettings(saveSettingsData.Login, saveSettingsData.Password, lastSearch);
            if (!saveSettingsResponse.IsSuccessful)
                throw new InvalidSaveSettingsException(saveSettingsResponse.ErrorMessage);
        }
Example #3
0
    // Use this for initialization
    void Awake()
    {
        VersionNumber = "1.0";

        ExerciseTypeList.Clear();
        ExerciseTypeList.Add("General");
        ExerciseTypeList.Add("Warm-Up");
        ExerciseTypeList.Add("Stretch");
        ExerciseTypeList.Add("Weights");
        ExerciseTypeList.Add("Cardio-Light");
        ExerciseTypeList.Add("Cardio-Moderate");
        ExerciseTypeList.Add("Cardio-Intense");
        ExerciseTypeList.Add("Yoga");
        ExerciseTypeList.Add("Body Weight");
        ExerciseTypeList.Add("Cross-Fit");
        ExerciseTypeList.Add("Fighting");

        WorkoutTypeList.Clear();
        WorkoutTypeList.Add("General");
        WorkoutTypeList.Add("Warm-Up");
        WorkoutTypeList.Add("Stretch");
        WorkoutTypeList.Add("Weights");
        WorkoutTypeList.Add("Cardio");
        WorkoutTypeList.Add("Yoga");
        WorkoutTypeList.Add("Fighting");
        WorkoutTypeList.Add("Cross-Fit");

        TrainingTypeList.Clear();
        TrainingTypeList.Add("General");
        TrainingTypeList.Add("Warm-Up");
        TrainingTypeList.Add("Stretch");
        TrainingTypeList.Add("Weights");
        TrainingTypeList.Add("Cardio");
        TrainingTypeList.Add("Yoga");
        TrainingTypeList.Add("Fighting");
        TrainingTypeList.Add("Cross-Fit");

        BodyPartList.Clear();
        BodyPartList.Add("Body");
        BodyPartList.Add("Arms");
        BodyPartList.Add("Abs");
        BodyPartList.Add("Back");
        BodyPartList.Add("Chest");
        BodyPartList.Add("Core");
        BodyPartList.Add("Legs");

        BodySide.Clear();
        BodySide.Add("None");
        BodySide.Add("Left");
        BodySide.Add("Right");

        NumberList.Clear();
        NumberList.Add(0);
        NumberList.Add(1);
        NumberList.Add(2);
        NumberList.Add(3);
        NumberList.Add(4);
        NumberList.Add(5);
        NumberList.Add(6);
        NumberList.Add(7);
        NumberList.Add(8);
        NumberList.Add(9);

        NumberListToFive.Clear();
        NumberListToFive.Add(0);
        NumberListToFive.Add(1);
        NumberListToFive.Add(2);
        NumberListToFive.Add(3);
        NumberListToFive.Add(4);
        NumberListToFive.Add(5);

        YesNoList.Clear();
        YesNoList.Add("Yes");
        YesNoList.Add("No");

        MonthList.Clear();
        MonthList.Add("January");
        MonthList.Add("February");
        MonthList.Add("March");
        MonthList.Add("April");
        MonthList.Add("May");
        MonthList.Add("June");
        MonthList.Add("July");
        MonthList.Add("August");
        MonthList.Add("September");
        MonthList.Add("October");
        MonthList.Add("November");
        MonthList.Add("December");

        FilterExerciseTypeList.Clear();
        FilterExerciseTypeList.Add("None");
        foreach (string item in ExerciseTypeList)
        {
            FilterExerciseTypeList.Add(item);
        }

        FilterBodyPartList.Clear();
        FilterBodyPartList.Add("None");
        foreach (string item in BodyPartList)
        {
            FilterBodyPartList.Add(item);
        }

        UIManager = GameObject.Find("UI_Manager_Prefab");

        UserDownloadTrainingData       = new SaveDownloadTrainingData();
        UserDownloadWorkoutData        = new SaveDownloadWorkoutData();
        UserDownloadExerciseData       = new SaveDownloadExerciseData();
        UserDownloadTrainingDataString = "";
        UserDownloadWorkoutDataString  = "";
        UserDownloadExerciseDataString = "";
        UserWorkoutData  = new SaveWorkoutData();
        UserExerciseData = new SaveExerciseData();
        UserFriendData   = new SaveFriendData();
        UserTrainingData = new SaveTrainingData();
        UserDayData      = new SaveDayData();

        _FileLocation = Application.persistentDataPath;
        _DownloadTrainingDataFileName = "DownloadTrainingData.xml"; // temporarily get these locally. change this to be downloaded from the server
        _DownloadWorkoutDataFileName  = "DownloadWorkoutData.xml";  // temporarily get these locally. change this to be downloaded from the server
        _DownloadExerciseDataFileName = "DownloadExerciseData.xml"; // temporarily get these locally. change this to be downloaded from the server
        _FileName             = "SaveData.xml";
        _TrainingDataFileName = "TrainingData.xml";
        _WorkoutDataFileName  = "WorkoutData.xml";
        _ExerciseDataFileName = "ExerciseData.xml";
        _DayDataFileName      = "DayData.xml";
        _SettingsDataFileName = "SettingsData.xml";
        _FriendDataFileName   = "FriendData.xml";

        myData         = new SaveData();
        mySettingsData = new SaveSettingsData();
    }