public void OnSuccess(object response) { Deployment.Current.Dispatcher.BeginInvoke(() => { User user = (User)response; { if (flag) { User.Profile profile = new User.Profile(user); profile.SetLine1("0"); // for wins profile.SetLine2("0"); // for games played flag = false; userService.CreateOrUpdateProfile(user, this); } String jsonResponse = user.ToString(); Global.localUsername = user.GetUserName(); Global.email = user.GetEmail(); Global.password = pass.Text; NavigationService.Navigate(new Uri("/transition.xaml", UriKind.Relative)); } }); }
public void OnSuccess(object response) { User user = (User)response; if (flag) { win = user.GetProfile().GetLine1(); games = user.GetProfile().GetLine2(); games = Convert.ToInt32((games) + 1) + ""; User.Profile profile = new User.Profile(user); profile.SetLine2(games); if (Global.p1Score > Global.p2Score) { win = (Convert.ToInt32(win) + 1) + ""; profile.SetLine1(win); } // "wins is : " + user.GetProfile().GetLine1(); // games playes is user.GetProfile().SetLine2(); flag = false; userService.CreateOrUpdateProfile(user, this); } }
public void OnSuccess(object user) { try { if (user is User) { User userObj = (User)user; result = userObj.GetUserName(); userService.playerName = userObj.GetUserName(); Debug.Log("UserName : "******"EmailId : " + userObj.GetEmail()); User.Profile profileObj = (User.Profile)userObj.GetProfile(); if (profileObj != null) { Debug.Log("FIRST NAME" + profileObj.GetFirstName()); Debug.Log("SEX" + profileObj.GetSex()); Debug.Log("LAST NAME" + profileObj.GetLastName()); } } else { IList <User> userList = (IList <User>)user; result = userList[0].ToString(); Debug.Log("UserName : "******"EmailId : " + userList[0].GetEmail()); } } catch (App42Exception e) { result = e.ToString(); Debug.Log("App42Exception : " + e); } }
public void OnSuccess(object user) { try { if (user is User) { User userObj = (User)user; result = userObj.ToString(); Debug.Log("UserName : "******"EmailId : " + userObj.GetEmail()); User.Profile profileObj = (User.Profile)userObj.GetProfile(); } else { IList <User> userList = (IList <User>)user; result = userList[0].ToString(); Debug.Log("UserName : "******"EmailId : " + userList[0].GetEmail()); } } catch (App42Exception e) { result = e.ToString(); Debug.Log("App42Exception : " + e); } }
public void CreateUserWithProfile(string pName, string pPassword, string pEmail, User.Profile pProfile, App42Response.OnSuccessDelegate pSuccess, App42Response.OnExceptionDelegate pException) { App42Response response = new App42Response(pSuccess, pException); userService.CreateUserWithProfile(pName, pPassword, pEmail, pProfile, response); }
void CreateUserWithProfile(string pUserName, string pPassword, string pEmail, User.Profile pProfile) { App42UserServices.Instance.CreateUserWithProfile(pUserName, pPassword, pEmail, pProfile, (object pRespose) => LinkUserFacebookAccount(pUserName, FB.AccessToken), (System.Exception pEx) => Debug.Log("Create With Profile Exception: " + pEx.Message)); }
void OnGUI() { if (Time.time % 2 < 1) { success = callBack.getResult(); } // For Setting Up ResponseBox. GUI.TextArea(new Rect(10, 5, 1300, 175), success); //========================================================================= if (GUI.Button(new Rect(50, 200, 200, 30), "All Games")) { string gameName = "3DSnake"; ScoreBoardService scoreBoardService = sp.BuildScoreBoardService(); //scoreBoardService.GetTopRankings(gameName, gameCallback); scoreBoardService.SaveUserScore(gameName, "raita", 1, gameCallback); //userService = sp.BuildUserService (); // Initializing UserService. //userService.CreateUser (cons.userName, password, cons.emailId, callBack); } //========================================================================= if (GUI.Button(new Rect(260, 200, 200, 30), "Get User")) { userService = sp.BuildUserService(); // Initializing UserService. userService.GetUser(cons.userName, callBack); } //========================================================================= if (GUI.Button(new Rect(470, 200, 200, 30), "Get All Users")) { userService = sp.BuildUserService(); // Initializing UserService. userService.GetAllUsers(callBack); } //========================================================================= if (GUI.Button(new Rect(680, 200, 200, 30), "Update Email")) { userService = sp.BuildUserService(); // Initializing UserService. userService.UpdateEmail(cons.userName, cons.emailId, callBack); } //========================================================================= if (GUI.Button(new Rect(890, 200, 200, 30), "Delete User")) { userService = sp.BuildUserService(); // Initializing UserService. userService.DeleteUser(cons.userName, callBack); } //========================================================================= if (GUI.Button(new Rect(50, 250, 200, 30), "Authenticate User")) { userService = sp.BuildUserService(); // Initializing UserService. userService.Authenticate(cons.userName, password, callBack); } //========================================================================= if (GUI.Button(new Rect(260, 250, 200, 30), "Change UserPassword")) { userService = sp.BuildUserService(); // Initializing UserService. userService.ChangeUserPassword(cons.userName, password, "newPassWord", callBack); } //===================================###################========================================= if (GUI.Button(new Rect(470, 250, 200, 30), "Lock User")) { userService = sp.BuildUserService(); // Initializing UserService. userService.LockUser(cons.userName, callBack); } //===================================###################========================================= if (GUI.Button(new Rect(680, 250, 200, 30), "Unlock User")) { userService = sp.BuildUserService(); // Initializing UserService. userService.UnlockUser(cons.userName, callBack); } //===================================###################========================================= if (GUI.Button(new Rect(890, 250, 200, 30), "Get LockedUsers")) { userService = sp.BuildUserService(); // Initializing UserService. userService.GetLockedUsers(callBack); } //===================================###################========================================= if (GUI.Button(new Rect(50, 300, 200, 30), "GetAllUsersByPaging")) { userService = sp.BuildUserService(); // Initializing UserService. userService.GetAllUsers(max, offSet, callBack); } //===================================###################========================================= if (GUI.Button(new Rect(260, 300, 200, 30), "GetAllUsersCount")) { userService = sp.BuildUserService(); // Initializing UserService. userService.GetAllUsersCount(callBack); } //===================================###################========================================= if (GUI.Button(new Rect(680, 300, 200, 30), "ResetUserPassword")) { userService = sp.BuildUserService(); // Initializing UserService. userService.ResetUserPassword(cons.userName, callBack); } //===================================###################========================================= if (GUI.Button(new Rect(890, 300, 200, 30), "Log out")) { userService = sp.BuildUserService(); // Initializing UserService. userService.Logout(cons.sessionId, callBack); } //===================================###################========================================= if (GUI.Button(new Rect(50, 350, 200, 30), "GetLockedUsersCount")) { userService = sp.BuildUserService(); // Initializing UserService. userService.GetLockedUsersCount(callBack); } //===================================###################========================================= if (GUI.Button(new Rect(260, 350, 200, 30), "GetUserByEmailId")) { userService = sp.BuildUserService(); // Initializing UserService. userService.GetUserByEmailId(cons.updateEmailId, callBack); } //===================================###################========================================= if (GUI.Button(new Rect(470, 350, 200, 30), "GetLockedUsersByPaging")) { userService = sp.BuildUserService(); // Initializing UserService. userService.GetLockedUsers(max, offSet, callBack); } //===================================###################========================================= if (GUI.Button(new Rect(680, 350, 200, 30), "CreateOrUpdateProfile")) { userService = sp.BuildUserService(); // Initializing UserService. User.Profile profileObj = new User.Profile(createUserObj); profileObj.SetCountry("India"); profileObj.SetCity("GGN"); profileObj.SetFirstName("Akshay"); profileObj.SetLastName("Mishra"); profileObj.SetHomeLandLine("1234567890"); profileObj.SetMobile("12345678900987654321"); profileObj.SetOfficeLandLine("0987654321"); profileObj.SetSex(UserGender.MALE); profileObj.SetState("UP"); userService.CreateOrUpdateProfile(createUserObj, callBack); } //===================================###################========================================= if (GUI.Button(new Rect(890, 350, 200, 30), "CreateUserWithRole")) { userService = sp.BuildUserService(); // Initializing UserService. IList <string> roleList = new List <string>(); roleList.Add("Admin"); roleList.Add("Manager"); roleList.Add("Programmer"); roleList.Add("Tester"); userService.CreateUser(cons.userName, password, cons.emailId, roleList, callBack); } //===================================###################========================================= if (GUI.Button(new Rect(50, 400, 200, 30), "AssignRoles")) { userService = sp.BuildUserService(); // Initializing UserService. IList <string> roleList = new List <string>(); roleList.Add("Designer"); roleList.Add("Architect"); userService.AssignRoles(cons.userName, roleList, callBack); } }
public Profile(User.Profile profile) { _profile = profile; }