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); }); } }); }
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); }); }
public void MoveGlassToLeft() { PostMethods.InsertCheersIntoMatchsDatabase(AppManeger.instance.userID, choosenId, "false", (result) => { Debug.Log(result); }); moveGlassAnimartor.SetTrigger("goLeft"); // trigger animation to left StartCoroutine("FindMoreCheers"); }
public void MoveGlassToRight() { PostMethods.InsertCheersIntoMatchsDatabase(AppManeger.instance.userID, choosenId, "true", (result) => { Debug.Log(result); }); moveGlassAnimartor.SetTrigger("goRight"); // trigger animation to right fixGlassAnimator.SetBool("rotate", true); //trigger rotation on the fix glass StartCoroutine("FindMoreCheers"); }
public void Setup() { _client = new RestClient { BaseUrl = new Uri(Constants.API_BASE_URL) }; _client.AddDefaultHeader(Constants.G_TOKEN_NAME, Constants.G_TOKEN_VALUE); _client.Authenticator = new HttpBasicAuthenticator(Constants.AUTHORIZATION_NAME, Constants.AUTHORIZATION_PASSWORD); _gen = new GeneralMethods(); _post = new PostMethods(_client); _get = new GetMethods(_client); _del = new DeleteMethods(_client); }
private static IEnumerable <QuestionInformation> ParseQuestions(this IEnumerable <Question> questions) { List <QuestionInformation> qi = new List <QuestionInformation>(); QuestionInformation q; int[] rank = new int[questions.Count()]; foreach (var item in questions) { q = new QuestionInformation(); q.Question = item; q.TotalWords = PostMethods.GetTotalWords(item.Body); q.Errors = PostMethods.CheckSpelling(item.Body); qi.Add(q); } return(qi); }
public string SendPost(PostMethods method, string[] args) { WebRequest request = WebRequest.Create(Server); request.Method = "POST"; request.ContentType = "application/x-www-form-urlencoded"; byte[] Data = Encoding.GetEncoding(1251).GetBytes("method=" + method.ToString() + ParseArgs(args)); request.ContentLength = Data.Length; Stream siteStream = request.GetRequestStream(); siteStream.Write(Data, 0, Data.Length); siteStream.Close(); HttpWebResponse result = (HttpWebResponse)request.GetResponse(); //tl;dr HttpWebResponse contains status code string responseString; using (Stream stream = result.GetResponseStream())//dispose tl;dr { StreamReader reader = new StreamReader(stream, Encoding.UTF8); responseString = reader.ReadToEnd(); } responseString += $"\nStatus Code : {result.StatusCode} / {result.StatusDescription}"; return(responseString); }
public Status hidePost(int post_id, int user_id, String datetime) { return(PostMethods.hidePost(post_id, user_id, datetime)); }
public Status getPostShares(int post_id, String datetime, int offset) { return(PostMethods.getPostShares(post_id, datetime, offset)); }
public Status getPostLikes(int post_id, String datetime, int offset) { return(PostMethods.OnGettingPostLikes(post_id, datetime, offset)); }
public Status getProfilePosts(int user_id, String datetime, int incomingUserId, int offset) { return(PostMethods.OnGettingProfilePosts(user_id, incomingUserId, datetime, offset)); }
public Status getProfileInfo(int profile_user_id, int current_user_id) { return(PostMethods.onGettingProfileInfo(profile_user_id, current_user_id)); }
public Status savePost(int post_id, int user_id, String datetime, String description) { return(PostMethods.savePost(post_id, user_id, datetime, description)); }
public Status getPostById(int post_id, int user_id) { return(PostMethods.getPostById(post_id, user_id)); }
public Status removeLike(int like_id, int post_id) { return(PostMethods.onDeletingLike(like_id, post_id)); }
public Status removeHidePost(int post_hidden_id) { return(PostMethods.removeHidePost(post_hidden_id)); }
public Status addNewPost([FromBody] Post post) { return(PostMethods.onInsertingNewPost(post)); }
public Status GetFriendPosts2(int User_id, String datetime, int offset, int type) { return(PostMethods.onRequestingPosts2(User_id, datetime, offset, type)); }
public Boolean updatePost([FromBody] PostUpdateData updatePost) { return(PostMethods.updatePost(updatePost)); }
public Status removeSavedPost(int saved_post_id) { return(PostMethods.removeSavedPost(saved_post_id)); }
public Status getSavedPosts(int user_id, String datetime, int offset) { return(PostMethods.getSavedPosts(user_id, datetime, offset)); }
public Status deletePost(int post_id) { return(PostMethods.deletePost(post_id)); }
public Status dislikePost(int User_id, int Post_id, String Datetime) { return(PostMethods.onDisLike(User_id, Post_id, Datetime)); }
public Status removeDisLike(int dis_like_id, int post_id) { return(PostMethods.onDeletingDisLike(dis_like_id, post_id)); }
public Status shareAPost([FromBody] Post post) { return(PostMethods.onSharingPost(post)); }
public Status reportPost(int post_id, int user_id, int report_type, String report_datetime) { return(PostMethods.reportPost(post_id, user_id, report_type, report_datetime)); }