Esempio n. 1
0
        private void BACK_Click(object sender, EventArgs e)
        {
            this.Hide();
            AdminMain ad = new AdminMain();

            ad.Show();
        }
Esempio n. 2
0
        private void LG_BUT_Click(object sender, EventArgs e)
        {
            SqlConnection conn = new SqlConnection(connectionString);

            SqlCommand command = new SqlCommand();

            command.Connection = conn;
            conn.Open();
            command.CommandText = "Select UserType from emp where username ='******'and Password ='******' ; ";
            SqlDataReader reader = command.ExecuteReader();

            while (reader.Read())
            {
                type = reader["UserType"].ToString();
            }

            if (type.Equals("A"))
            {
                this.Hide();
                AdminMain AD = new AdminMain();
                AD.Show();
            }
            else if (type.Equals("E"))
            {
                this.Hide();
                UserMain2 us = new UserMain2(UserBox.Text);
                us.Show();
            }
            else
            {
                MessageBox.Show("WRONG USERNAME OR PASSWORD");
            }



            conn.Close();
        }