Пример #1
0
 private void dataGridView_PhongBan_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     dataGridView_NhanVienTrongPhongBan.DataSource = null;
     dataGridView_CongViecCuaNhanVien.DataSource   = null;
     if (nvBLL.getNhanVienByIdPhongBan(dataGridView_PhongBan.CurrentRow.Cells[0].Value.ToString()).Count() > 0)
     {
         dataGridView_NhanVienTrongPhongBan.DataSource = nvBLL.getNhanVienByIdPhongBan(dataGridView_PhongBan.CurrentRow.Cells[0].Value.ToString());
         if (cvBLL.getCongViecByIdNhanVien(dataGridView_NhanVienTrongPhongBan.CurrentRow.Cells[0].Value.ToString()).Count() > 0)
         {
             dataGridView_CongViecCuaNhanVien.DataSource = cvBLL.getCongViecByIdNhanVien(dataGridView_NhanVienTrongPhongBan.CurrentRow.Cells[0].Value.ToString());
         }
     }
 }
 private void loadDataNhanVien()
 {
     tbTenNhanVien.Text = dataGridView_NhanVienTrongPhongBan.CurrentRow.Cells[1].Value.ToString();
     tbMaNhanVien.Text  = dataGridView_NhanVienTrongPhongBan.CurrentRow.Cells[0].Value.ToString();
     tbSoCongViec.Text  = cvBLL.getCongViecByIdNhanVien(dataGridView_NhanVienTrongPhongBan.CurrentRow.Cells[0].Value.ToString()).Count.ToString();
 }