Esempio n. 1
0
        private void button6_Click(object sender, EventArgs e)
        {
            this.Hide();
            first_page fs = new first_page();

            fs.Show();
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string fm_user = user.Text, fm_pass = pass.Text;
            string db_user = "", db_pass = "";

            try{
                if (fm_user == "")
                {
                    MessageBox.Show("Please insert it !!");
                }
                else
                {
                    string        query = "select username, password from log_in where username='******' and password='******' ";
                    SqlDataReader dr    = db.connect_select(query);

                    while (dr.Read())
                    {
                        db_user = dr.GetString(0);
                        db_pass = dr.GetString(1);
                    }
                    if (db_user.Equals(fm_user) && db_pass.Equals(fm_pass))
                    {
                        MessageBox.Show("Login copmlited !!");
                        this.Hide();
                        user.Text = "";
                        pass.Text = "";
                        first_page fs = new first_page();
                        fs.Show();
                    }
                    else
                    {
                        MessageBox.Show("Login Error !!");
                        user.Text = "";
                        pass.Text = "";
                    }
                }
            }
            catch (Exception ex) {
                MessageBox.Show(ex.ToString());
            }
        }