예제 #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);
        }
                                          );
    }
예제 #4
0
 public UpdateMethod(Update Cdo, UpdateMethods Method, Update_Parameters Parameters)
 {
     this.Cdo           = Cdo;
     this.ServiceMethod = Method;
     this.Parameters    = Parameters;
 }
예제 #5
0
        //
        /// <summary>
        ///  UPDATE |tableName| VALUES |ElementID| (ColName=value,...)
        ///  UPDATE |tableName| VALUES (colName=Param,...)
        ///  UPDATE |tableName| VALUES (colName=Param,...) WHERE |colName| BETWEEN (1,10)
        ///  UPDATE |tableName| VALUES (colName=Param,...) WHERE |colName| IN (1,2,3,4,kot)
        ///  UPDATE |tableName| DEFAULT VALUE |colName| |value|
        ///  UPDATE |tableName| NULLPROPERTY |colName| |true/false|
        ///  UPDATE |tableName| TYPE |colName| |type|
        /// </summary>
        /// <param name="query"></param>
        private static void Update(string query)
        {
            string _tableName = query.Substring(6);

            UpdateMethods.Execute(_tableName);
        }