Exemplo n.º 1
0
        private void buttonretour_Click(object sender, EventArgs e)
        {
            this.Hide();
            accueil_delegue openform = new accueil_delegue();

            openform.Show();
        }
Exemplo n.º 2
0
        private void retourcr_Click(object sender, EventArgs e)
        {
            accueil_delegue openForm = new accueil_delegue();

            openForm.Show();
            this.Hide();
        }
Exemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            SqlConnection  connexion = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\CECILE\Documents\ppe3\ppe3\pratic.mdf;Integrated Security=True");
            string         query     = "Select * From Visiteur Where username = '******'and motdepasse = '" + passwordbox.Text.Trim() + "'";
            SqlDataAdapter sda       = new SqlDataAdapter(query, connexion);
            DataTable      dtbl      = new DataTable();

            sda.Fill(dtbl);
            if (dtbl.Rows.Count == 1)
            {
                usertype = dtbl.Rows[0][7].ToString();
                if (usertype == "visiteur")
                {
                    iduser    = dtbl.Rows[0][0].ToString();
                    username2 = dtbl.Rows[0][1].ToString();
                    username  = dtbl.Rows[0][9].ToString();
                    Form2 openform = new Form2();
                    this.Hide();
                    openform.Show();
                }

                else if (usertype == "delegue")
                {
                    iduser    = dtbl.Rows[0][0].ToString();
                    username2 = dtbl.Rows[0][1].ToString();
                    username  = dtbl.Rows[0][9].ToString();
                    accueil_delegue openform = new accueil_delegue();
                    this.Hide();
                    openform.Show();
                }

                else if (usertype == "resp")
                {
                    username = dtbl.Rows[0][9].ToString();
                    accueil_responsable openform = new accueil_responsable();
                    this.Hide();
                    openform.Show();
                }

                else
                {
                    MessageBox.Show("Mauvais identifiants, veuillez réessayer.");
                }
            }
        }