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

77 lines
1.7 KiB
C++

// DLG_SmsEmailFilt_Add.cpp : implementation file
//
#include "stdafx.h"
#include "corpsms.h"
#include "DLG_SmsEmailFilt_Add.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// DLG_SmsEmailFilt_Add dialog
DLG_SmsEmailFilt_Add::DLG_SmsEmailFilt_Add(CWnd* pParent /*=NULL*/)
: CDialog(DLG_SmsEmailFilt_Add::IDD, pParent)
{
//{{AFX_DATA_INIT(DLG_SmsEmailFilt_Add)
m_strName = _T("");
m_bEnable = FALSE;
//}}AFX_DATA_INIT
}
void DLG_SmsEmailFilt_Add::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(DLG_SmsEmailFilt_Add)
DDX_CBString(pDX, IDC_SMSEMAILFILT_NAME, m_strName);
DDV_MaxChars(pDX, m_strName, 48);
DDX_Check(pDX, IDC_SMSEMAILFILT_ADD_STATUS, m_bEnable);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(DLG_SmsEmailFilt_Add, CDialog)
//{{AFX_MSG_MAP(DLG_SmsEmailFilt_Add)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// DLG_SmsEmailFilt_Add message handlers
void DLG_SmsEmailFilt_Add::SetParam(CString strName,BOOL bEnable)
{
m_strName = strName;
m_bEnable = bEnable;
}
BOOL DLG_SmsEmailFilt_Add::OnInitDialog()
{
CDialog::OnInitDialog();
UpdateData(false);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void DLG_SmsEmailFilt_Add::OnOK()
{
if ( !UpdateData(true))
return ;
if ( m_strName.GetLength() <= 0 )
{
MessageBox( _T("通知条件不能为空,请输入!"),_T("错误"),MB_ICONWARNING );
GetDlgItem(IDC_SMSEMAILFILT_NAME)->SetFocus();
return;
}
CDialog::OnOK();
}