private void cbbMaNV_SelectedIndexChanged(object sender, EventArgs e) { try { int maNv = int.Parse(cbbMaNV.Text); DataTable InfoNV = doan.getInfoNV(maNv); tbHoTen.Text = InfoNV.Rows[0]["TenNV"].ToString(); } catch (Exception) { } }
private void btChonNV_Click(object sender, EventArgs e) { int manv = int.Parse(cbbMaNV.Text); string nhiemvu = cbbNhiemVu.Text; DataTable nv = doan.getInfoNV(manv); string tenNV = nv.Rows[0]["TenNV"].ToString(); DataTable NhiemVu = doan.GetMaNhiemVU(nhiemvu); int MaNhiemVu = int.Parse(NhiemVu.Rows[0]["MaNhiemVu"].ToString()); dgvNV.Rows.Add(manv, tenNV, nhiemvu, MaNhiemVu); }
private void btChonNV_Click(object sender, EventArgs e) { int manv = int.Parse(cbbMaNV.Text); DataTable t = doan.getInfoNV(manv); string tenNV = t.Rows[0]["TenNV"].ToString(); DataRow row = tbNV.NewRow(); row[0] = manv; row[1] = tenNV; string tenNhiemVu = cbbNhiemVu.Text; DataTable MaNhiemvu = doan.GetMaNhiemVU(tenNhiemVu); int maNhiemVu = int.Parse(MaNhiemvu.Rows[0]["MaNhiemVu"].ToString()); row[2] = maNhiemVu; row[3] = cbbNhiemVu.Text; tbNV.Rows.Add(row); dgvNV.DataSource = tbNV; }