Exemplo n.º 1
0
        private void btn_login_Click(object sender, EventArgs e)
        {
            if (textBox_userName.Text != "" && textBox_password.Text != "")
            {
                ClassDB2 db = new ClassDB2();
                db.ConnectDb();
                string  Query = ("select * from login where name ='" + textBox_userName.Text + "' and password='******'");
                DataSet DS    = new DataSet();
                DS = db.SetectDB(Query, "login");

                if (DS.Tables["login"].Rows.Count > 0)
                {
                    Form_main.getMainForm.control1.Enabled = true;
                    Form_main.getMainForm.heder1.Enabled   = true;
                    Form_queryDevices f = new Form_queryDevices();
                    // f.Location = new Point(20, 20);


                    f.Show();

                    ((Form)this.TopLevelControl).Close();
                    this.Close();
                }
                else
                {
                    label_error.Text = "Your Name or your password not valid";
                }
            }
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form_queryDevices f = new Form_queryDevices();

            // f.Location = new Point(20, 20);


            f.Show();

            ((Form)this.TopLevelControl).Close();
        }