// HospitalMsgSet.cpp : implementation file // #include "stdafx.h" #include "ylgl.h" #include "HospitalMsgSet.h" #include "SetChildMsg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // HospitalMsgSet dialog HospitalMsgSet::HospitalMsgSet(CWnd* pParent /*=NULL*/) : CDialog(HospitalMsgSet::IDD, pParent) { //{{AFX_DATA_INIT(HospitalMsgSet) hospitalmsgcheck1 = FALSE; hospitalmsgcheck2 = FALSE; //}}AFX_DATA_INIT } void HospitalMsgSet::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(HospitalMsgSet) DDX_Check(pDX, IDC_CHECK1, hospitalmsgcheck1); DDX_Check(pDX, IDC_CHECK2, hospitalmsgcheck2); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(HospitalMsgSet, CDialog) //{{AFX_MSG_MAP(HospitalMsgSet) ON_BN_CLICKED(IDC_BUTTON1, OnButton1) ON_BN_CLICKED(IDC_BUTTON2, OnButton2) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // HospitalMsgSet message handlers BOOL HospitalMsgSet::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here hospitalmsgcheck1 = atoi(g_cominfoarray.ElementAt(0).ElementAt(123)); hospitalmsgcheck2 = atoi(g_cominfoarray.ElementAt(0).ElementAt(124)); UpdateData(false); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void HospitalMsgSet::OnButton1() { // TODO: Add your control notification handler code here SetChildMsg dlg; dlg.m_mode=1; dlg.DoModal (); } void HospitalMsgSet::OnButton2() { // TODO: Add your control notification handler code here SetChildMsg dlg; dlg.m_mode=2; dlg.DoModal (); } void HospitalMsgSet::OnOK() { // TODO: Add extra validation here UpdateData(); CString sql; sql.Format ("update version set [hospitalmsgcheck1]='%d',[hospitalmsgcheck2]='%d'", hospitalmsgcheck1, hospitalmsgcheck2); g_sendhead.bsql=1; g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return; AfxMessageBox("±£´æ³É¹¦!", MB_ICONINFORMATION); CString str; str.Format ("%d", hospitalmsgcheck1); g_cominfoarray.ElementAt(0).SetAt (123, str); str.Format ("%d", hospitalmsgcheck2); g_cominfoarray.ElementAt(0).SetAt (124, str); }