105 lines
2.3 KiB
C++
105 lines
2.3 KiB
C++
|
// DLG_Corp_File_Add.cpp : implementation file
|
|||
|
//
|
|||
|
|
|||
|
#include "stdafx.h"
|
|||
|
#include "smsmanager.h"
|
|||
|
#include "DLG_Corp_File_Add.h"
|
|||
|
|
|||
|
#ifdef _DEBUG
|
|||
|
#define new DEBUG_NEW
|
|||
|
#undef THIS_FILE
|
|||
|
static char THIS_FILE[] = __FILE__;
|
|||
|
#endif
|
|||
|
|
|||
|
/////////////////////////////////////////////////////////////////////////////
|
|||
|
// DLG_Corp_File_Add dialog
|
|||
|
|
|||
|
|
|||
|
DLG_Corp_File_Add::DLG_Corp_File_Add(CWnd* pParent /*=NULL*/)
|
|||
|
: CDialog(DLG_Corp_File_Add::IDD, pParent)
|
|||
|
{
|
|||
|
//{{AFX_DATA_INIT(DLG_Corp_File_Add)
|
|||
|
m_strBZ = _T("");
|
|||
|
m_tFileTime = COleDateTime::GetCurrentTime();
|
|||
|
m_strFileType = _T("");
|
|||
|
//}}AFX_DATA_INIT
|
|||
|
|
|||
|
memset(&m_FileData,0,sizeof(m_FileData));
|
|||
|
m_bAdd = false;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
void DLG_Corp_File_Add::DoDataExchange(CDataExchange* pDX)
|
|||
|
{
|
|||
|
CDialog::DoDataExchange(pDX);
|
|||
|
//{{AFX_DATA_MAP(DLG_Corp_File_Add)
|
|||
|
DDX_Text(pDX, IDC_CORP_FILEADD_BZ, m_strBZ);
|
|||
|
DDV_MaxChars(pDX, m_strBZ, 250);
|
|||
|
DDX_DateTimeCtrl(pDX, IDC_CORP_FILEADD_FILETIME, m_tFileTime);
|
|||
|
DDX_CBString(pDX, IDC_CORP_FILEADD_FILETYPE, m_strFileType);
|
|||
|
DDV_MaxChars(pDX, m_strFileType, 50);
|
|||
|
//}}AFX_DATA_MAP
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
BEGIN_MESSAGE_MAP(DLG_Corp_File_Add, CDialog)
|
|||
|
//{{AFX_MSG_MAP(DLG_Corp_File_Add)
|
|||
|
//}}AFX_MSG_MAP
|
|||
|
END_MESSAGE_MAP()
|
|||
|
|
|||
|
/////////////////////////////////////////////////////////////////////////////
|
|||
|
// DLG_Corp_File_Add message handlers
|
|||
|
|
|||
|
BOOL DLG_Corp_File_Add::OnInitDialog()
|
|||
|
{
|
|||
|
CDialog::OnInitDialog();
|
|||
|
|
|||
|
if ( !m_bAdd )
|
|||
|
{
|
|||
|
m_strFileType = m_FileData.szFileType;
|
|||
|
m_strBZ = m_FileData.szBZ;
|
|||
|
|
|||
|
m_tFileTime = m_FileData.tFileTime;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
m_strFileType = _T("<EFBFBD><EFBFBD>ͬ");
|
|||
|
}
|
|||
|
UpdateData(false);
|
|||
|
|
|||
|
|
|||
|
return TRUE; // return TRUE unless you set the focus to a control
|
|||
|
// EXCEPTION: OCX Property Pages should return FALSE
|
|||
|
}
|
|||
|
|
|||
|
void DLG_Corp_File_Add::SetParam(ANS_Corp_FileData data, BOOL bAdd)
|
|||
|
{
|
|||
|
m_FileData = data;
|
|||
|
m_bAdd = bAdd;
|
|||
|
}
|
|||
|
|
|||
|
void DLG_Corp_File_Add::OnOK()
|
|||
|
{
|
|||
|
if ( !UpdateData(true))
|
|||
|
return ;
|
|||
|
|
|||
|
if ( m_strFileType.GetLength()<=2 )
|
|||
|
{
|
|||
|
MessageBox( _T("û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD>ϣ<EFBFBD>") , _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>") , MB_ICONWARNING );
|
|||
|
GetDlgItem(IDC_CORP_FILEADD_FILETYPE)->SetFocus();
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
_tcscpy(m_FileData.szFileType , m_strFileType );
|
|||
|
_tcscpy(m_FileData.szBZ , m_strBZ );
|
|||
|
m_tFileTime.GetAsSystemTime( m_FileData.tFileTime );
|
|||
|
|
|||
|
|
|||
|
CDialog::OnOK();
|
|||
|
}
|
|||
|
|
|||
|
ANS_Corp_FileData DLG_Corp_File_Add::GetParam()
|
|||
|
{
|
|||
|
return m_FileData;
|
|||
|
}
|