Example #1
0
        private void bconexion_Click(object sender, EventArgs e)
        {
            try
            {
                Form_index_ f = new Form_index_();
                con.Open();
                SqlCommand    cmd = new SqlCommand("select * from Employe where login='******' and mot_de_pass='******'", con);
                SqlDataReader dr  = cmd.ExecuteReader();

                if (dr.Read())
                {
                    if (dr[12].ToString() == "Admin")
                    {
                        f.Show();
                    }
                    else
                    {
                        f.Show();
                        //Form_index_.getFormindex.bupdate_employes.Visible = false;
                        Form_index_.getFormindex.bservice.Visible      = false;
                        Form_index_.getFormindex.bcongé.Visible        = false;
                        Form_index_.getFormindex.pnotification.Visible = false;
                    }
                }

                else
                {
                    MessageBox.Show("Login ou mot de pass est incorrect !");
                }

                con.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            //Mylogin = tlogin.Text;
        }
Example #2
0
 static void frm_formClosed(object sender, FormClosedEventArgs e)
 {
     frm_indx = null;
 }