void flock_ws_isUserLoginCheck(object sender, ServiceReference1.isLoginInDBCompletedEventArgs e) { if (e.Result) { this.img_check.Source = (ImageSource) new ImageSourceConverter().ConvertFromString("/FloK;component/error.png"); this.tb_create_error.Text = "The login you choose already exists, please try again"; } else { this.img_check.Source = (ImageSource) new ImageSourceConverter().ConvertFromString("/FloK;component/ok.png"); this.tb_create_error.Text = ""; } this.img_check.Visibility = Visibility.Visible; }
void flok_ws_isUserLogin(object sender, ServiceReference1.isLoginInDBCompletedEventArgs e) { // s'il est déjà en bdd if (e.Result) { this.img_check.Source = (ImageSource) new ImageSourceConverter().ConvertFromString("/FloK;component/error.png"); this.img_check.Visibility = Visibility.Visible; //afficher message d'erreur et ne laisser que le mail prérempli dedans this.tb_create_error.Text = "Please enter another login and check for it's availability"; this.tb_creation_login.Text = ""; this.tb_pw_create_1.Password = ""; this.tb_pw_create_2.Password = ""; } else { // send the informations flok_ws.CreateUserAsync(this.tb_creation_login.Text, this.tb_creation_email.Text, this.tb_pw_create_1.Password); flok_ws.CreateUserCompleted += flok_ws_isUserCreated; //if creation ok, redirect to login page and pre-enter the login with the new one } }