CorpSms/DLG_Find_SmsLog.cpp
2025-02-27 16:58:16 +08:00

152 lines
3.5 KiB
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// DLG_Find_SmsLog.cpp : implementation file
//
#include "stdafx.h"
#include "corpsms.h"
#include "DLG_Find_SmsLog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// DLG_Find_SmsLog dialog
DLG_Find_SmsLog::DLG_Find_SmsLog(CWnd* pParent /*=NULL*/)
: CDialog(DLG_Find_SmsLog::IDD, pParent)
{
//{{AFX_DATA_INIT(DLG_Find_SmsLog)
m_strMsg = _T("");
m_strRecvNum = _T("");
m_strSendNum = _T("");
m_lStatus2 = -1;
m_TBegin = COleDateTime::GetCurrentTime();
m_TEnd = COleDateTime::GetCurrentTime();
//}}AFX_DATA_INIT
m_bFindStatus = true;
m_bShowTime = true;
m_TBegin2 = COleDateTime::GetCurrentTime();
m_TBegin2.SetTime(0, 0, 0);
m_TEnd2 = COleDateTime::GetCurrentTime();
m_TEnd2.SetTime(23, 59, 59);
}
void DLG_Find_SmsLog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(DLG_Find_SmsLog)
DDX_Control(pDX, IDD_FIND_SMSLOG_STATUS, m_L_Status);
DDX_Text(pDX, IDD_FIND_SMSLOG_MSG, m_strMsg);
DDV_MaxChars(pDX, m_strMsg, 24);
DDX_Text(pDX, IDD_FIND_SMSLOG_RECVNUM, m_strRecvNum);
DDV_MaxChars(pDX, m_strRecvNum, 24);
DDX_Text(pDX, IDD_FIND_SMSLOG_SENDNUM, m_strSendNum);
DDV_MaxChars(pDX, m_strSendNum, 24);
DDX_CBIndex(pDX, IDD_FIND_SMSLOG_STATUS, m_lStatus2);
DDX_DateTimeCtrl(pDX, IDD_FIND_SMSLOG_BEGIN, m_TBegin);
DDX_DateTimeCtrl(pDX, IDD_FIND_SMSLOG_END, m_TEnd);
DDX_DateTimeCtrl(pDX, IDD_FIND_SMSLOG_BEGIN2, m_TBegin2);
DDX_DateTimeCtrl(pDX, IDD_FIND_SMSLOG_END2, m_TEnd2);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(DLG_Find_SmsLog, CDialog)
//{{AFX_MSG_MAP(DLG_Find_SmsLog)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// DLG_Find_SmsLog message handlers
BOOL DLG_Find_SmsLog::OnInitDialog()
{
CDialog::OnInitDialog();
if ( !m_bShowTime )
{
GetDlgItem(IDD_FIND_SMSLOG_BEGIN)->EnableWindow(false);
GetDlgItem(IDD_FIND_SMSLOG_END)->EnableWindow(false);
}
if ( !m_bFindStatus )
{
GetDlgItem(IDD_FIND_SMSLOG_STATUS)->ShowWindow(SW_HIDE);
GetDlgItem(IDD_FIND_SMSLOG_STATUS_S)->ShowWindow(SW_HIDE);
}
m_L_Status.SetCurSel(0);
//m_TBegin = COleDateTime::GetCurrentTime();
//m_TEnd = COleDateTime::GetCurrentTime();
//m_lStatus2=0;
//UpdateData(false);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void DLG_Find_SmsLog::SetParam(BOOL bShowTime,BOOL bFindStatus)
{
m_bShowTime = bShowTime;
m_bFindStatus = bFindStatus;
}
void DLG_Find_SmsLog::OnOK()
{
if ( !UpdateData(true))
return ;
m_TBegin.SetTime(m_TBegin2.GetHour(), m_TBegin2.GetMinute(), m_TBegin2.GetSecond());
m_TEnd.SetTime(m_TEnd2.GetHour(), m_TEnd2.GetMinute(), m_TEnd2.GetSecond());
if ( m_TEnd<m_TBegin )
{
MessageBox( _T("<EFBFBD><EFBFBD>ѯ<EFBFBD><EFBFBD>ʼʱ<EFBFBD><EFBFBD><EFBFBD>С<EFBFBD>ڽ<EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"),_T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"),MB_ICONWARNING );
GetDlgItem(IDD_FIND_RECVSMS_BEGIN)->SetFocus();
return ;
}
switch( m_lStatus2 )
{
case 1:
m_lStatus=SEND_STATUS_SUB_OK;
break;
case 2:
m_lStatus=SEND_STATUS_SUB_FILT;
break;
case 3:
m_lStatus=SEND_STATUS_SUB_ERROR;
break;
case 4:
m_lStatus=SEND_STATUS_SUB_NUMNOSUP;
break;
case 5:
m_lStatus=SEND_STATUS_FILT_ERROR;
break;
case 6:
m_lStatus=SEND_STATUS_SEND_OK;
break;
case 7:
m_lStatus=SEND_STATUS_SEND_ERROR;
break;
case 8:
m_lStatus=SEND_STATUS_RECV_OK;
break;
case 9:
m_lStatus=SEND_STATUS_RECV_ERROR;
break;
default:
m_lStatus=-1;
break;
}
CDialog::OnOK();
}