185 lines
5.2 KiB
C++
185 lines
5.2 KiB
C++
// DLG_C_Partner_Modify.cpp : implementation file
|
||
//
|
||
|
||
#include "stdafx.h"
|
||
#include "smsmanager.h"
|
||
#include "DLG_C_Partner_Modify.h"
|
||
|
||
#ifdef _DEBUG
|
||
#define new DEBUG_NEW
|
||
#undef THIS_FILE
|
||
static char THIS_FILE[] = __FILE__;
|
||
#endif
|
||
|
||
/////////////////////////////////////////////////////////////////////////////
|
||
// DLG_C_Partner_Modify dialog
|
||
#include "C_Partner.h"
|
||
|
||
DLG_C_Partner_Modify::DLG_C_Partner_Modify(CWnd* pParent /*=NULL*/)
|
||
: CDialog(DLG_C_Partner_Modify::IDD, pParent)
|
||
{
|
||
//{{AFX_DATA_INIT(DLG_C_Partner_Modify)
|
||
m_tBirthday = COleDateTime::GetCurrentTime();
|
||
m_strBZ = _T("");
|
||
m_strFax = _T("");
|
||
m_strEmail = _T("");
|
||
m_strQQ = _T("");
|
||
m_strJob = _T("");
|
||
m_strMobile = _T("");
|
||
m_strName = _T("");
|
||
m_strNickName = _T("");
|
||
m_strTel = _T("");
|
||
m_lSex = -1;
|
||
m_strBranch = _T("");
|
||
m_strLTD = _T("");
|
||
m_strLTD = _T("");
|
||
m_lPartnerType = -1;
|
||
//}}AFX_DATA_INIT
|
||
|
||
|
||
m_pPartnerDlg = (CC_Partner *)pParent;
|
||
memset( &m_PartnerData , 0 , sizeof(m_PartnerData));
|
||
m_bAdd = false;
|
||
m_Pos = 0;
|
||
memset( m_szPasswd , 0 , sizeof(m_szPasswd) );
|
||
}
|
||
|
||
|
||
void DLG_C_Partner_Modify::DoDataExchange(CDataExchange* pDX)
|
||
{
|
||
CDialog::DoDataExchange(pDX);
|
||
//{{AFX_DATA_MAP(DLG_C_Partner_Modify)
|
||
DDX_DateTimeCtrl(pDX, IDC_PARTNER_MODIFY_BIRTHDAY, m_tBirthday);
|
||
DDX_Text(pDX, IDC_PARTNER_MODIFY_BZ, m_strBZ);
|
||
DDV_MaxChars(pDX, m_strBZ, 200);
|
||
DDX_Text(pDX, IDC_PARTNER_MODIFY_FAX, m_strFax);
|
||
DDV_MaxChars(pDX, m_strFax, 30);
|
||
DDX_Text(pDX, IDC_PARTNER_MODIFY_EMAIL, m_strEmail);
|
||
DDV_MaxChars(pDX, m_strEmail, 62);
|
||
DDX_Text(pDX, IDC_PARTNER_MODIFY_QQ, m_strQQ);
|
||
DDV_MaxChars(pDX, m_strQQ, 30);
|
||
DDX_Text(pDX, IDC_PARTNER_MODIFY_JOB, m_strJob);
|
||
DDV_MaxChars(pDX, m_strJob, 30);
|
||
DDX_Text(pDX, IDC_PARTNER_MODIFY_MOBILE, m_strMobile);
|
||
DDV_MaxChars(pDX, m_strMobile, 30);
|
||
DDX_Text(pDX, IDC_PARTNER_MODIFY_NAME, m_strName);
|
||
DDV_MaxChars(pDX, m_strName, 22);
|
||
DDX_Text(pDX, IDC_PARTNER_MODIFY_NAME2, m_strNickName);
|
||
DDV_MaxChars(pDX, m_strNickName, 20);
|
||
DDX_Text(pDX, IDC_PARTNER_MODIFY_TEL, m_strTel);
|
||
DDV_MaxChars(pDX, m_strTel, 30);
|
||
DDX_CBIndex(pDX, IDC_PARTNER_MODIFY_SEX, m_lSex);
|
||
DDX_Text(pDX, IDC_PARTNER_MODIFY_BRANCH, m_strBranch);
|
||
DDV_MaxChars(pDX, m_strBranch, 30);
|
||
DDX_Text(pDX, IDC_PARTNER_MODIFY_LTD, m_strLTD);
|
||
DDV_MaxChars(pDX, m_strLTD, 60);
|
||
DDX_CBIndex(pDX, IDC_PARTNER_MODIFY_TYPE, m_lPartnerType);
|
||
//}}AFX_DATA_MAP
|
||
}
|
||
|
||
|
||
BEGIN_MESSAGE_MAP(DLG_C_Partner_Modify, CDialog)
|
||
//{{AFX_MSG_MAP(DLG_C_Partner_Modify)
|
||
//}}AFX_MSG_MAP
|
||
END_MESSAGE_MAP()
|
||
|
||
/////////////////////////////////////////////////////////////////////////////
|
||
// DLG_C_Partner_Modify message handlers
|
||
|
||
BOOL DLG_C_Partner_Modify::OnInitDialog()
|
||
{
|
||
CDialog::OnInitDialog();
|
||
|
||
|
||
m_lPartnerType = m_PartnerData.lPartnerType;
|
||
m_strName = m_PartnerData.szName;
|
||
m_strNickName = m_PartnerData.szNickName;
|
||
long lSex = 0;
|
||
if ( CString(m_PartnerData.szSex)==_T("<EFBFBD><EFBFBD>") )
|
||
lSex = 1;
|
||
if ( CString(m_PartnerData.szSex)==_T("Ů") )
|
||
lSex = 2;
|
||
m_lSex = lSex;
|
||
COleDateTime tTemp(m_PartnerData.tBirthday);
|
||
if ( tTemp.GetStatus() != 0 ) //<2F><>Чʱ<D0A7><CAB1>
|
||
{
|
||
m_tBirthday.SetStatus( COleDateTime::null );
|
||
}
|
||
else
|
||
{
|
||
m_tBirthday = tTemp;
|
||
}
|
||
m_strBranch = m_PartnerData.szBranch;
|
||
m_strLTD = m_PartnerData.szLTD;
|
||
m_strJob = m_PartnerData.szJob;
|
||
m_strTel = m_PartnerData.szTel;
|
||
m_strFax = m_PartnerData.szFax;
|
||
m_strMobile = m_PartnerData.szMobile;
|
||
m_strEmail = m_PartnerData.szEmail;
|
||
m_strQQ = m_PartnerData.szQQ;
|
||
|
||
UpdateData(false);
|
||
|
||
return TRUE; // return TRUE unless you set the focus to a control
|
||
// EXCEPTION: OCX Property Pages should return FALSE
|
||
}
|
||
|
||
void DLG_C_Partner_Modify::OnOK()
|
||
{
|
||
if ( !UpdateData(true) )
|
||
return ;
|
||
if (m_strName.GetLength() <= 0 )
|
||
{
|
||
GetDlgItem(IDC_PARTNER_MODIFY_NAME)->SetFocus();
|
||
MessageBox( _T("ҵ<EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!") , _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>") , MB_ICONWARNING );
|
||
return ;
|
||
}
|
||
m_PartnerData.lPartnerType = m_lPartnerType;
|
||
_tcscpy( m_PartnerData.szName , m_strName );
|
||
_tcscpy( m_PartnerData.szNickName , m_strNickName );
|
||
if ( m_lSex == 0 )
|
||
_tcscpy( m_PartnerData.szSex , _T("") );
|
||
else
|
||
if ( m_lSex == 1 )
|
||
_tcscpy( m_PartnerData.szSex , _T("<EFBFBD><EFBFBD>") );
|
||
else
|
||
_tcscpy( m_PartnerData.szSex , _T("Ů") );
|
||
_tcscpy( m_PartnerData.szBranch , m_strBranch );
|
||
_tcscpy( m_PartnerData.szLTD , m_strLTD );
|
||
_tcscpy( m_PartnerData.szJob , m_strJob );
|
||
_tcscpy( m_PartnerData.szTel , m_strTel );
|
||
_tcscpy( m_PartnerData.szFax , m_strFax );
|
||
_tcscpy( m_PartnerData.szMobile , m_strMobile );
|
||
_tcscpy( m_PartnerData.szEmail , m_strEmail );
|
||
_tcscpy( m_PartnerData.szQQ , m_strQQ );
|
||
_tcscpy( m_PartnerData.szBZ , m_strBZ );
|
||
|
||
if ( m_tBirthday.GetStatus() == 0 )
|
||
m_tBirthday.GetAsSystemTime( m_PartnerData.tBirthday );
|
||
else
|
||
memset(&m_PartnerData.tBirthday,0,sizeof(m_PartnerData.tBirthday));
|
||
|
||
if ( m_pPartnerDlg && m_pPartnerDlg->FindPartnerName( m_PartnerData.szName,m_Pos ) )
|
||
{
|
||
GetDlgItem(IDC_PARTNER_MODIFY_NAME)->SetFocus();
|
||
MessageBox( _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>ã<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!") , _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>") , MB_ICONWARNING );
|
||
return ;
|
||
}
|
||
|
||
|
||
CDialog::OnOK();
|
||
}
|
||
|
||
void DLG_C_Partner_Modify::SetParam(ANS_GetPartnerData data, POSITION pos, BOOL bAdd)
|
||
{
|
||
m_PartnerData = data;
|
||
m_bAdd = bAdd;
|
||
m_Pos = pos;
|
||
|
||
}
|
||
|
||
ANS_GetPartnerData DLG_C_Partner_Modify::GetParam()
|
||
{
|
||
return m_PartnerData;
|
||
}
|