ShowHireReg2.cpp 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. // ShowHireReg2.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "ShowHireReg2.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // ShowHireReg2 dialog
  13. ShowHireReg2::ShowHireReg2(CWnd* pParent /*=NULL*/)
  14. : CDialog(ShowHireReg2::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(ShowHireReg2)
  17. m_radio = 0;
  18. //}}AFX_DATA_INIT
  19. }
  20. void ShowHireReg2::DoDataExchange(CDataExchange* pDX)
  21. {
  22. CDialog::DoDataExchange(pDX);
  23. //{{AFX_DATA_MAP(ShowHireReg2)
  24. DDX_Control(pDX, IDC_LIST2, m_List1);
  25. DDX_Radio(pDX, IDC_RADIO1, m_radio);
  26. //}}AFX_DATA_MAP
  27. }
  28. BEGIN_MESSAGE_MAP(ShowHireReg2, CDialog)
  29. //{{AFX_MSG_MAP(ShowHireReg2)
  30. ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
  31. ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
  32. //}}AFX_MSG_MAP
  33. END_MESSAGE_MAP()
  34. /////////////////////////////////////////////////////////////////////////////
  35. // ShowHireReg2 message handlers
  36. BOOL ShowHireReg2::OnInitDialog()
  37. {
  38. CDialog::OnInitDialog();
  39. // TODO: Add extra initialization here
  40. m_List1.SetHeadings("单号,120;客人,60;取件日,90;还件日,90;租/售,60;礼服,100;件数,60;是否收回,90;日期,90;经手人,80");
  41. m_List1.LoadColumnInfo (195);
  42. m_List1.m_bSortSupport =0;
  43. CString filter="[no]='"+m_no+"'";
  44. g_sendhead.bsql=0;
  45. g_sendhead.code[0]=191;
  46. g_sendhead.tabcount=1;
  47. g_pMainWnd->ProcessChatMessageRequest2(filter); CenterWindow();if(g_bSendOK==0)return 0;
  48. DataToArray(&m_List1array);
  49. FillGrid();
  50. return TRUE; // return TRUE unless you set the focus to a control
  51. // EXCEPTION: OCX Property Pages should return FALSE
  52. }
  53. void ShowHireReg2::FillGrid()
  54. {
  55. UpdateData();
  56. m_List1.DeleteAllItems2 ();
  57. int ii=0;
  58. m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
  59. int count=0;
  60. if(m_radio==0)
  61. {
  62. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  63. {
  64. if(m_List1array.ElementAt (ii).ElementAt (7)=="已还")
  65. continue;
  66. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  67. }
  68. }
  69. else
  70. {
  71. for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
  72. {
  73. m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
  74. }
  75. }
  76. m_List1.m_arLabels.SetSize(count, 1);
  77. ii=count;
  78. m_List1.m_LabelCount=ii;
  79. m_List1.SetItemCountEx (ii);
  80. }
  81. void ShowHireReg2::OnRadio1()
  82. {
  83. // TODO: Add your control notification handler code here
  84. FillGrid();
  85. }
  86. void ShowHireReg2::OnRadio2()
  87. {
  88. // TODO: Add your control notification handler code here
  89. FillGrid();
  90. }