private void button_Click(object sender, RoutedEventArgs e) { try { if (nom.Text != "" && prenom.Text != "" && pass.Password != "" && pseudo.Text != "") { SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\bdd.mdf;Integrated Security=True"); SqlDataAdapter adapter = new SqlDataAdapter("Select Count(*) From Utilisateurs Where Pseudo='" + pseudo.Text + "'", con); DataTable table = new DataTable(); adapter.Fill(table); if (table.Rows[0][0].ToString() == "1") { //afficher acueil pseu_ext.Visibility = System.Windows.Visibility.Visible; } else { if (string.IsNullOrEmpty(nom.Text)) { champs.Visibility = System.Windows.Visibility.Visible; } else { if (pass.Password.Equals(confirm.Password)) { String query = "INSERT INTO Utilisateurs(Nom,Prenom,Pseudo,Mpasse)output INSERTED.Id_utilisateur VALUES ('" + nom.Text + "','" + prenom.Text + "','" + pseudo.Text + "','" + pass.Password + "')"; con.Open(); SqlCommand cmd = new SqlCommand(query, con); int id = 0; id = (int)cmd.ExecuteScalar(); if (con.State == System.Data.ConnectionState.Open) { con.Close(); } utilisateur user = new utilisateur(id, nom.Text, prenom.Text, pseudo.Text); acceuil win = new acceuil(user); win.Show(); this.Close(); } else { confirmation.Visibility = System.Windows.Visibility.Visible; } } } } else { champs.Visibility = Visibility.Visible; } } catch (SqlException ex) { MessageBox.Show(ex.Message); } }
public evenement(utilisateur user, acceuil home) { this.user = user; this.home = home; methodes m = new methodes(); this.list = m.event_list(user.getid_utilis()); InitializeComponent(); afficher(list); }
public activ(utilisateur user, acceuil page) { this.user = user; this.page = page; InitializeComponent(); list = new List <activ_class>(); methodes m = new methodes(); list = m.list_activ(user.getid_utilis()); afficher(list); }
public document_page(utilisateur user, acceuil page) { this.user = user; this.page = page; InitializeComponent(); list = new List <document>(); methodes m = new methodes(); list = m.afficher_doc(user.getid_utilis()); afficher(list); }
public list_taches(activ_class a, utilisateur user, activ act_page, acceuil ac_page) { this.activité = a; this.user = user; this.act_page = act_page; this.ac_page = ac_page; InitializeComponent(); nom_activité.Text = activité.get_designation(); methodes t = new methodes(); List <tache> tache = t.Afficher_Tache(activité.get_id(), activité.get_id_user()); this.list = tache; this.afficher(list); }
public docs_tache_events(int id_user, event_class eve, evenement events, acceuil home) { this.id_user = id_user; this.t = null; this.eve = eve; this.events = events; this.taches = null; this.home = home; InitializeComponent(); info.Text = eve.getDesig(); methodes m = new methodes(); list = m.docs_of_event(eve.getId(), id_user); afficher(list); }
public docs_tache_events(int id_user, tache t, list_taches taches, acceuil home) { this.id_user = id_user; this.t = t; this.eve = null; this.events = null; this.taches = taches; InitializeComponent(); info.Text = t.get_des(); this.home = home; methodes m = new methodes(); list = m.docs_of_tache(t.get_id(), id_user); afficher(list); }
private void connect_Click(object sender, RoutedEventArgs e) { methodes app = new methodes(); utilisateur user = app.login(pseudo.Text, pass.Password); if (user != null) { acceuil windo = new acceuil(user); windo.Show(); this.Close(); } else { error.Visibility = System.Windows.Visibility.Visible; } }