// DLG_Corp_User_Modify.cpp : implementation file // #include "stdafx.h" #include "smsmanager.h" #include "DLG_Corp_User_Modify.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // DLG_Corp_User_Modify dialog #include "DLG_Corp_User.h" DLG_Corp_User_Modify::DLG_Corp_User_Modify(CWnd* pParent /*=NULL*/) : CDialog(DLG_Corp_User_Modify::IDD, pParent) { //{{AFX_DATA_INIT(DLG_Corp_User_Modify) m_tBirthday = COleDateTime::GetCurrentTime(); m_strBZ = _T(""); m_strCreateTime = _T(""); m_strCreateUser = _T(""); m_strEmail = _T(""); m_strFax = _T(""); m_strJob = _T(""); m_strLoginCount = _T(""); m_strLoginName = _T(""); m_strLoginTime = _T(""); m_strMobile = _T(""); m_strName = _T(""); m_strNickName = _T(""); m_strQQ = _T(""); m_lSex = -1; m_strSMSUsed = _T(""); m_strTel = _T(""); m_strSMSSendAll = _T(""); //}}AFX_DATA_INIT m_pUserDlg = (DLG_Corp_User *)pParent; memset( &m_User,0,sizeof(m_User)); m_Pos = 0; } void DLG_Corp_User_Modify::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(DLG_Corp_User_Modify) DDX_DateTimeCtrl(pDX, IDC_CORP_USERMODIFY_BIRTHDAY, m_tBirthday); DDX_Text(pDX, IDC_CORP_USERMODIFY_BZ, m_strBZ); DDV_MaxChars(pDX, m_strBZ, 50); DDX_Text(pDX, IDC_CORP_USERMODIFY_CREATETIME, m_strCreateTime); DDX_Text(pDX, IDC_CORP_USERMODIFY_CREATEUSER, m_strCreateUser); DDX_Text(pDX, IDC_CORP_USERMODIFY_EMAIL, m_strEmail); DDV_MaxChars(pDX, m_strEmail, 30); DDX_Text(pDX, IDC_CORP_USERMODIFY_FAX, m_strFax); DDV_MaxChars(pDX, m_strFax, 16); DDX_Text(pDX, IDC_CORP_USERMODIFY_JOB, m_strJob); DDV_MaxChars(pDX, m_strJob, 16); DDX_Text(pDX, IDC_CORP_USERMODIFY_LOGINCOUNT, m_strLoginCount); DDX_Text(pDX, IDC_CORP_USERMODIFY_LOGINNAME, m_strLoginName); DDV_MaxChars(pDX, m_strLoginName, 16); DDX_Text(pDX, IDC_CORP_USERMODIFY_LOGINTIME, m_strLoginTime); DDX_Text(pDX, IDC_CORP_USERMODIFY_MOBILE, m_strMobile); DDV_MaxChars(pDX, m_strMobile, 16); DDX_Text(pDX, IDC_CORP_USERMODIFY_NAME, m_strName); DDV_MaxChars(pDX, m_strName, 16); DDX_Text(pDX, IDC_CORP_USERMODIFY_NICKNAME, m_strNickName); DDV_MaxChars(pDX, m_strNickName, 16); DDX_Text(pDX, IDC_CORP_USERMODIFY_QQ, m_strQQ); DDV_MaxChars(pDX, m_strQQ, 16); DDX_CBIndex(pDX, IDC_CORP_USERMODIFY_SEX, m_lSex); DDX_Text(pDX, IDC_CORP_USERMODIFY_SMSUSED, m_strSMSUsed); DDX_Text(pDX, IDC_CORP_USERMODIFY_TEL, m_strTel); DDV_MaxChars(pDX, m_strTel, 16); DDX_Text(pDX, IDC_CORP_USERMODIFY_SMSSENDALL, m_strSMSSendAll); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(DLG_Corp_User_Modify, CDialog) //{{AFX_MSG_MAP(DLG_Corp_User_Modify) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // DLG_Corp_User_Modify message handlers void DLG_Corp_User_Modify::SetParam(ANS_Corp_UserData2 User, POSITION pos) { m_User = User; m_Pos = pos; } ANS_Corp_UserData2 DLG_Corp_User_Modify::GetParam() { return m_User; } BOOL DLG_Corp_User_Modify::OnInitDialog() { CDialog::OnInitDialog(); m_strLoginName = m_User.szLoginName; m_strName = m_User.szName; m_strNickName = m_User.szNickName; m_lSex = 0; if ( !_tcscmp( m_User.szSex , _T("男") ) ) m_lSex = 1; if ( !_tcscmp( m_User.szSex , _T("女") ) ) m_lSex = 2; COleDateTime tTemp(m_User.tBirthday); if ( tTemp.GetStatus() != 0 ) //无效时间 { m_tBirthday.SetStatus( COleDateTime::null ); } else { m_tBirthday = tTemp; } m_strJob = m_User.szJob; m_strTel = m_User.szTel; m_strFax = m_User.szFax; m_strMobile = m_User.szMobile; m_strEmail = m_User.szEmail; m_strQQ = m_User.szQQ; m_strBZ = m_User.szBZ; TCHAR Buf[32]; if ( m_User.lSMSUsed == -100 ) m_strSMSUsed = _T("无限制"); else m_strSMSUsed = _itot(m_User.lSMSUsed,Buf,10); m_strSMSSendAll = _itot(m_User.lSMSSendAll,Buf,10); m_strLoginCount = _itot( m_User.lLoginCount , Buf , 10 ); m_strLoginTime.Format( _T("%04d.%02d.%02d %02d:%02d:%02d") , m_User.tLoginTime.wYear,m_User.tLoginTime.wMonth,m_User.tLoginTime.wDay,m_User.tLoginTime.wHour,m_User.tLoginTime.wMinute,m_User.tLoginTime.wSecond ); m_strCreateUser = m_User.szCreateUser; m_strCreateTime.Format( _T("%04d.%02d.%02d %02d:%02d:%02d") , m_User.tCreateTime.wYear,m_User.tCreateTime.wMonth,m_User.tCreateTime.wDay,m_User.tCreateTime.wHour,m_User.tCreateTime.wMinute,m_User.tCreateTime.wSecond ); this->UpdateData(false); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void DLG_Corp_User_Modify::OnOK() { CDialog::OnOK(); }