public MyFanSelectedViewModel() { Messenger.Default.Register <User>(this, userselected => { JsonTools test = new JsonTools(); _userID = userselected.Id.ToString(); getListeFanUser(); }); SearchCommandMyFanSelectedViewModel = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("SearchCommandMyFanViewModel click :)"); INavigationService navigationService = SimpleIoc.Default.GetInstance <INavigationService>(); navigationService.NavigateTo(ViewModelLocator.NavigationSearchView); }); LogOutCommandMyFanSelectedViewModel = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("LogOutCommandMyFanViewModel click :)"); HTTPRequest connect = new HTTPRequest(); connect.RequestFinished += new HTTPRequest.RequestFinishedEventHandler(this.doLogout); Globals test_global = null; test_global = Globals.getInstance(); connect.HttpPostRequest(test_global.IpAPI + "api/logout", ""); }); SelectedUserCommandMyFanSelectedViewModel = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("SelectedUserCommandMyFanViewModel click :)"); Messenger.Default.Send(UserClick); INavigationService navigationService = SimpleIoc.Default.GetInstance <INavigationService>(); navigationService.NavigateTo(ViewModelLocator.NavigationAccountSelectedView); }); }
public void addNouvelAbonnement(int addId) { Globals value_user = null; value_user = Globals.getInstance(); HTTPRequest connect = new HTTPRequest(); connect.RequestFinished += new HTTPRequest.RequestFinishedEventHandler(this.doAddNouvelAbonnement); connect.HttpPostRequest(value_user.IpAPI + "api/users/" + value_user.UserConnected + "/subscriptions", "{ \"id\": " + addId.ToString() + " }"); }
public void addNouveauFavourites(int addId) { Globals value_user = null; value_user = Globals.getInstance(); HTTPRequest connect = new HTTPRequest(); connect.RequestFinished += new HTTPRequest.RequestFinishedEventHandler(this.doAddNouveauFavourites); connect.HttpPostRequest(value_user.IpAPI + "api/users/" + value_user.UserConnected + "/scores/favourites", "{ \"id\": " + addId + " }"); }
public ForgottenPasswordViewModel() { ForgottenPasswordCommandForgottenPasswordPage = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("ForgottenPasswordCommandForgottenPasswordPage click :)"); HTTPRequest connect = new HTTPRequest(); connect.RequestFinished += new HTTPRequest.RequestFinishedEventHandler(this.doForgotPass); Globals test_global = null; test_global = Globals.getInstance(); connect.HttpPostRequest(test_global.IpAPI + "api/forgotten_password", "{ \"email\":\"" + UserNameEmail + "\" }"); }); }
public AccountSelectedViewModel() { Messenger.Default.Register <User>(this, user_selected => { System.Diagnostics.Debug.WriteLine("###### recieved AccountSelected ######"); JsonTools test = new JsonTools(); _userID = user_selected.Id.ToString(); AccountInformationDisplay(); }); MyScoreCommandAccountSelectedPage = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("MyScoreCommandAccountSelectedPage click :)"); INavigationService navigationService = SimpleIoc.Default.GetInstance <INavigationService>(); Messenger.Default.Send(_user); navigationService.NavigateTo(ViewModelLocator.NavigationMyScoreSelectedView); }); MyFavouritesCommandAccountSelectedPage = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("MyFavouritesCommandAccountSelectedPage click :)"); INavigationService navigationService = SimpleIoc.Default.GetInstance <INavigationService>(); Messenger.Default.Send(_user); navigationService.NavigateTo(ViewModelLocator.NavigationMyFavouritesSelectedView); }); MyMuseCommandAccountSelectedPage = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("MyMuseCommandAccountSelectedPage click :)"); INavigationService navigationService = SimpleIoc.Default.GetInstance <INavigationService>(); Messenger.Default.Send(_user); navigationService.NavigateTo(ViewModelLocator.NavigationMyMuseSelectedView); }); MyFanCommandAccountSelectedPage = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("MyFanCommandAccountSelectedPage click :)"); INavigationService navigationService = SimpleIoc.Default.GetInstance <INavigationService>(); Messenger.Default.Send(_user); navigationService.NavigateTo(ViewModelLocator.NavigationMyFanSelectedView); }); LogOutCommandAccountSelectedPage = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("LogOutCommandPivotPage click :)"); HTTPRequest connect = new HTTPRequest(); connect.RequestFinished += new HTTPRequest.RequestFinishedEventHandler(this.doLogout); Globals test_global = null; test_global = Globals.getInstance(); connect.HttpPostRequest(test_global.IpAPI + "api/logout", ""); }); }
public ScoreSelectedViewModel() { Messenger.Default.Register <Score>(this, score => { score_selected = score; LocationPreview = score.LocationPreview; }); LogOutCommandScoreSelectedViewModel = new RelayCommand(() => { HTTPRequest connect = new HTTPRequest(); connect.RequestFinished += new HTTPRequest.RequestFinishedEventHandler(this.doLogout); Globals test_global = null; test_global = Globals.getInstance(); connect.HttpPostRequest(test_global.IpAPI + "api/logout", ""); }); }
public SignUpViewModel() { SignUpCommandSignUpPage = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("SignUpCommandSignUpPage click :)"); HTTPRequest connect = new HTTPRequest(); connect.RequestFinished += new HTTPRequest.RequestFinishedEventHandler(this.doConnection); JsonObject json = new JsonObject(); json.SetNamedValue("username", JsonValue.CreateStringValue(UserName)); json.SetNamedValue("email", JsonValue.CreateStringValue(UserNameEmail)); json.SetNamedValue("password", JsonValue.CreateStringValue(UserPassword)); System.Diagnostics.Debug.WriteLine(json.Stringify()); Globals test_global = null; test_global = Globals.getInstance(); connect.HttpPostRequest(test_global.IpAPI + "api/users", json.Stringify()); UserNameEmail = ""; UserPassword = ""; }); }
public MyScoreViewModel() { Messenger.Default.Register <String>(this, loginResponse => { _loginResponse = loginResponse; System.Diagnostics.Debug.WriteLine("###### recieved MyScore ######"); System.Diagnostics.Debug.WriteLine(_loginResponse); JsonTools test = new JsonTools(); _userID = test.JsonGetIdUser(_loginResponse); getListScoreUser(); }); SearchCommandMyScoreViewModel = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("SearchCommandMyScoreViewModel click :)"); INavigationService navigationService = SimpleIoc.Default.GetInstance <INavigationService>(); navigationService.NavigateTo(ViewModelLocator.NavigationSearchView); }); LogOutCommandMyScoreViewModel = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("LogOutCommandMyScoreViewModel click :)"); HTTPRequest connect = new HTTPRequest(); connect.RequestFinished += new HTTPRequest.RequestFinishedEventHandler(this.doLogout); Globals test_global = null; test_global = Globals.getInstance(); connect.HttpPostRequest(test_global.IpAPI + "api/logout", ""); }); SelectedScoreCommandMyScoreViewModel = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("Oui Search Score click :)"); Messenger.Default.Send(ScoreClick); INavigationService navigationService = SimpleIoc.Default.GetInstance <INavigationService>(); navigationService.NavigateTo(ViewModelLocator.NavigationScoreSelectedView); }); }
public LogInViewModel() { RememberMe = false; IReadOnlyList <PasswordCredential> data = RetriveCredential(); if (data != null) { foreach (var item in data) { item.RetrievePassword(); UserNameEmail = item.UserName; UserPassword = item.Password; } } SignInCommandLoginPage = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("SignInCommandLoginPage click :)"); HTTPRequest connect = new HTTPRequest(); connect.RequestFinished += new HTTPRequest.RequestFinishedEventHandler(this.doConnection); connect.HttpPostRequest("http://localhost/trunk/web/app_dev.php/api/login", "{ \"login\":\"" + this.UserNameEmail + "\",\n\"password\":\"" + this.UserPassword + "\" }"); }); CreateAccountCommandLoginPage = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("CreateAccountCommandLoginPage click :)"); INavigationService navigationService = SimpleIoc.Default.GetInstance <INavigationService>(); navigationService.NavigateTo(ViewModelLocator.NavigationSignUpView); }); ForgotPasswordCommandLoginPage = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("ForgotPasswordCommandLoginPage click :)"); INavigationService navigationService = SimpleIoc.Default.GetInstance <INavigationService>(); navigationService.NavigateTo(ViewModelLocator.NavigationForgottenPasswordView); }); }
public AccountViewModel() { Messenger.Default.Register <String>(this, loginResponse => { _loginResponse = loginResponse; System.Diagnostics.Debug.WriteLine("###### recieved AccountViewModel ######"); System.Diagnostics.Debug.WriteLine(_loginResponse); JsonTools test = new JsonTools(); _userID = test.JsonGetIdUser(_loginResponse); AccountInformationDisplay(); }); SearchCommandAccountViewModel = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("SearchCommandAccountViewModel click :)"); INavigationService navigationService = SimpleIoc.Default.GetInstance <INavigationService>(); navigationService.NavigateTo(ViewModelLocator.NavigationSearchView); }); LogOutCommandAccountViewModel = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("LogOutCommandAccountViewModel click :)"); HTTPRequest connect = new HTTPRequest(); connect.RequestFinished += new HTTPRequest.RequestFinishedEventHandler(this.doLogout); Globals test_global = null; test_global = Globals.getInstance(); connect.HttpPostRequest(test_global.IpAPI + "api/logout", ""); }); EditeProfileCommandAccountViewModel = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("AccountUpdateCommandAccountViewModel click :)"); INavigationService navigationService = SimpleIoc.Default.GetInstance <INavigationService>(); Messenger.Default.Send(_loginResponse); navigationService.NavigateTo(ViewModelLocator.NavigationAccountUpdateView); }); }
public SearchViewModel() { LogOutCommandSearchViewModel = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("LogOutCommandMyScoreViewModel click :)"); HTTPRequest connect = new HTTPRequest(); connect.RequestFinished += new HTTPRequest.RequestFinishedEventHandler(this.doLogout); Globals test_global = null; test_global = Globals.getInstance(); connect.HttpPostRequest(test_global.IpAPI + "api/logout", ""); }); SearchIconCommandSearchViewModel = new RelayCommand(() => { getListSearchScore(); getListSearchUser(); }); SelectedScoreCommandSearchViewModel = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("Oui Search Score click :)"); Messenger.Default.Send(ScoreClick); INavigationService navigationService = SimpleIoc.Default.GetInstance <INavigationService>(); navigationService.NavigateTo(ViewModelLocator.NavigationScoreSelectedView); }); SelectedUserCommandSearchViewModel = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("Oui Search User click :)"); Messenger.Default.Send(UserClick); INavigationService navigationService = SimpleIoc.Default.GetInstance <INavigationService>(); navigationService.NavigateTo(ViewModelLocator.NavigationAccountSelectedView); }); }
public void test_ok() { connect.HttpPostRequest("https://musicsheetwriter.tk/api/forgotten_password", "{ \"email\":\"[email protected]\" }"); Assert.AreEqual(HttpStatusCode.Ok, connect.StatusCode); }
public void test_ko_username_not_valid() { connect.HttpPostRequest("https://musicsheetwriter.tk/api/users", "{ \"username\":\"!§\",\n\"firstname\":\"simon\",\n\"lastname\":\"Daguenet\",\n\"email\":\"[email protected]\",\n\"password\":\"azerty123\" }"); Assert.AreEqual(HttpStatusCode.BadRequest, connect.StatusCode); }
public PivotViewModel() { Messenger.Default.Register <String>(this, loginResponse => { _loginResponse = loginResponse; System.Diagnostics.Debug.WriteLine("###### recieved Pivot ######"); System.Diagnostics.Debug.WriteLine(_loginResponse); JsonTools test = new JsonTools(); _userID = test.JsonGetIdUser(_loginResponse); Globals test_global = null; test_global = Globals.getInstance(); test_global.UserConnected = _userID; }); MyScoreCommandPivotPage = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("MyScoreCommandPivotPage click :)"); INavigationService navigationService = SimpleIoc.Default.GetInstance <INavigationService>(); Messenger.Default.Send(_loginResponse); navigationService.NavigateTo(ViewModelLocator.NavigationMyScoreView); }); MyFavouritesCommandPivotPage = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("MyFavouritesCommandPivotPage click :)"); INavigationService navigationService = SimpleIoc.Default.GetInstance <INavigationService>(); Messenger.Default.Send(_loginResponse); navigationService.NavigateTo(ViewModelLocator.NavigationMyFavouritesView); }); MyMuseCommandPivotPage = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("MyMuseCommandPivotPage click :)"); INavigationService navigationService = SimpleIoc.Default.GetInstance <INavigationService>(); Messenger.Default.Send(_loginResponse); navigationService.NavigateTo(ViewModelLocator.NavigationMyMuseView); }); MyFanCommandPivotPage = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("MyFanCommandPivotPage click :)"); INavigationService navigationService = SimpleIoc.Default.GetInstance <INavigationService>(); Messenger.Default.Send(_loginResponse); navigationService.NavigateTo(ViewModelLocator.NavigationMyFanView); }); SearchCommandSearchPage = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("SearchCommandSearchPage click :)"); INavigationService navigationService = SimpleIoc.Default.GetInstance <INavigationService>(); navigationService.NavigateTo(ViewModelLocator.NavigationSearchView); }); AccountCommandAccountPage = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("AccountCommandAccountPage click :)"); INavigationService navigationService = SimpleIoc.Default.GetInstance <INavigationService>(); navigationService.NavigateTo(ViewModelLocator.NavigationAccountView); }); LogOutCommandPivotPage = new RelayCommand(() => { System.Diagnostics.Debug.WriteLine("LogOutCommandPivotPage click :)"); HTTPRequest connect = new HTTPRequest(); connect.RequestFinished += new HTTPRequest.RequestFinishedEventHandler(this.doLogout); Globals test_global = null; test_global = Globals.getInstance(); connect.HttpPostRequest(test_global.IpAPI + "api/logout", ""); }); }
public void test_ok() { connect.HttpPostRequest("https://musicsheetwriter.tk/api/login", "{ \"login\":\"bob\",\n\"password\":\"qwerty123\" }"); Assert.AreEqual(HttpStatusCode.Ok, connect.StatusCode); }