Пример #1
0
        private void home_Click(object sender, EventArgs e)
        {
            dashboard ra = new dashboard();

            ra.Show();
            this.Hide();
        }
Пример #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            dashboard nh = new dashboard();

            nh.Show();
            this.Hide();
        }
Пример #3
0
        private void login_Click(object sender, EventArgs e)
        {
            if (attempt == 0)
            {
                lbl_Msg.Text = "ALL 3 ATTEMPTS HAVE FAILED - CONTACT ADMIN";
                return;
            }
            SqlConnection con = new SqlConnection(constring);

            con.Open();
            SqlDataAdapter mm = new SqlDataAdapter("select count (*) from reg where username ='******' and password='******'", con);
            DataTable      dt = new DataTable();

            mm.Fill(dt);

            //else
            // {
            //   MessageBox.Show("please enter correct username and password", "alert", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //  }



            if (dt.Rows[0][0].ToString() == "1")
            {
                logo.Image = new Bitmap(@"C: \Users\TEMITOPE OLUTADE PC\Documents\Visual Studio 2017\Projects\HALLRENTAL\granted.jpg");
                MessageBox.Show("YOU ARE GRANTED WITH ACCESS");
                dashboard orp = new dashboard();
                orp.Show();
                this.Hide();
            }

            else
            {
                logo.Image = new Bitmap(@"C: \Users\TEMITOPE OLUTADE PC\Documents\Visual Studio 2017\Projects\HALLRENTAL\denied2.jpg");
                MessageBox.Show("YOU ARE NOT GRANTED WITH ACCESS");
                lbl_Msg.Text = ("You Have Only " + Convert.ToString(attempt) + " Attempt Left To Try");
                --attempt;
                this.username.Text = " ";
                this.password.Text = " ";
            }
            con.Close();
        }