// DLG_BAK.cpp : implementation file
//

#include "stdafx.h"
#include "corpsms.h"
#include "DLG_BAK.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// DLG_BAK dialog


DLG_BAK::DLG_BAK(CWnd* pParent /*=NULL*/)
	: CDialog(DLG_BAK::IDD, pParent)
{
	//{{AFX_DATA_INIT(DLG_BAK)
	m_strCount = _T("");
	m_strTitle = _T("");
	//}}AFX_DATA_INIT
	m_lRecordCount = 0;
}


void DLG_BAK::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(DLG_BAK)
	DDX_Text(pDX, IDC_BAK_COUNT, m_strCount);
	DDV_MaxChars(pDX, m_strCount, 16);
	DDX_Text(pDX, IDC_BAK_TITLE, m_strTitle);
	DDV_MaxChars(pDX, m_strTitle, 15);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(DLG_BAK, CDialog)
	//{{AFX_MSG_MAP(DLG_BAK)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// DLG_BAK message handlers

BOOL DLG_BAK::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	m_strCount.Format( _T("%d") , m_lRecordCount );
	UpdateData(false);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void DLG_BAK::SetParam(long lCount)
{

	m_lRecordCount = lCount;
}

void DLG_BAK::OnOK() 
{
	if ( !UpdateData(true) )
		return ;
	if ( m_strTitle.GetLength()<0 )
	{
		MessageBox( _T("�������������뱸�ݵ�������") , _T("����") , MB_ICONWARNING );
		GetDlgItem(IDC_BAK_TITLE)->SetFocus();
		return ;
	}
	
	CDialog::OnOK();
}