123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- // ShowHireReg2.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ylgl.h"
- #include "ShowHireReg2.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // ShowHireReg2 dialog
- ShowHireReg2::ShowHireReg2(CWnd* pParent /*=NULL*/)
- : CDialog(ShowHireReg2::IDD, pParent)
- {
- //{{AFX_DATA_INIT(ShowHireReg2)
- m_radio = 0;
- //}}AFX_DATA_INIT
- }
- void ShowHireReg2::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(ShowHireReg2)
- DDX_Control(pDX, IDC_LIST2, m_List1);
- DDX_Radio(pDX, IDC_RADIO1, m_radio);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(ShowHireReg2, CDialog)
- //{{AFX_MSG_MAP(ShowHireReg2)
- ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
- ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // ShowHireReg2 message handlers
- BOOL ShowHireReg2::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- // TODO: Add extra initialization here
- m_List1.SetHeadings("单号,120;客人,60;取件日,90;还件日,90;租/售,60;礼服,100;件数,60;是否收回,90;日期,90;经手人,80");
- m_List1.LoadColumnInfo (195);
- m_List1.m_bSortSupport =0;
-
- CString filter="[no]='"+m_no+"'";
- g_sendhead.bsql=0;
- g_sendhead.code[0]=191;
- g_sendhead.tabcount=1;
- g_pMainWnd->ProcessChatMessageRequest2(filter); CenterWindow();if(g_bSendOK==0)return 0;
- DataToArray(&m_List1array);
- FillGrid();
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void ShowHireReg2::FillGrid()
- {
- UpdateData();
- m_List1.DeleteAllItems2 ();
- int ii=0;
- m_List1.m_arLabels.SetSize( m_List1array.GetSize (), 1 );
- int count=0;
- if(m_radio==0)
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- if(m_List1array.ElementAt (ii).ElementAt (7)=="已还")
- continue;
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- }
- }
- else
- {
- for(ii=0; ii<m_List1.m_arLabels.GetSize (); ii++)
- {
- m_List1.m_arLabels.ElementAt (count++).Copy (m_List1array.ElementAt (ii));
- }
- }
- m_List1.m_arLabels.SetSize(count, 1);
- ii=count;
- m_List1.m_LabelCount=ii;
- m_List1.SetItemCountEx (ii);
-
- }
- void ShowHireReg2::OnRadio1()
- {
- // TODO: Add your control notification handler code here
- FillGrid();
- }
- void ShowHireReg2::OnRadio2()
- {
- // TODO: Add your control notification handler code here
- FillGrid();
- }
|