예제 #1
0
    public void Continue()
    {
        Debug.Log("Continue was pressed");
        managePanelChanges.GoToCheersPanel();

        AppManeger.isLoadingData = true;
        string id        = AppManeger.instance.userID;
        string smoke     = AppManeger.instance.isSmoke.ToString();
        string minAge    = AppManeger.instance.wantAge [0].ToString();
        string maxAge    = AppManeger.instance.wantAge [1].ToString();
        string habit     = AppManeger.instance.yourHabit.ToString();
        string wantMan   = "false";
        string wantWoman = "false";

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

        PostMethods.InsertUserIntoUsersPrefsDatabase(id, smoke, minAge, maxAge, habit, wantMan, wantWoman, (result) => {
            AppManeger.isLoadingData = false;
            Debug.Log(result);
        });
    }
예제 #2
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);
        }
                                          );
    }