// DLG_SP_See.cpp : implementation file // #include "stdafx.h" #include "corpsms.h" #include "DLG_SP_See.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // DLG_SP_See dialog DLG_SP_See::DLG_SP_See(CWnd* pParent /*=NULL*/) : CDialog(DLG_SP_See::IDD, pParent) { //{{AFX_DATA_INIT(DLG_SP_See) m_tBirthday = COleDateTime::GetCurrentTime(); //}}AFX_DATA_INIT m_bDZ = false; } void DLG_SP_See::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(DLG_SP_See) DDX_Control(pDX, IDC_SP_SEE_DZ, m_B_DZ); DDX_Text(pDX, IDC_SP_SEE_BL, m_strBL); DDX_Text(pDX, IDC_SP_SEE_MSG, m_strMsg); DDX_Text(pDX, IDC_SP_SEE_NAME, m_strName); DDX_Text(pDX, IDC_SP_SEE_PRICE, m_strPrice); DDX_Text(pDX, IDC_SP_SEE_SENDCOUNT, m_strSendCount); DDX_Text(pDX, IDC_SP_SEE_MOBILE, m_strMobile); DDX_DateTimeCtrl(pDX, IDC_SP_SEE_BBBIRTHDAY, m_tBirthday); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(DLG_SP_See, CDialog) //{{AFX_MSG_MAP(DLG_SP_See) ON_BN_CLICKED(IDC_SP_SEE_DZ, OnSpSeeDz) ON_BN_CLICKED(IDC_SP_SEE_TEST, OnSpSeeTest) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // DLG_SP_See message handlers BOOL DLG_SP_See::OnInitDialog() { CDialog::OnInitDialog(); if ( m_bDZ ) m_B_DZ.SetWindowText( _T("取消订阅") ); if ( m_strOperCmd == _T("XD") ) { GetDlgItem(IDC_SP_SEE_TEST)->ShowWindow(SW_HIDE); GetDlgItem(IDC_SP_SEE_BBBIRTHDAY_S)->ShowWindow(SW_SHOW); GetDlgItem(IDC_SP_SEE_BBBIRTHDAY)->ShowWindow(SW_SHOW); COleDateTime abc; BOOL btime = abc.ParseDateTime(m_strBirthday,VAR_DATEVALUEONLY); if ( abc.GetStatus() == COleDateTime::valid ) { m_tBirthday = abc; } if ( m_bDZ ) { GetDlgItem(IDC_SP_SEE_BBBIRTHDAY)->EnableWindow(false); } } UpdateData(false); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void DLG_SP_See::OnSpSeeDz() { if ( !UpdateData(true)) return; if ( m_strOperCmd == _T("XD") ) { if ( m_tBirthday>COleDateTime::GetCurrentTime() ) { MessageBox( _T("宝宝生日不能大于当前日期!") , _T("错误") , MB_ICONWARNING ); return ; } } if ( m_bDZ ) CDialog::EndDialog( SP_SEE_QXDZ ); else CDialog::EndDialog( SP_SEE_DZ ); } void DLG_SP_See::OnSpSeeTest() { CDialog::EndDialog( SP_SEE_TEST ); }