private void simpleButton2_Click(object sender, EventArgs e) { int hangDangChon = gvDanhSachNhaCungCap.FocusedRowHandle; var value1 = gvDanhSachNhaCungCap.GetRowCellValue(hangDangChon, "MANHACC"); if (value1 != null) { var value2 = gvDanhSachNhaCungCap.GetRowCellValue(hangDangChon, "TENNHACC"); var value3 = gvDanhSachNhaCungCap.GetRowCellValue(hangDangChon, "DIACHI"); var value4 = gvDanhSachNhaCungCap.GetRowCellValue(hangDangChon, "DIENTHOAI"); var value5 = gvDanhSachNhaCungCap.GetRowCellValue(hangDangChon, "EMAIL"); frmNhaCungCap frm = new frmNhaCungCap(); frm.flag = false; frm.maNCC = value1 as string; frm.tenNCC = value2 as string; frm.diaChi = value3 as string; frm.sdt = value4 as string; frm.email = value5 as string; frm.ShowDialog(); ucNhaCungCap_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); } }
private void simpleButton3_Click(object sender, EventArgs e) { frmNhaCungCap frm = new frmNhaCungCap(); frm.flag = true; frm.ShowDialog(); ucNhaCungCap_Load(sender, e); }