SelWaiter2.cpp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. // SelWaiter2.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "SelWaiter2.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // SelWaiter2 dialog
  13. SelWaiter2::SelWaiter2(CWnd* pParent /*=NULL*/)
  14. : CDialog(SelWaiter2::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(SelWaiter2)
  17. beginno = 0;
  18. //}}AFX_DATA_INIT
  19. }
  20. void SelWaiter2::DoDataExchange(CDataExchange* pDX)
  21. {
  22. CDialog::DoDataExchange(pDX);
  23. //{{AFX_DATA_MAP(SelWaiter2)
  24. DDX_Control(pDX, IDC_COMBOwaiter1, m_combowaiter1);
  25. DDX_Control(pDX, IDC_COMBOwaiter2, m_combowaiter2);
  26. DDX_Control(pDX, IDC_COMBOwaiter12, m_combowaiter12);
  27. DDX_Control(pDX, IDC_COMBOwaiter22, m_combowaiter22);
  28. DDX_Text(pDX, IDC_EDIT1, beginno);
  29. //}}AFX_DATA_MAP
  30. }
  31. BEGIN_MESSAGE_MAP(SelWaiter2, CDialog)
  32. //{{AFX_MSG_MAP(SelWaiter2)
  33. //}}AFX_MSG_MAP
  34. END_MESSAGE_MAP()
  35. /////////////////////////////////////////////////////////////////////////////
  36. // SelWaiter2 message handlers
  37. BOOL SelWaiter2::OnInitDialog()
  38. {
  39. CDialog::OnInitDialog();
  40. #ifdef CHILD_VERSION
  41. GetDlgItem(IDC_STATIC1)->SetWindowText("引导师:");
  42. #endif
  43. // TODO: Add extra initialization here
  44. int pos=m_combowaiter1.FindString (0, waiter1);
  45. if(pos==-1)
  46. {
  47. m_combowaiter1.InsertString (0, waiter1);
  48. m_combowaiter1.SetCurSel (0);
  49. }
  50. else
  51. m_combowaiter1.SetCurSel (pos);
  52. pos=m_combowaiter12.FindString (0, waiter12);
  53. if(pos==-1)
  54. {
  55. m_combowaiter12.InsertString (0, waiter12);
  56. m_combowaiter12.SetCurSel (0);
  57. }
  58. else
  59. m_combowaiter12.SetCurSel (pos);
  60. pos=m_combowaiter2.FindString (0, waiter2);
  61. if(pos==-1)
  62. {
  63. m_combowaiter2.InsertString (0, waiter2);
  64. m_combowaiter2.SetCurSel (0);
  65. }
  66. else
  67. m_combowaiter2.SetCurSel (pos);
  68. pos=m_combowaiter22.FindString (0, waiter22);
  69. if(pos==-1)
  70. {
  71. m_combowaiter22.InsertString (0, waiter22);
  72. m_combowaiter22.SetCurSel (0);
  73. }
  74. else
  75. m_combowaiter22.SetCurSel (pos);
  76. return TRUE; // return TRUE unless you set the focus to a control
  77. // EXCEPTION: OCX Property Pages should return FALSE
  78. }
  79. void SelWaiter2::OnOK()
  80. {
  81. // TODO: Add extra validation here
  82. int pos=m_combowaiter1.GetCurSel ();
  83. if(pos!=-1)
  84. {
  85. m_combowaiter1.GetLBText (pos, waiter1);
  86. if ( waiter1 == "" )
  87. {
  88. AfxMessageBox("摄影师为必选项!");
  89. return;
  90. }
  91. }
  92. pos=m_combowaiter12.GetCurSel ();
  93. if(pos!=-1)
  94. {
  95. m_combowaiter12.GetLBText (pos, waiter12);
  96. }
  97. pos=m_combowaiter2.GetCurSel ();
  98. if(pos!=-1)
  99. {
  100. m_combowaiter2.GetLBText (pos, waiter2);
  101. if ( waiter2 == "" )
  102. {
  103. #ifdef CHILD_VERSION
  104. AfxMessageBox("引导师为必选项!");
  105. #else
  106. AfxMessageBox("化妆师为必选项!");
  107. #endif
  108. return;
  109. }
  110. }
  111. pos=m_combowaiter22.GetCurSel ();
  112. if(pos!=-1)
  113. {
  114. m_combowaiter22.GetLBText (pos, waiter22);
  115. }
  116. CDialog::OnOK();
  117. }