HospitalMsgSet.cpp 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. // HospitalMsgSet.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "HospitalMsgSet.h"
  6. #include "SetChildMsg.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // HospitalMsgSet dialog
  14. HospitalMsgSet::HospitalMsgSet(CWnd* pParent /*=NULL*/)
  15. : CDialog(HospitalMsgSet::IDD, pParent)
  16. {
  17. //{{AFX_DATA_INIT(HospitalMsgSet)
  18. hospitalmsgcheck1 = FALSE;
  19. hospitalmsgcheck2 = FALSE;
  20. //}}AFX_DATA_INIT
  21. }
  22. void HospitalMsgSet::DoDataExchange(CDataExchange* pDX)
  23. {
  24. CDialog::DoDataExchange(pDX);
  25. //{{AFX_DATA_MAP(HospitalMsgSet)
  26. DDX_Check(pDX, IDC_CHECK1, hospitalmsgcheck1);
  27. DDX_Check(pDX, IDC_CHECK2, hospitalmsgcheck2);
  28. //}}AFX_DATA_MAP
  29. }
  30. BEGIN_MESSAGE_MAP(HospitalMsgSet, CDialog)
  31. //{{AFX_MSG_MAP(HospitalMsgSet)
  32. ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
  33. ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
  34. //}}AFX_MSG_MAP
  35. END_MESSAGE_MAP()
  36. /////////////////////////////////////////////////////////////////////////////
  37. // HospitalMsgSet message handlers
  38. BOOL HospitalMsgSet::OnInitDialog()
  39. {
  40. CDialog::OnInitDialog();
  41. // TODO: Add extra initialization here
  42. hospitalmsgcheck1 = atoi(g_cominfoarray.ElementAt(0).ElementAt(123));
  43. hospitalmsgcheck2 = atoi(g_cominfoarray.ElementAt(0).ElementAt(124));
  44. UpdateData(false);
  45. return TRUE; // return TRUE unless you set the focus to a control
  46. // EXCEPTION: OCX Property Pages should return FALSE
  47. }
  48. void HospitalMsgSet::OnButton1()
  49. {
  50. // TODO: Add your control notification handler code here
  51. SetChildMsg dlg;
  52. dlg.m_mode=1;
  53. dlg.DoModal ();
  54. }
  55. void HospitalMsgSet::OnButton2()
  56. {
  57. // TODO: Add your control notification handler code here
  58. SetChildMsg dlg;
  59. dlg.m_mode=2;
  60. dlg.DoModal ();
  61. }
  62. void HospitalMsgSet::OnOK()
  63. {
  64. // TODO: Add extra validation here
  65. UpdateData();
  66. CString sql;
  67. sql.Format ("update version set [hospitalmsgcheck1]='%d',[hospitalmsgcheck2]='%d'", hospitalmsgcheck1, hospitalmsgcheck2);
  68. g_sendhead.bsql=1;
  69. g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return;
  70. AfxMessageBox("±£´æ³É¹¦!", MB_ICONINFORMATION);
  71. CString str;
  72. str.Format ("%d", hospitalmsgcheck1);
  73. g_cominfoarray.ElementAt(0).SetAt (123, str);
  74. str.Format ("%d", hospitalmsgcheck2);
  75. g_cominfoarray.ElementAt(0).SetAt (124, str);
  76. }