Example #1
0
        private void tim_Click(object sender, EventArgs e)
        {
            if (kq.kiemtraquyenuser(FormDangnhap.loginUsename, "sinhvien", "view") == true)
            {
                SinhVienRepositories sv = new SinhVienRepositories();
                string makhoa = "";
                string malop = "";
                if (khoa.SelectedItem == null) makhoa = "";
                else
                    makhoa = ((KeyValuePair<string, string>)khoa.SelectedItem).Value;
                if (lophoc.SelectedItem == null) malop = "";
                else malop = ((KeyValuePair<string, string>)lophoc.SelectedItem).Value;
                dataGridView1.DataSource = sv.findsv(masvt.Text.Trim(), makhoa, malop);
                /*  if (dataGridView1.RowCount > 0)
                      for (int i = 0; i < dataGridView1.RowCount; i++)
                          dataGridView1.Rows[i].Cells["Ma"].Value = "Bạn ko có quyền xem";*/
                dataGridView1.Refresh();

            }
            else
            {
                MessageBox.Show("Bạn không có quyền thực hiện lệnh này");
            }
        }