private void dashboard_button_Click(object sender, EventArgs e)
        {
            this.Hide();
            admin_page objadmpage = new admin_page();

            objadmpage.Show();
        }
Beispiel #2
0
        private void admin_login_button_Click(object sender, EventArgs e)
        {
            SqlConnection conn = new SqlConnection(@"Data Source=DESKTOP-43407LQ\SQLEXPRESS;Initial Catalog=kiyo;Integrated Security=True");

            // DO VALIDATION

            string         query = "SELECT * FROM Admins WHERE admin_id = '" + admin_id.Text.Trim() + "' AND admin_password = '******'";
            SqlDataAdapter sda   = new SqlDataAdapter(query, conn);
            DataTable      dta   = new DataTable();

            sda.Fill(dta);

            if (dta.Rows.Count == 1)
            {
                admin_page objadmin_page = new admin_page();
                this.Hide();
                objadmin_page.Show();
            }
            else
            {
                MessageBox.Show("Check your id and password!");
            }
        }