Esempio n. 1
0
        private void jFlatButton4_Click(object sender, EventArgs e)
        {
            ExecutiveHome e1 = new ExecutiveHome();

            e1.Show();
            this.Hide();
        }
Esempio n. 2
0
        private void JThinButton2_Click(object sender, EventArgs e)
        {
            string UserName = jMetroTextBox1.TextName;
            string Password = jMetroTextBox2.TextName;

            SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=D:\ESOFT\esoftDB.mdf;Integrated Security=True;Connect Timeout=30");
            string        qry = "SELECT * FROM Executive WHERE UserName='******' AND Password='******'";
            SqlCommand    cmd = new SqlCommand(qry, con);

            try
            {
                con.Open();
                SqlDataReader sdr = cmd.ExecuteReader();

                if (sdr.Read())
                {
                    ExecutiveHome e1 = new ExecutiveHome();
                    e1.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Incorect User Name or Password");

                    jMetroTextBox1.TextName = null;
                    jMetroTextBox2.TextName = null;
                }
            }
            catch (SqlException se)
            {
                MessageBox.Show("" + se);
            }
        }