123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- // ShowHistoryClient.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ylgl.h"
- #include "ShowHistoryClient.h"
- #include "Booking2.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // ShowHistoryClient dialog
- ShowHistoryClient::ShowHistoryClient(CWnd* pParent /*=NULL*/)
- : CDialog(ShowHistoryClient::IDD, pParent)
- {
- //{{AFX_DATA_INIT(ShowHistoryClient)
- // NOTE: the ClassWizard will add member initialization here
- m_pos=0;
- //}}AFX_DATA_INIT
- }
- void ShowHistoryClient::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(ShowHistoryClient)
- DDX_Control(pDX, IDC_LIST1, m_List1);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(ShowHistoryClient, CDialog)
- //{{AFX_MSG_MAP(ShowHistoryClient)
- ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // ShowHistoryClient message handlers
- BOOL ShowHistoryClient::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- // TODO: Add extra initialization here m_poldclientarray g_oldclientarray
- CString str;
- int pos;
- for(int i=0; i<m_poldclientarray->GetSize (); i++)
- {
- pos=m_poldclientarray->ElementAt(i);
- str.Format("客人:%s 单号:%s", g_oldclientarray.ElementAt(pos).ElementAt(1)+g_oldclientarray.ElementAt(pos).ElementAt(2), g_oldclientarray.ElementAt(pos).ElementAt(0));
-
- if(m_List1.GetCount()%2)
- m_List1.AddEntry( str , g_gridcol1, m_List1.GetCount());
- else
- m_List1.AddEntry( str , g_gridcol2, m_List1.GetCount());
- #ifdef CHILD_VERSION
- m_yearposarray.Add(atoi(g_oldclientarray.ElementAt(pos).ElementAt(12)));
- #else
- m_yearposarray.Add(atoi(g_oldclientarray.ElementAt(pos).ElementAt(19)));
- #endif
- }
- m_List1.Invalidate ();
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void ShowHistoryClient::OnButton1()
- {
- // TODO: Add your control notification handler code here
- UpdateData();
- int pos= m_List1.GetCurSel() ;
- if(pos==-1)
- {
- AfxMessageBox("请先选中您要查看的订单", MB_ICONINFORMATION);return;
- }
- CString str,id;
- m_List1.GetText (pos, str);
- id=str.Right(str.GetLength()-str.Find("单号:")-5);
- Booking2 dlg;
- dlg.m_id = id;
- dlg.m_bModify =2;
- int g_nYearposTemp=g_nYearpos;
- g_nYearpos=m_yearposarray.ElementAt(pos);
- dlg.DoModal ();
- g_nYearpos=g_nYearposTemp;
- }
- void ShowHistoryClient::OnOK()
- {
- // TODO: Add extra validation here
- int pos= m_List1.GetCurSel() ;
- if(pos==-1)
- {
- AfxMessageBox("请先选中订单", MB_ICONINFORMATION);return;
- }
- m_pos=pos;
- CDialog::OnOK();
- }
|