160 lines
3.9 KiB
C++
160 lines
3.9 KiB
C++
|
// DLG_Corp_VipInt_Modify.cpp : implementation file
|
|||
|
//
|
|||
|
|
|||
|
#include "stdafx.h"
|
|||
|
#include "smsmanager.h"
|
|||
|
#include "DLG_Corp_VipInt_Modify.h"
|
|||
|
|
|||
|
#ifdef _DEBUG
|
|||
|
#define new DEBUG_NEW
|
|||
|
#undef THIS_FILE
|
|||
|
static char THIS_FILE[] = __FILE__;
|
|||
|
#endif
|
|||
|
|
|||
|
/////////////////////////////////////////////////////////////////////////////
|
|||
|
// DLG_Corp_VipInt_Modify dialog
|
|||
|
|
|||
|
|
|||
|
DLG_Corp_VipInt_Modify::DLG_Corp_VipInt_Modify(CWnd* pParent /*=NULL*/)
|
|||
|
: CDialog(DLG_Corp_VipInt_Modify::IDD, pParent)
|
|||
|
{
|
|||
|
//{{AFX_DATA_INIT(DLG_Corp_VipInt_Modify)
|
|||
|
m_strBZ = _T("");
|
|||
|
m_strCreateTime = _T("");
|
|||
|
m_strCreateUser = _T("");
|
|||
|
m_strInt = _T("");
|
|||
|
m_lType = -1;
|
|||
|
//}}AFX_DATA_INIT
|
|||
|
|
|||
|
memset( &m_QXT , 0 , sizeof(m_QXT) );
|
|||
|
memset(&m_VipInt , 0 , sizeof(m_VipInt));
|
|||
|
m_bAdd = true;
|
|||
|
m_lAddType = 0;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
void DLG_Corp_VipInt_Modify::DoDataExchange(CDataExchange* pDX)
|
|||
|
{
|
|||
|
CDialog::DoDataExchange(pDX);
|
|||
|
//{{AFX_DATA_MAP(DLG_Corp_VipInt_Modify)
|
|||
|
DDX_Text(pDX, IDC_CORP_VIPINTMODIFY_BZ, m_strBZ);
|
|||
|
DDV_MaxChars(pDX, m_strBZ, 200);
|
|||
|
DDX_Text(pDX, IDC_CORP_VIPINTMODIFY_CREATETIME, m_strCreateTime);
|
|||
|
DDX_Text(pDX, IDC_CORP_VIPINTMODIFY_CREATEUSER, m_strCreateUser);
|
|||
|
DDX_CBString(pDX, IDC_CORP_VIPINTMODIFY_INT, m_strInt);
|
|||
|
DDV_MaxChars(pDX, m_strInt, 8);
|
|||
|
DDX_CBIndex(pDX, IDC_CORP_VIPINTMODIFY_TYPE, m_lType);
|
|||
|
//}}AFX_DATA_MAP
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
BEGIN_MESSAGE_MAP(DLG_Corp_VipInt_Modify, CDialog)
|
|||
|
//{{AFX_MSG_MAP(DLG_Corp_VipInt_Modify)
|
|||
|
//}}AFX_MSG_MAP
|
|||
|
END_MESSAGE_MAP()
|
|||
|
|
|||
|
/////////////////////////////////////////////////////////////////////////////
|
|||
|
// DLG_Corp_VipInt_Modify message handlers
|
|||
|
|
|||
|
BOOL DLG_Corp_VipInt_Modify::OnInitDialog()
|
|||
|
{
|
|||
|
CDialog::OnInitDialog();
|
|||
|
|
|||
|
|
|||
|
if ( m_bAdd ) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
{
|
|||
|
m_lType = 1; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
if (m_lAddType==1)
|
|||
|
{
|
|||
|
m_lType=5; //<2F>һ<EFBFBD><D2BB><EFBFBD>Ʒ
|
|||
|
GetDlgItem(IDC_CORP_VIPINTMODIFY_TYPE)->EnableWindow( false );
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
m_lType = m_VipInt.lType;
|
|||
|
m_strInt.Format(_T("%d"), m_VipInt.lVipInt );
|
|||
|
m_strBZ = m_VipInt.szBZ;
|
|||
|
m_strCreateUser = m_VipInt.szCreateUser;
|
|||
|
m_strCreateTime.Format( _T("%04d.%02d.%02d %02d:%02d") , m_VipInt.tCreateTime.wYear,m_VipInt.tCreateTime.wMonth,m_VipInt.tCreateTime.wDay,m_VipInt.tCreateTime.wHour,m_VipInt.tCreateTime.wMinute);
|
|||
|
|
|||
|
GetDlgItem(IDC_CORP_VIPINTMODIFY_TYPE)->EnableWindow( false );
|
|||
|
GetDlgItem(IDC_CORP_VIPINTMODIFY_INT)->EnableWindow( false );
|
|||
|
CEdit * pEdit =(CEdit * )GetDlgItem(IDC_CORP_VIPINTMODIFY_BZ);
|
|||
|
pEdit->SetReadOnly(true);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
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_VipInt_Modify::SetParam(ANS_Corp_QXTSetup Qxt, REQ_Corp_QXTSetup_VipInt VipInt , BOOL bAdd)
|
|||
|
{
|
|||
|
m_QXT = Qxt;
|
|||
|
m_VipInt = VipInt;
|
|||
|
m_bAdd = bAdd;
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
REQ_Corp_QXTSetup_VipInt DLG_Corp_VipInt_Modify::GetParam()
|
|||
|
{
|
|||
|
return m_VipInt;
|
|||
|
}
|
|||
|
|
|||
|
void DLG_Corp_VipInt_Modify::OnOK()
|
|||
|
{
|
|||
|
if ( !m_bAdd )
|
|||
|
{
|
|||
|
CDialog::OnCancel();
|
|||
|
return ;
|
|||
|
}
|
|||
|
|
|||
|
if (!this->UpdateData( true ) )
|
|||
|
return ;
|
|||
|
|
|||
|
if ( m_lType<=0 )
|
|||
|
{
|
|||
|
MessageBox( _T("<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD>Ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!") , _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>") , MB_ICONWARNING );
|
|||
|
GetDlgItem(IDC_CORP_VIPINTMODIFY_TYPE)->SetFocus();
|
|||
|
return ;
|
|||
|
}
|
|||
|
m_VipInt.lType = m_lType;
|
|||
|
m_VipInt.lVipInt = _ttol(m_strInt);
|
|||
|
if (m_VipInt.lVipInt==0 )
|
|||
|
{
|
|||
|
MessageBox( _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!") , _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>") , MB_ICONWARNING );
|
|||
|
GetDlgItem(IDC_CORP_VIPINTMODIFY_INT)->SetFocus();
|
|||
|
return ;
|
|||
|
}
|
|||
|
if ( m_VipInt.lType==5 && m_VipInt.lVipInt>=0 )
|
|||
|
{
|
|||
|
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>!") , _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>") , MB_ICONWARNING );
|
|||
|
GetDlgItem(IDC_CORP_VIPINTMODIFY_INT)->SetFocus();
|
|||
|
return ;
|
|||
|
|
|||
|
}
|
|||
|
if (m_VipInt.lType==5 && (m_QXT.ret.lVipInt<-m_VipInt.lVipInt) )
|
|||
|
{
|
|||
|
int iRet=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>") , _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>") , MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 );
|
|||
|
if ( iRet!=IDYES )
|
|||
|
{
|
|||
|
GetDlgItem(IDC_CORP_VIPINTMODIFY_INT)->SetFocus();
|
|||
|
return ;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
_tcscpy(m_VipInt.szBZ , m_strBZ );
|
|||
|
|
|||
|
CDialog::OnOK();
|
|||
|
}
|
|||
|
|
|||
|
void DLG_Corp_VipInt_Modify::SetParam(long lType)
|
|||
|
{
|
|||
|
m_lAddType = lType;
|
|||
|
}
|