예제 #1
0
 private void phòngToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         conn.Open();
         // command
         SqlDataAdapter dta = new SqlDataAdapter("Select Count (*) From DANGNHAP ", conn);
         DataTable      dtb = new DataTable();
         dta.Fill(dtb);
         if (dtb.Rows[0][0].ToString() == "1")
         {
             this.Hide();
             phong tc = new phong();
             tc.Show();
         }
         else
         {
             this.Hide();
             DNNV tc = new DNNV();
             tc.Show();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Loi ket noi " + ex.Message, "Thong bao");// thong bao loi
     }
     conn.Close();
 }
예제 #2
0
        private void phòngToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Hide();
            phong tc = new phong();

            tc.Show();
        }