m_AdoConn.ExitConnect(); MessageBox(CString(\删除成功.\ m_grid.DeleteAllItems();//删除grid中原来的数据 CString str; str=\ AddToGrid(str);//重新遍历 } }
void CPatientDlg::OnBnClickedClear() { // TODO: 在此添加控件通知处理程序代码 m_age = _T(\ m_no = _T(\ m_idcard = _T(\ m_name = _T(\ m_nation = _T(\ m_native = _T(\ m_allergy = _T(\ m_phone = _T(\ m_sex = _T(\ UpdateData(false); }
void CPatientDlg::OnBnClickedSelect() { // TODO: 在此添加控件通知处理程序代码 m_grid.DeleteAllItems(); UpdateData(true); CString str1,str2; int num1; num1=m_combo.GetCurSel(); if(0==num1) { GetDlgItem(IDC_EDIT_CONTENT)->GetWindowText(str1); str2=CString(\from patient where \
patientno like
37
AddToGrid(str2);// 遍历功能信息记录 } if(1==num1) { GetDlgItem(IDC_EDIT_CONTENT)->GetWindowText(str1); str2=CString(\ AddToGrid(str2);// 遍历功能信息记录 } if(2==num1) { GetDlgItem(IDC_EDIT_CONTENT)->GetWindowText(str1); str2=CString(\ AddToGrid(str2);// 遍历功能信息记录 } if(3==num1) { GetDlgItem(IDC_EDIT_CONTENT)->GetWindowText(str1); str2=\ AddToGrid(str2);// 遍历功能信息记录 } }
void CPatientDlg::OnNMClickListPatient(NMHDR *pNMHDR, LRESULT *pResult) { LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast
38
m_sex=m_grid.GetItemText(nItem,2); m_age=m_grid.GetItemText(nItem,3); m_native=m_grid.GetItemText(nItem,4); m_nation=m_grid.GetItemText(nItem,5); m_allergy=m_grid.GetItemText(nItem,6); m_idcard=m_grid.GetItemText(nItem,7); m_phone=m_grid.GetItemText(nItem,8); UpdateData(FALSE);//更新对话框 } *pResult = 0; }
// EmployeeDlg.cpp : 实现文件 //人员管理:吴婷
#include \#include \
#include \#include \#include \
// CEmployeeDlg 对话框
IMPLEMENT_DYNAMIC(CEmployeeDlg, CDialogEx)
CEmployeeDlg::CEmployeeDlg(CWnd* pParent /*=NULL*/) : CDialogEx(CEmployeeDlg::IDD, pParent) { m_age = _T(\ m_content = _T(\ m_idcard = _T(\ m_name = _T(\ m_nation = _T(\ m_native = _T(\ m_number = _T(\ m_office = _T(\ m_phone = _T(\ m_position = _T(\ m_sex = _T(\}
39
CEmployeeDlg::~CEmployeeDlg() { }
void CEmployeeDlg::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); DDX_Text(pDX, IDC_EDIT_AGE, m_age); DDX_Text(pDX, IDC_EDIT_CONTENT, m_content); DDX_Text(pDX, IDC_EDIT_IDCARD, m_idcard); DDX_Text(pDX, IDC_EDIT_NAME, m_name); DDX_Text(pDX, IDC_EDIT_NATION, m_nation); DDX_Text(pDX, IDC_EDIT_NATIVE, m_native); DDX_Text(pDX, IDC_EDIT_NUMBER, m_number); DDX_Text(pDX, IDC_EDIT_OFFICE, m_office); DDX_Text(pDX, IDC_EDIT_PHONE, m_phone); DDX_Text(pDX, IDC_EDIT_POSITION, m_position); DDX_Text(pDX, IDC_EDIT_SEX, m_sex); DDX_Control(pDX, IDC_LIST_EMPLOYEE, m_grid); DDX_Control(pDX, IDC_COMBO1, m_combo); }
BEGIN_MESSAGE_MAP(CEmployeeDlg, CDialogEx) ON_BN_CLICKED(IDOK, &CEmployeeDlg::OnBnClickedOk) ON_BN_CLICKED(IDC_CHANGE, &CEmployeeDlg::OnBnClickedChange) ON_BN_CLICKED(IDC_DELETE, &CEmployeeDlg::OnBnClickedDelete) ON_BN_CLICKED(IDC_CLEAR, &CEmployeeDlg::OnBnClickedClear) ON_BN_CLICKED(IDC_SELECT, &CEmployeeDlg::OnBnClickedSelect) ON_NOTIFY(NM_CLICK, IDC_LIST_EMPLOYEE, &CEmployeeDlg::OnNMClickListEmployee) END_MESSAGE_MAP()
// CEmployeeDlg 消息处理程序
BOOL CEmployeeDlg::OnInitDialog() { CDialogEx::OnInitDialog(); // TODO: 在此添加额外的初始化 m_grid.SetExtendedStyle(LVS_EX_FLATSB |LVS_EX_FULLROWSELECT
40