Exemple #1
0
 private void TBIdAdminS_TextChanged(object sender, TextChangedEventArgs e)
 {
     TBIdAdminS.Text = saisieFloat(sender);
     if (!TBIdAdminS.Text.Equals(""))
     {
         TBNomAdminS.Text     = Requettes.GetNomFromIdAdmin(TBIdAdminS.Text);
         TBLoginAdminS.Text   = Requettes.GetLoginFromIdAdmin(TBIdAdminS.Text);
         TBMdpAdminS.Password = Requettes.GetMdpFromIdAdmin(TBIdAdminS.Text);
         String role = Requettes.GetRoleFromIdAdmin(TBIdAdminS.Text);
         if (role.Equals("Administrateur"))
         {
             CBRoleAdminS.SelectedIndex = 0;
         }
         if (role.Equals("Gestionnaire"))
         {
             CBRoleAdminS.SelectedIndex = 1;
         }
         if (role.Equals("Utilisateur"))
         {
             CBRoleAdminS.SelectedIndex = 2;
         }
     }
     if (TBIdAdminS.Text.Equals(""))
     {
         TBIdAdminS.Background    = Brushes.White;
         TBIdAdminS.Text          = "";
         TBNomAdminS.Text         = "";
         TBLoginAdminS.Text       = "";
         TBMdpAdminS.Password     = "";
         TBAfficherMdpAdminS.Text = "";
     }
     else
     {
         if (Requettes.IdExiste(TBIdAdminS.Text) == 0)
         {
             TBIdAdminS.Background = Brushes.Bisque;
         }
         else
         {
             TBIdAdminS.Background = Brushes.GreenYellow;
         }
     }
 }