Beispiel #1
0
 void CommandRegisterExecute(Window window)
 {
     if (User != null && Password != null && User.Length > 0 && Password.Length > 0)
     {
         if (serviceClient.CheckUserExist(User))
         {
             MessageBox.Show("Ce LOGIN existe déjà!");
         }
         else
         {
             serviceClient.CreateUser(User, Password);
             MessageBox.Show("Inscription réussie");
             View.MenuWindow MenuW = new View.MenuWindow();
             MenuW.Show();
             int           Id_User = serviceClient.SelectIdByLogin(User);
             MovieNET.User user_co = serviceClient.SelectOneUser(Id_User);
             Messenger.Default.Send(user_co);
             window.Hide();
         }
     }
     else
     {
         if (User == null || User.Length <= 0)
         {
             MessageBox.Show("Le champs LOGIN ne doit pas être vide!");
         }
         if (Password == null || Password.Length <= 0)
         {
             MessageBox.Show("Le champs PASSWORD ne doit pas être vide!");
         }
     }
 }
Beispiel #2
0
 public ProfilViewModel()
 {
     CommandUpdatePass = new RelayCommand(CommandUpdatePassExecute);
     CommandDeleteUser = new RelayCommand <Page>(CommandDeleteUserExecute);
     Messenger.Default.Register <MovieNET.User>(this, (user_co) =>
     {
         User_co            = user_co;
         MovieNET.User user = serviceClient.SelectOneUser(User_co.Id_user);
         user_name          = User_co.Login;
     });
 }