Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
            MyHome home = new MyHome();

            home.Show();
        }
Exemplo n.º 2
0
        private void button14_Click(object sender, EventArgs e)
        {
            this.Hide();
            MyHome mh = new MyHome();

            mh.Show();
        }
Exemplo n.º 3
0
        // the is code display the mainpage which is the myHome

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
            MyHome MyHome = new MyHome();

            MyHome.Show();
        }
Exemplo n.º 4
0
        private void button5_Click(object sender, EventArgs e)
        {
            // this code connect the applicathion to the Database,where he collect information inside the database
            SqlConnection con = new SqlConnection("Data Source=STANLEY\\SQLEXPRESS;Initial Catalog=MyDatabase;Integrated Security=True");

            con.Open();
            SqlCommand    cmd = new SqlCommand("select * from FastFood where Username = '******' and Password = '******' and LoginAs = '" + comboBox1.Text + "'", con);
            SqlDataReader dr;

            dr = cmd.ExecuteReader();

            int count = 0;

            while (dr.Read())
            {
                count += 1;
            }

            if (count == 1)
            {
                MessageBox.Show("Your Login was successful");

                this.Hide();
                MyHome myHome = new MyHome();
                myHome.Show();
            }
            else if (count > 0)
            {
                MessageBox.Show(" Try again once more");
            }
            else
            {
                MessageBox.Show("Wrong Username and Password");
            }
            // this code is to clear the text in the testBox
            textBox1.Clear();
            textBox2.Clear();
            comboBox1.Text = "";
        }
Exemplo n.º 5
0
        private void btnClose_Click(object sender, EventArgs e)
        {
            MyHome home = new MyHome();

            home.Show();
        }