private void btnBacktoHome_Click(object sender, EventArgs e)
        {
            this.Hide();
            HmsHomepage ss = new HmsHomepage();

            ss.Show();
        }
Пример #2
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            this.Hide();
            HmsHomepage ss = new HmsHomepage();

            ss.Show();
        }
Пример #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            SqlConnection  con  = new SqlConnection("Data Source=.;Initial Catalog=SWENDatabase;Integrated Security=True");
            SqlDataAdapter sda  = new SqlDataAdapter("Select position FROM userMan where username = '******' and password ='******'", con);
            SqlDataAdapter sda1 = new SqlDataAdapter("Select Count(*) From userMan where username='******' and password = '******'", con);
            DataTable      dt   = new DataTable();

            sda.Fill(dt);
            sda1.Fill(dt);
            if (dt.Rows[0][0].ToString() == "Administrator")
            {
                this.Hide();
                HmsHomepage ss = new HmsHomepage();
                ss.Show();
            }
            else if (dt.Rows[0][0].ToString() != "Administrator")
            {
                this.Hide();
                HmsHomepageUser ss = new HmsHomepageUser();
                ss.Show();
            }
        }