示例#1
0
    void UpdatePrefs()
    {
        Debug.Log("Update was pressed");

        string wantMan   = false.ToString();
        string wantWoman = false.ToString();

        if (wantToMeet.Contains(AppManeger.Gender.Male))
        {
            wantMan = true.ToString();
        }
        if (wantToMeet.Contains(AppManeger.Gender.Female))
        {
            wantWoman = true.ToString();
        }

        AppManeger.isLoadingData = true;
        UpdateMethods.UpdateUsersPrefsDatabase(AppManeger.instance.userID, AppManeger.instance.isSmoke.ToString(),
                                               wantAge[0].ToString(), wantAge[1].ToString(), AppManeger.instance.yourHabit.ToString(), wantMan, wantWoman,
                                               (result) => {
            Debug.Log("User Prefs update " + result);
            AppManeger.isLoadingData = false;
            managePanelChanges.GoToCheersPanel();                      // Call cheers screen after make the update
        }
                                               );

        // Update Gender choice at the user database and AppManeger
        UpdateMethods.UpdateUsersDatabase(AppManeger.instance.userID, AppManeger.instance.userName,
                                          AppManeger.instance.userAge.ToString(), myGenderChoice.ToString(),
                                          (result) => {
            Debug.Log("User update " + result);
        }
                                          );
    }
示例#2
0
    public void FaceBookLogin()
    {
        GetMethods.GetUserId(email, (id) => {
            if (id != "0")             // The user exits in the data base

            // Verify if an Update is necessary.
            {
                UpdateMethods.UpdateUsersDatabase(id, userName, age, AppManeger.instance.userGender.ToString(), (result) => {
                    Debug.Log(string.Format("Update {0}", result));
                });

                string fileName = string.Format("Prefs_{0}", AppManeger.instance.userID);

                //GetMethods.GetUserPrefs(id, (prefsResult) => {PrefsResult(prefsResult);}); // Check if the user are in the Prefs Database

                if (SaveLoadData.FileExits(fileName))                 // If exit

                {
                    SaveLoadData.Load(fileName, SaveLoadData.DataType.UserPrefs); // load from device
                    GoToCheersPanel();                                            // Means the user has everyting setted;
                }
                else
                {
                    GetMethods.GetUserPrefs(id, (prefsResult) => { PrefsResult(prefsResult); });                   // Check if the user are in the Prefs Database
                }
            }
            else                // User don't exit in the data base

            {
                PostMethods.InsertUserIntoUsersDatabase(userName, age, email, gender, (result) => {
                    InsertUserResult(result);
                });
            }
        });
    }
示例#3
0
    void Continue()
    {
        Debug.Log("Continue was pressed");
        managePanelChanges.SetSmokeAndHabitPanelOn();

        AppManeger.instance.wantAge[0] = wantAge[0];
        AppManeger.instance.wantAge[1] = wantAge[1];
        foreach (AppManeger.Gender gender in wantToMeet)
        {
            AppManeger.instance.wantToMeet.Add(gender);
        }

        // Update Gender choice at the user database and AppManeger
        UpdateMethods.UpdateUsersDatabase(AppManeger.instance.userID, AppManeger.instance.userName,
                                          AppManeger.instance.userAge.ToString(), myGenderChoice.ToString(),
                                          (result) => {
            Debug.Log("User update " + result);
        }
                                          );
    }