123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- // DataOpt.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ylgl.h"
- #include "DataOption.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // DataOpt dialog
- DataOpt::DataOpt(CWnd* pParent /*=NULL*/)
- : CDialog(DataOpt::IDD, pParent)
- {
- //{{AFX_DATA_INIT(DataOpt)
- m_check1 = FALSE;
- m_radio1 = 0;
- //}}AFX_DATA_INIT
- }
- void DataOpt::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(DataOpt)
- DDX_Control(pDX, IDC_COMBO2, m_combo2);
- DDX_Control(pDX, IDC_COMBO1, m_combo1);
- DDX_Check(pDX, IDC_CHECK1, m_check1);
- DDX_Radio(pDX, IDC_RADIO1, m_radio1);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(DataOpt, CDialog)
- //{{AFX_MSG_MAP(DataOpt)
- ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
- ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // DataOpt message handlers
- BOOL DataOpt::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- // TODO: Add extra initialization here
- #ifdef ENTERPRISE_VERSION
- for(int i=0; i<g_brancharray.GetSize (); i++)
- {
- m_combo1.AddString (g_brancharray.ElementAt (i).ElementAt (0));
- }
- if(g_brancharray.GetSize ()==0)m_combo1.AddString ("本店");
- #else
- m_combo1.AddString ("本店");
- #endif
- m_combo1.SetCurSel(0);
- for(int i=0; i<g_hisyeararray.GetSize (); i++)
- {
- m_combo2.AddString (g_hisyeararray.ElementAt (i).ElementAt (0));
- }
- if(m_combo2.GetCount()>m_year && m_radio1)
- m_combo2.SetCurSel(m_year);
-
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void DataOpt::OnOK()
- {
- // TODO: Add extra validation here
- UpdateData();
- if(m_radio1==1)
- {
- m_year=m_combo2.GetCurSel();
- if(m_year==-1)
- {
- AfxMessageBox("请选中历史年份!", MB_ICONINFORMATION);
- return;
- }
- }
- else
- m_year=-1;
-
- CDialog::OnOK();
- }
- void DataOpt::OnRadio1()
- {
- // TODO: Add your control notification handler code here
- m_combo2.SetCurSel(-1);
- }
- void DataOpt::OnRadio2()
- {
- // TODO: Add your control notification handler code here
- if(m_combo2.GetCount())
- {UpdateData();
- m_combo2.SetCurSel(0);
- m_check1=1;
- UpdateData(0);
- }
- }
|