private void simpleButton3_Click(object sender, EventArgs e) { frmNhanVien frm = new frmNhanVien(); frm.flag = true; frm.ShowDialog(); ucNhanVien_Load(sender, e); }
private void simpleButton2_Click(object sender, EventArgs e) { int hangDangChon = gvDanhSachNhanVien.FocusedRowHandle; var value1 = gvDanhSachNhanVien.GetRowCellValue(hangDangChon, "MANV"); if (value1 != null) { var value2 = gvDanhSachNhanVien.GetRowCellValue(hangDangChon, "TENNV"); var value3 = gvDanhSachNhanVien.GetRowCellValue(hangDangChon, "NGAYSINH"); var value4 = gvDanhSachNhanVien.GetRowCellValue(hangDangChon, "GIOITINH"); var value5 = gvDanhSachNhanVien.GetRowCellValue(hangDangChon, "SOCMND"); var value6 = gvDanhSachNhanVien.GetRowCellValue(hangDangChon, "LUONGCOBAN"); var value7 = gvDanhSachNhanVien.GetRowCellValue(hangDangChon, "CHUCVU"); var value8 = gvDanhSachNhanVien.GetRowCellValue(hangDangChon, "DIACHI"); var value9 = gvDanhSachNhanVien.GetRowCellValue(hangDangChon, "SDT"); frmNhanVien frm = new frmNhanVien(); frm.flag = false; frm.maNV = value1 as string; frm.tenNV = value2 as string; frm.ngaySinh = (DateTime)value3; frm.gioiTinh = value4 as string; frm.soCMND = value5 as string; frm.luongcoban = (int)value6; frm.chucVu = value7 as string; frm.diaChi = value8 as string; frm.sdt = value9 as string; frm.ShowDialog(); ucNhanVien_Load(sender, e); } else { XtraMessageBox.Show("Bạn chưa chọn đối tượng cần chỉnh sửa", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }