예제 #1
0
        private void JFlatButton4_Click(object sender, EventArgs e)
        {
            CashierHome e1 = new CashierHome();

            e1.Show();
            this.Hide();
        }
예제 #2
0
        private void JThinButton2_Click(object sender, EventArgs e)
        {
            string UserName = jMetroTextBox3.TextName;
            string Password = jMetroTextBox4.TextName;

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

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

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

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