Exemplo n.º 1
0
        private void sinhViênToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            FrmInSinhVien frm = new FrmInSinhVien();

            frm.Ten   = txtname.Text;
            frm.Quyen = txtquyen.Text;
            frm.ShowDialog();
        }
Exemplo n.º 2
0
 private void txtinan_Click(object sender, EventArgs e)
 {
     //FrmInSinhVien frm = new FrmInSinhVien();
     //frm.ShowDialog();
     //---
     ketnoi.OpenCn();
     if (cbchon.Text == "Mã SV" && txtnhaptk.Text != "")
     {
         FrmInSinhVien frm = new FrmInSinhVien();
         frm.Mssv = txtnhaptk.Text;
         frm.tktheoMaSV(sender, e);
         frm.ShowDialog();
     }
     else
     {
         if (cbchon.Text == "Tên SV" && txtnhaptk.Text != "")
         {
             FrmInSinhVien frm = new FrmInSinhVien();
             frm.Ten = txtnhaptk.Text;
             frm.tktheoTensv(sender, e);
             frm.ShowDialog();
         }
         else
         {
             if (cbchon.Text == "Mã Trường" && txtnhaptk.Text != "")
             {
                 FrmInSinhVien frm = new FrmInSinhVien();
                 frm.Truong = txtnhaptk.Text;
                 frm.tktheoTruong(sender, e);
                 frm.ShowDialog();
             }
             else
             {
                 if (cbchon.Text == "Mã Phòng" && txtnhaptk.Text != "")
                 {
                     FrmInSinhVien frm = new FrmInSinhVien();
                     frm.Phong = txtnhaptk.Text;
                     frm.tktheoPhong(sender, e);
                     frm.ShowDialog();
                 }
                 else
                 {
                     MessageBox.Show("Bạn hãy nhập thông tin cần tìm", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                     txtnhaptk.Select();
                 }
             }
         }
     }
     //---
 }
Exemplo n.º 3
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (cbmasv.Text != "")
     {
         SqlDataReader dr = ketnoi.ThuchienReader(select);
         Boolean       kt = false;
         if (dr != null)
         {
             while (dr.Read())
             {
                 if (dr.GetString(0) == cbmasv.Text)
                 {
                     kt = true;
                 }
             }
         }
         dr.Close();
         dr.Dispose();
         if (kt == false)
         {
             MessageBox.Show("Mã sinh viên không tồn tại, vui lòng nhập đúng Mã cần in!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             FrmInSinhVien frm = new FrmInSinhVien();
             frm.Mssv = cbmasv.Text;
             frm.Inthesinhvien(sender, e);
             frm.ShowDialog();
         }
     }
     else
     {
         MessageBox.Show("Bạn hãy chọn mã sinh viên để in!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         cbmasv.Select();
     }
 }