2025-02-27 16:58:16 +08:00
// FKAddress.cpp : implementation file
//
# include "stdafx.h"
# include "corpsms.h"
# include "FKAddress.h"
# ifdef _DEBUG
# define new DEBUG_NEW
# undef THIS_FILE
static char THIS_FILE [ ] = __FILE__ ;
# endif
/////////////////////////////////////////////////////////////////////////////
// CFKAddress dialog
# include "MainFrm.h"
# include "ProcessSocket.h"
# include "DLG_Group_Modify.h"
# include "FuncView.h"
# include "DLG_User_ModifyK.h"
# include "DLG_User_InportK.h"
# include "..\public\StringSort\StringSort.h"
CFKAddress : : CFKAddress ( CWnd * pParent /*=NULL*/ )
: CDialog ( CFKAddress : : IDD , pParent )
{
//{{AFX_DATA_INIT(CFKAddress)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_bInit = false ;
m_bRefresh = false ;
m_lUserID = 0 ;
m_bFind2 = false ;
memset ( m_szGroupID , 0 , sizeof ( m_szGroupID ) ) ;
memset ( m_szLocal , 0 , sizeof ( m_szLocal ) ) ;
m_Copy_UserID = 0 ;
memset ( m_Copy_GroupID , 0 , sizeof ( m_Copy_GroupID ) ) ;
m_Copy_Count = 0 ;
m_Copy_Type = 0 ;
m_Copy_Data = NULL ;
}
void CFKAddress : : DoDataExchange ( CDataExchange * pDX )
{
CDialog : : DoDataExchange ( pDX ) ;
//{{AFX_DATA_MAP(CFKAddress)
DDX_Control ( pDX , IDC_KADDRESS_LIST , m_wndList ) ;
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP ( CFKAddress , CDialog )
//{{AFX_MSG_MAP(CFKAddress)
ON_WM_SIZE ( )
ON_WM_TIMER ( )
ON_NOTIFY ( NM_DBLCLK , IDC_KADDRESS_LIST , OnDblclkKaddressList )
ON_NOTIFY ( NM_RCLICK , IDC_KADDRESS_LIST , OnRclickKaddressList )
ON_NOTIFY ( LVN_KEYDOWN , IDC_KADDRESS_LIST , OnKeydownKaddressList )
ON_WM_DESTROY ( )
//}}AFX_MSG_MAP
ON_MESSAGE ( LIST_DROP_BEGIN , On_List_DropBegin )
ON_COMMAND ( MENU_KADDRESS_ADD , On_User_Add )
ON_COMMAND ( MENU_KADDRESS_ADDGROUP , On_User_AddGroup )
ON_COMMAND ( MENU_KADDRESS_MODIFY , On_User_Modify )
ON_COMMAND ( MENU_KADDRESS_DEL , On_User_Del )
ON_COMMAND ( MENU_KADDRESS_FIND , On_User_Find )
ON_COMMAND ( MENU_KADDRESS_ADDTOLIST , On_User_AddToList )
ON_COMMAND ( MENU_KADDRESS_INPORT , On_User_Inport )
ON_COMMAND ( MENU_KADDRESS_EXPORT , On_User_Export )
ON_COMMAND ( MENU_KADDRESS_REFRESH , On_User_Refresh )
ON_COMMAND ( MENU_KADDRESS_COPY , On_User_Copy )
ON_COMMAND ( MENU_KADDRESS_CUT , On_User_Cut )
ON_COMMAND ( MENU_KADDRESS_PASTE , On_User_Paste )
END_MESSAGE_MAP ( )
/////////////////////////////////////////////////////////////////////////////
// CFKAddress message handlers
BOOL CFKAddress : : ReHide ( )
{
ShowWindow ( SW_HIDE ) ;
return true ;
}
BOOL CFKAddress : : ReShow ( BOOL bRefresh )
{
ShowWindow ( SW_SHOW ) ;
if ( bRefresh | | ! m_bRefresh )
{
RefreshInfo ( ) ;
}
return true ;
}
BOOL CFKAddress : : RefreshInfo ( )
{
return true ;
}
long CFKAddress : : GetCurrentSelected ( )
{
POSITION pos = m_wndList . GetFirstSelectedItemPosition ( ) ;
if ( pos )
{
return m_wndList . GetNextSelectedItem ( pos ) ;
}
return - 1 ;
}
void CFKAddress : : OnOK ( )
{
//CDialog::OnOK();
}
void CFKAddress : : OnCancel ( )
{
//CDialog::OnCancel();
}
BOOL CFKAddress : : OnInitDialog ( )
{
CDialog : : OnInitDialog ( ) ;
//ȡ<> ù<EFBFBD> <C3B9> ò<EFBFBD> <C3B2> <EFBFBD>
//CMainFrame * pFrame = static_cast <CMainFrame *>((CMainFrame *)AfxGetMainWnd());
this - > GetParent ( ) - > GetParentFrame ( ) ;
m_pMainFrame = ( CMainFrame * ) this - > GetParent ( ) - > GetParentFrame ( ) ;
m_pSocket = & m_pMainFrame - > m_Socket ;
m_AdoRS . SetAdoConnection ( & m_pMainFrame - > m_adoConnection ) ;
SetTimer ( 1 , 200 , NULL ) ; //Ϊ<> <CEAA> ȡ<EFBFBD> <C8A1> m_pFuncView;
//<2F> <> ʼ <EFBFBD> <CABC> List
m_Image . Create ( 16 , 16 , ILC_COLOR32 | ILC_MASK , 5 , 5 ) ;
m_Image . Add ( AfxGetApp ( ) - > LoadIcon ( IDI_L_ADDRESSM ) ) ;
m_Image . Add ( AfxGetApp ( ) - > LoadIcon ( IDI_L_LOCK ) ) ;
m_wndList . SubClassWindow2 ( ) ;
m_wndList . SetHeadings ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,50; <20> <> <EFBFBD> <EFBFBD> ,180; <20> 绰,100;<3B> ֻ<EFBFBD> ,100; <20> <> <EFBFBD> <EFBFBD> ,90; ʡ<> <CAA1> ,100; <20> <> <EFBFBD> <EFBFBD> ,100; <20> <> <EFBFBD> <EFBFBD> ,100;" ) ) ;
m_wndList . SetGridLines ( true ) ;
m_wndList . SetImageList ( & m_Image , LVSIL_SMALL ) ;
//m_wndList.SetBkColor( RGB(237,191,175) );
//m_wndList.SetTextBkColor( RGB(237,191,175) );
m_bInit = true ;
return TRUE ; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CFKAddress : : OnSize ( UINT nType , int cx , int cy )
{
CDialog : : OnSize ( nType , cx , cy ) ;
if ( m_bInit )
{
m_wndList . MoveWindow ( 0 , 0 , cx , cy ) ;
}
}
2025-04-11 17:19:25 +08:00
void CFKAddress : : OnTimer ( UINT_PTR nIDEvent )
2025-02-27 16:58:16 +08:00
{
CDialog : : OnTimer ( nIDEvent ) ;
if ( nIDEvent = = 1 )
{
KillTimer ( 1 ) ;
m_pFuncView = m_pMainFrame - > m_pFuncView ;
return ;
}
}
long CFKAddress : : ShowUser ( long lUserID , const TCHAR * pWhere , BOOL bGroupAll )
{
if ( bGroupAll )
m_bFind2 = true ;
else
m_bFind2 = false ;
m_wndList . ShowWindow ( SW_HIDE ) ; //Ϊ<> ˼ӿ<CBBC> <D3BF> <EFBFBD> ʾ <EFBFBD> ٶ<EFBFBD>
m_wndList . DeleteAllItems ( ) ;
CString strWhere ;
if ( pWhere )
strWhere = pWhere ;
TCHAR szSelect [ 1024 ] = { 0 } ;
CString str ;
m_lUserID = lUserID ;
memset ( m_szGroupID , 0 , sizeof ( m_szGroupID ) ) ;
if ( bGroupAll )
{
_stprintf ( szSelect , _T ( " Select * from kaddress where UserType='1' %s " ) , strWhere ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD>
}
else
{
if ( lUserID ! = - 1 ) //<2F> <> <EFBFBD> <EFBFBD> -1<> Ǵ<EFBFBD> <C7B4> <EFBFBD> <EFBFBD> <EFBFBD>
{
_stprintf ( szSelect , _T ( " select GroupID from kaddress where UserID=%d AND UserType='0' " ) , lUserID ) ; //<2F> <> ѯ<EFBFBD> û<EFBFBD> ID<49> <44> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֻ<EFBFBD> <D6BB> Ϊ<EFBFBD> <CEAA>
BOOL b = m_AdoRS . Open ( szSelect ) ;
long lCount = m_AdoRS . GetRecordCount ( ) ;
if ( b & & lCount )
{
m_AdoRS . MoveFirst ( ) ;
m_AdoRS . GetCollect ( _T ( " GroupID " ) , m_szGroupID ) ;
}
else
{
m_wndList . ShowWindow ( SW_SHOW ) ; //Ϊ<> ˼ӿ<CBBC> <D3BF> <EFBFBD> ʾ <EFBFBD> ٶ<EFBFBD>
return 0 ;
}
}
GetLocal ( m_szLocal , m_szGroupID ) ; //ȡ<> û<EFBFBD> ·<EFBFBD> <C2B7>
if ( lUserID = = - 1 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> Ǹ<EFBFBD> <C7B8> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> ΪNULL
_stprintf ( szSelect , _T ( " select * from kaddress where (GroupID is null or len(GroupID)=0) and UserType='1' %s order by CreateTime " ) , strWhere ) ; //<2F> <> <EFBFBD> Ҵ<EFBFBD> <D2B4> <EFBFBD> <EFBFBD> µ<EFBFBD> <C2B5> û<EFBFBD>
else
_stprintf ( szSelect , _T ( " Select * from kaddress where GroupID='%s' AND UserType='1' %s order by CreateTime " ) , m_szGroupID , strWhere ) ; //<2F> <> <EFBFBD> Ҵ<EFBFBD> <D2B4> <EFBFBD> <EFBFBD> µ<EFBFBD> <C2B5> û<EFBFBD>
}
BOOL b = m_AdoRS . Open ( szSelect ) ;
long lCount = m_AdoRS . GetRecordCount ( ) ;
if ( b & & lCount )
{
COleDateTime t ;
m_AdoRS . MoveFirst ( ) ;
for ( int i = 0 ; i < lCount ; i + + )
{
KAddress user = { 0 } ;
COleDateTime t ;
m_AdoRS . GetCollect ( _T ( " UserID " ) , user . lUserID ) ;
m_AdoRS . GetCollect ( _T ( " UserType " ) , user . szUserType ) ;
m_AdoRS . GetCollect ( _T ( " GroupID " ) , user . szGroupID ) ;
m_AdoRS . GetCollect ( _T ( " Name " ) , user . szName ) ;
m_AdoRS . GetCollect ( _T ( " CarNum " ) , user . szCarNum ) ;
m_AdoRS . GetCollect ( _T ( " Province " ) , user . szProvince ) ;
m_AdoRS . GetCollect ( _T ( " Addr " ) , user . szAddr ) ;
m_AdoRS . GetCollect ( _T ( " Postcode " ) , user . szPostcode ) ;
m_AdoRS . GetCollect ( _T ( " Tel " ) , user . szTel ) ;
m_AdoRS . GetCollect ( _T ( " Mobile " ) , user . szMobile ) ;
m_AdoRS . GetCollect ( _T ( " SFZ " ) , user . szSFZ ) ;
m_AdoRS . GetCollect ( _T ( " Birthday " ) , t ) ; t . GetAsSystemTime ( user . tBirthday ) ;
m_AdoRS . GetCollect ( _T ( " BuyDate " ) , t ) ; t . GetAsSystemTime ( user . tBuyDate ) ;
m_AdoRS . GetCollect ( _T ( " RegDate " ) , t ) ; t . GetAsSystemTime ( user . tRegDate ) ;
m_AdoRS . GetCollect ( _T ( " BuyProvince " ) , user . szBuyProvince ) ;
m_AdoRS . GetCollect ( _T ( " BuyCity " ) , user . szBuyCity ) ;
m_AdoRS . GetCollect ( _T ( " CarType " ) , user . szCarType ) ;
m_AdoRS . GetCollect ( _T ( " FDJNum " ) , user . szFDJNum ) ;
m_AdoRS . GetCollect ( _T ( " DPNum " ) , user . szDPNum ) ;
m_AdoRS . GetCollect ( _T ( " SCNum " ) , user . szSCNum ) ;
m_AdoRS . GetCollect ( _T ( " FWNum " ) , user . szFWNum ) ;
m_AdoRS . GetCollect ( _T ( " FWName " ) , user . szFWName ) ;
m_AdoRS . GetCollect ( _T ( " CreateTime " ) , t ) ; t . GetAsSystemTime ( user . tCreateTime ) ;
m_AdoRS . GetCollect ( _T ( " BZ " ) , user . szBZ ) ;
m_AdoRS . MoveNext ( ) ;
//m_wndList.SetHeadings(_T("<22> <> <EFBFBD> <EFBFBD> ,50; <20> <> <EFBFBD> <EFBFBD> ,80; <20> 绰,80;<3B> ֻ<EFBFBD> ,100; <20> <> <EFBFBD> <EFBFBD> ,90; ʡ<> <CAA1> ,100; <20> <> <EFBFBD> <EFBFBD> ,100; <20> <> <EFBFBD> <EFBFBD> ,100;"));
m_wndList . InsertItem ( i , _itot ( i + 1 , szSelect , 10 ) ) ; //<2F> <> <EFBFBD> <EFBFBD>
m_wndList . SetItemData ( i , user . lUserID ) ;
m_wndList . SetItemText ( i , 1 , user . szName ) ;
m_wndList . SetItemText ( i , 2 , user . szTel ) ;
m_wndList . SetItemText ( i , 3 , user . szMobile ) ;
COleDateTime t2 ( user . tBirthday ) ;
if ( t2 . GetStatus ( ) = = COleDateTime : : valid )
{
str . Format ( _T ( " %04d.%02d.%02d " ) , t2 . GetYear ( ) , t2 . GetMonth ( ) , t2 . GetDay ( ) ) ;
m_wndList . SetItemText ( i , 4 , str ) ;
}
else
{
m_wndList . SetItemText ( i , 4 , _T ( " " ) ) ;
}
m_wndList . SetItemText ( i , 5 , user . szProvince ) ;
m_wndList . SetItemText ( i , 6 , user . szCarNum ) ;
m_wndList . SetItemText ( i , 7 , user . szCarType ) ;
}
// return lCount;
}
m_wndList . ShowWindow ( SW_SHOW ) ; //Ϊ<> ˼ӿ<CBBC> <D3BF> <EFBFBD> ʾ <EFBFBD> ٶ<EFBFBD>
return 0 ;
}
void CFKAddress : : GetLocal ( TCHAR * pLocal , TCHAR * pGroupID )
{
long lLen = _tcslen ( pGroupID ) ;
TCHAR szGroup [ 16 ] = { 0 } ;
TCHAR szTemp [ 16 ] = { 0 } ;
TCHAR szSelect [ 128 ] = { 0 } ;
_stprintf ( pLocal , _T ( " <EFBFBD> ͻ<EFBFBD> ͨѶ¼" ) ) ;
for ( int i = 1 ; i < = lLen ; i + + )
{
_tcsncpy ( szGroup , pGroupID , i ) ;
_stprintf ( szSelect , _T ( " select Name from kaddress where GroupID='%s' AND UserType='0' " ) , szGroup ) ;
BOOL b = m_AdoRS . Open ( szSelect ) ;
if ( b & & ! m_AdoRS . IsEOF ( ) )
{
m_AdoRS . GetCollect ( _T ( " Name " ) , szTemp ) ;
_tcscat ( pLocal , _T ( " \\ " ) ) ;
_tcscat ( pLocal , szTemp ) ;
}
}
}
void CFKAddress : : OnDblclkKaddressList ( NMHDR * pNMHDR , LRESULT * pResult )
{
* pResult = 0 ;
On_User_Modify ( ) ;
}
void CFKAddress : : OnRclickKaddressList ( NMHDR * pNMHDR , LRESULT * pResult )
{
* pResult = 0 ;
ShowRMenu ( ) ;
}
void CFKAddress : : OnKeydownKaddressList ( NMHDR * pNMHDR , LRESULT * pResult )
{
LV_KEYDOWN * pLVKeyDow = ( LV_KEYDOWN * ) pNMHDR ;
* pResult = 0 ;
if ( pLVKeyDow - > wVKey = = VK_DELETE )
{
On_User_Del ( ) ;
}
if ( pLVKeyDow - > wVKey = = VK_INSERT )
{
On_User_Add ( ) ;
}
if ( pLVKeyDow - > wVKey = = VK_SPACE )
{
On_User_Modify ( ) ;
}
if ( pLVKeyDow - > wVKey = = ' S ' | | pLVKeyDow - > wVKey = = ' s ' )
{
On_User_AddToList ( ) ;
}
if ( pLVKeyDow - > wVKey = = ' G ' | | pLVKeyDow - > wVKey = = ' g ' )
{
On_User_AddGroup ( ) ;
}
if ( pLVKeyDow - > wVKey = = ' F ' | | pLVKeyDow - > wVKey = = ' f ' )
{
On_User_Find ( ) ;
}
if ( pLVKeyDow - > wVKey = = ' R ' | | pLVKeyDow - > wVKey = = ' r ' )
{
On_User_Refresh ( ) ;
}
if ( pLVKeyDow - > wVKey = = ' C ' | | pLVKeyDow - > wVKey = = ' c ' )
{
On_User_Copy ( ) ;
}
if ( pLVKeyDow - > wVKey = = ' X ' | | pLVKeyDow - > wVKey = = ' x ' )
{
On_User_Cut ( ) ;
}
if ( pLVKeyDow - > wVKey = = ' V ' | | pLVKeyDow - > wVKey = = ' v ' )
{
On_User_Paste ( ) ;
}
if ( pLVKeyDow - > wVKey = = ' A ' | | pLVKeyDow - > wVKey = = ' a ' )
{
m_wndList . SelectAllItems ( ) ;
}
}
void CFKAddress : : ShowRMenu ( )
{
if ( ! m_pMainFrame - > GetUserPurview ( PURVIEW_PADDRESS , false ) ) //û<> в鿴Ȩ<E9BFB4> <C8A8>
return ;
CMenu menu ;
menu . CreatePopupMenu ( ) ;
BOOL bLock = false ;
long lItem = this - > GetCurrentSelected ( ) ;
if ( ! m_bFind2 )
{
menu . AppendMenu ( MF_STRING , MENU_KADDRESS_ADD , _T ( " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> " ) ) ;
menu . AppendMenu ( MF_STRING , MENU_KADDRESS_ADDGROUP , _T ( " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_KADDRESS_ADD , _T ( " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> " ) ) ;
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_KADDRESS_ADDGROUP , _T ( " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> " ) ) ;
}
menu . AppendMenu ( MF_SEPARATOR ) ;
//<2F> <EFBFBD>
if ( lItem > = 0 )
{
menu . AppendMenu ( MF_STRING , MENU_KADDRESS_MODIFY , _T ( " <20> <> <20> <> " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_KADDRESS_MODIFY , _T ( " <20> <> <20> <> " ) ) ;
}
//ɾ<> <C9BE>
if ( lItem > = 0 )
{
menu . AppendMenu ( MF_STRING , MENU_KADDRESS_DEL , _T ( " ɾ <20> <> " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_KADDRESS_DEL , _T ( " ɾ <20> <> " ) ) ;
}
//<2F> <> <EFBFBD> Ͷ<EFBFBD> <CDB6> <EFBFBD>
if ( m_pMainFrame - > GetUserPurview ( PURVIEW_SENDP , false ) & & lItem > = 0 )
{
menu . AppendMenu ( MF_STRING , MENU_KADDRESS_ADDTOLIST , _T ( " <20> <> <EFBFBD> Ͷ<EFBFBD> <CDB6> <EFBFBD> " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_KADDRESS_ADDTOLIST , _T ( " <20> <> <EFBFBD> Ͷ<EFBFBD> <CDB6> <EFBFBD> " ) ) ;
}
menu . AppendMenu ( MF_SEPARATOR ) ;
if ( lItem > = 0 & & ! m_bFind2 )
{
menu . AppendMenu ( MF_STRING , MENU_KADDRESS_COPY , _T ( " <20> <> <20> <> " ) ) ;
menu . AppendMenu ( MF_STRING , MENU_KADDRESS_CUT , _T ( " <20> <> <20> <> " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_KADDRESS_COPY , _T ( " <20> <> <20> <> " ) ) ;
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_KADDRESS_CUT , _T ( " <20> <> <20> <> " ) ) ;
}
if ( ! m_bFind2 & & m_Copy_Count > 0 & & ! ( m_lUserID = = m_Copy_UserID & & m_Copy_Type = = PADDRESS_COPYTYPE_CUT ) )
menu . AppendMenu ( MF_STRING , MENU_KADDRESS_PASTE , _T ( " ճ <20> <> " ) ) ;
else
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_KADDRESS_PASTE , _T ( " ճ <20> <> " ) ) ;
menu . AppendMenu ( MF_SEPARATOR ) ;
menu . AppendMenu ( MF_STRING , MENU_KADDRESS_FIND , _T ( " <20> <> <EFBFBD> <EFBFBD> ... " ) ) ;
menu . AppendMenu ( MF_SEPARATOR ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD>
if ( ! m_bFind2 )
menu . AppendMenu ( MF_STRING , MENU_KADDRESS_INPORT , _T ( " <20> <> <EFBFBD> <EFBFBD> ͨѶ¼ " ) ) ;
else
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_KADDRESS_INPORT , _T ( " <20> <> <EFBFBD> <EFBFBD> ͨѶ¼ " ) ) ;
menu . AppendMenu ( MF_STRING , MENU_KADDRESS_EXPORT , _T ( " <20> <> <EFBFBD> <EFBFBD> ͨѶ¼ " ) ) ;
menu . AppendMenu ( MF_SEPARATOR ) ;
//ˢ<> <CBA2>
menu . AppendMenu ( MF_STRING , MENU_KADDRESS_REFRESH , _T ( " ˢ <20> <> " ) ) ;
//<2F> <> ʾ <EFBFBD> ˵<EFBFBD>
POINT pt ;
: : GetCursorPos ( & pt ) ;
//this->ClientToScreen( &pt);
menu . TrackPopupMenu ( TPM_LEFTBUTTON | TPM_RIGHTBUTTON , pt . x , pt . y , this , NULL ) ;
menu . DestroyMenu ( ) ;
}
LRESULT CFKAddress : : On_List_DropBegin ( WPARAM wParam , LPARAM lParam )
{
//<2F> <> <EFBFBD> <EFBFBD> û<EFBFBD> з<EFBFBD> <D0B7> <EFBFBD> ˽<EFBFBD> ˵<EFBFBD> ַ<EFBFBD> <D6B7> <EFBFBD> <EFBFBD> Ȩ<EFBFBD> <C8A8>
if ( ! m_pMainFrame - > GetUserPurview ( PURVIEW_SENDP , false ) )
return false ;
long lCount = m_wndList . GetSelectedCount ( ) ;
if ( lCount < = 0 )
return false ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
long lSize = sizeof ( Send_User ) * lCount + sizeof ( long ) ;
HGLOBAL hData = GlobalAlloc ( GHND | GMEM_SHARE , lSize ) ;
BYTE * pS = ( BYTE * ) GlobalLock ( hData ) ;
memset ( pS , 0 , lSize ) ;
long * plCount = ( long * ) pS ;
Send_User * pUser = ( Send_User * ) ( pS + sizeof ( long ) ) ;
* plCount = lCount ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
TCHAR szSelect [ 128 ] = { 0 } ;
POSITION pos = m_wndList . GetFirstSelectedItemPosition ( ) ;
while ( pos )
{
long lItem = m_wndList . GetNextSelectedItem ( pos ) ;
long lUserID = m_wndList . GetItemData ( lItem ) ;
if ( lUserID > 0 )
{
_stprintf ( szSelect , _T ( " select * from kaddress where UserID=%d " ) , lUserID ) ;
BOOL b = m_AdoRS . Open ( szSelect ) ;
if ( b & & m_AdoRS . GetRecordCount ( ) )
{
m_AdoRS . MoveFirst ( ) ;
m_AdoRS . GetCollect ( _T ( " Name " ) , pUser - > szName ) ;
//m_AdoRS.GetCollect( _T("NickName") , pUser->szNickName);
m_AdoRS . GetCollect ( _T ( " Mobile " ) , pUser - > szMobile ) ;
m_AdoRS . GetCollect ( _T ( " BZ " ) , pUser - > szBZ ) ;
}
}
pUser + + ;
}
GlobalUnlock ( hData ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
COleDataSource data ;
UINT iCF = : : RegisterClipboardFormat ( _T ( " CORPSMS_USER " ) ) ;
data . CacheGlobalData ( iCF , hData ) ;
// Begin Drag operation
CUserDropTarget : : m_shWndTreeCtrl = NULL ;
CUserDropTarget : : m_lAddressType = - 1 ;
DROPEFFECT dropeffect = data . DoDragDrop ( ) ;
GlobalFree ( hData ) ;
return true ;
}
void CFKAddress : : On_User_Add ( )
{
if ( m_bFind2 ) //<2F> <> <EFBFBD> ڲ<EFBFBD> ѯ<EFBFBD> <D1AF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> ˲<EFBFBD> <CBB2> <EFBFBD> <EFBFBD> <EFBFBD> Ч
return ;
KAddress Address = { 0 } ;
_tcscpy ( Address . szGroupID , m_szGroupID ) ;
Address . szUserType [ 0 ] = ' 1 ' ; //<2F> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD>
DLG_User_ModifyK dlg ( this ) ;
dlg . SetParam ( Address , m_szLocal , true ) ;
dlg . DoModal ( ) ;
}
void CFKAddress : : On_User_AddGroup ( )
{
if ( m_bFind2 ) //<2F> <> <EFBFBD> ڲ<EFBFBD> ѯ<EFBFBD> <D1AF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> ˲<EFBFBD> <CBB2> <EFBFBD> <EFBFBD> <EFBFBD> Ч
return ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ܽ<EFBFBD> 12<31> <32> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
if ( _tcslen ( m_szGroupID ) > 12 )
{
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> <EFBFBD> <EFBFBD> !" ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , MB_ICONWARNING ) ;
return ;
}
ANS_GAddress_Group_AddData GAdd = { 0 } ;
//<2F> <> <EFBFBD> ҿ<EFBFBD> <D2BF> е <EFBFBD> <D0B5> <EFBFBD> ID
long lGroupLen = _tcslen ( m_szGroupID ) ;
TCHAR szSelect [ 128 ] = { 0 } ;
_stprintf ( szSelect , _T ( " select GroupID from kaddress where GroupID like '%s_' AND UserType='0' " ) , m_szGroupID ) ; //<2F> <> <EFBFBD> ҵ<EFBFBD> ǰ<EFBFBD> <C7B0> <EFBFBD> µĵ<C2B5> һ <EFBFBD> <D2BB>
BOOL b = m_AdoRS . Open ( szSelect ) ;
CStringSort sort ;
CString strTemp ;
while ( ! m_AdoRS . IsEOF ( ) )
{
m_AdoRS . GetCollect ( _T ( " GroupID " ) , strTemp ) ;
sort . Add ( strTemp ) ;
m_AdoRS . MoveNext ( ) ;
}
long lCount = sort . GetCount ( ) ;
long lAllCount = GROUPID_END - GROUPID_BEGIN ;
if ( lCount > = GROUPID_END - GROUPID_BEGIN )
{
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> <EFBFBD> <EFBFBD> !" ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , MB_ICONWARNING ) ;
return ;
}
TCHAR szGroupID [ 16 ] = { 0 } ;
_tcscpy ( szGroupID , m_szGroupID ) ;
//<2F> <> ס <EFBFBD> <D7A1> <EFBFBD> е <EFBFBD> <D0B5> <EFBFBD> ID
TCHAR szAllID [ 200 ] [ 24 ] = { 0 } ;
for ( int i = 0 ; i < lCount ; i + + )
{
_tcscpy ( szAllID [ i ] , sort . GetAt ( i ) ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ID
for ( i = 0 ; i < lCount ; i + + )
{
BOOL bFound = false ;
for ( int j = 0 ; j < lCount ; j + + )
{
if ( szAllID [ j ] [ lGroupLen ] = = GROUPID_BEGIN + i )
{
bFound = true ;
}
}
if ( ! bFound )
break ;
}
szGroupID [ lGroupLen ] = GROUPID_BEGIN + i ; //<2F> µ<EFBFBD> <C2B5> <EFBFBD> ID
_tcscpy ( GAdd . szGroupID , szGroupID ) ;
: : GetLocalTime ( & GAdd . tCreateTime ) ;
DLG_Group_Modify dlg ( this ) ;
dlg . SetParam ( GAdd , m_szLocal , _T ( " kaddress " ) ) ;
if ( dlg . DoModal ( ) = = IDOK )
{
GAdd = dlg . GetParam ( ) ;
//<2F> <> <EFBFBD> ӵ<EFBFBD> <D3B5> <EFBFBD> <EFBFBD> ݿ<EFBFBD> <DDBF> <EFBFBD>
BOOL b = m_AdoRS . Open ( _T ( " kaddress " ) , adCmdTable ) ;
if ( b )
{
m_AdoRS . AddNew ( ) ;
m_AdoRS . PutCollect ( _T ( " UserType " ) , _T ( " 0 " ) ) ; //<2F> û<EFBFBD> <C3BB> <EFBFBD>
m_AdoRS . PutCollect ( _T ( " GroupID " ) , GAdd . szGroupID ) ;
m_AdoRS . PutCollect ( _T ( " Name " ) , GAdd . szGroupName ) ;
m_AdoRS . PutCollect ( _T ( " CreateTime " ) , COleDateTime : : GetCurrentTime ( ) ) ;
m_AdoRS . PutCollect ( _T ( " BZ " ) , GAdd . szBZ ) ;
m_AdoRS . Update ( ) ;
m_AdoRS . GetCollect ( _T ( " UserID " ) , GAdd . lUserID ) ;
}
//<2F> <> <EFBFBD> ӵ<EFBFBD> <D3B5> <EFBFBD>
m_pFuncView - > AddKGroup ( GAdd . szGroupName , m_lUserID , GAdd . lUserID ) ;
}
}
void CFKAddress : : On_User_Modify ( )
{
long lItem = GetCurrentSelected ( ) ;
if ( lItem < 0 )
return ;
long lUserID = m_wndList . GetItemData ( lItem ) ;
CString str ;
KAddress Address = GetUserData ( lUserID ) ;
if ( _tcslen ( Address . szName ) > 0 )
{
DLG_User_ModifyK dlg ( this ) ;
TCHAR szLocal [ 128 ] = { 0 } ;
GetLocal ( szLocal , Address . szGroupID ) ; //ȡ<> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λ<EFBFBD> <CEBB>
dlg . SetParam ( Address , szLocal , false ) ;
if ( dlg . DoModal ( ) = = IDOK )
{
Address = dlg . GetParam ( ) ;
//m_wndList.SetHeadings(_T("<22> <> <EFBFBD> <EFBFBD> ,50; <20> <> <EFBFBD> <EFBFBD> ,80; <20> 绰,80;<3B> ֻ<EFBFBD> ,100; <20> <> <EFBFBD> <EFBFBD> ,90; ʡ<> <CAA1> ,100; <20> <> <EFBFBD> <EFBFBD> ,100; <20> <> <EFBFBD> <EFBFBD> ,100;"));
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> µ<EFBFBD> <C2B5> <EFBFBD> <EFBFBD> <EFBFBD>
m_wndList . SetItemText ( lItem , 1 , Address . szName ) ;
m_wndList . SetItemText ( lItem , 2 , Address . szTel ) ;
m_wndList . SetItemText ( lItem , 3 , Address . szMobile ) ;
COleDateTime t ( Address . tBirthday ) ;
if ( t . GetStatus ( ) = = COleDateTime : : valid )
{
str . Format ( _T ( " %04d.%02d.%02d " ) , t . GetYear ( ) , t . GetMonth ( ) , t . GetDay ( ) ) ;
m_wndList . SetItemText ( lItem , 4 , str ) ;
}
else
{
m_wndList . SetItemText ( lItem , 4 , _T ( " " ) ) ;
}
m_wndList . SetItemText ( lItem , 5 , Address . szProvince ) ;
m_wndList . SetItemText ( lItem , 6 , Address . szCarNum ) ;
m_wndList . SetItemText ( lItem , 7 , Address . szCarType ) ;
//<2F> <> <EFBFBD> µ<EFBFBD> <C2B5> <EFBFBD> <EFBFBD> <EFBFBD> д<EFBFBD> 뱾<EFBFBD> <EBB1BE> <EFBFBD> <EFBFBD> <EFBFBD> ݿ<EFBFBD>
TCHAR szSelect [ 128 ] = { 0 } ;
_stprintf ( szSelect , _T ( " select * from kaddress where UserID=%d " ) , Address . lUserID ) ;
BOOL b = m_AdoRS . Open ( szSelect ) ;
if ( b & & m_AdoRS . GetRecordCount ( ) )
{
m_AdoRS . MoveFirst ( ) ;
m_AdoRS . PutCollect ( _T ( " UserType " ) , Address . szUserType ) ;
m_AdoRS . PutCollect ( _T ( " GroupID " ) , Address . szGroupID ) ;
m_AdoRS . PutCollect ( _T ( " Name " ) , Address . szName ) ;
m_AdoRS . PutCollect ( _T ( " CarNum " ) , Address . szCarNum ) ;
m_AdoRS . PutCollect ( _T ( " Province " ) , Address . szProvince ) ;
m_AdoRS . PutCollect ( _T ( " Addr " ) , Address . szAddr ) ;
m_AdoRS . PutCollect ( _T ( " Corp " ) , Address . szCorp ) ;
m_AdoRS . PutCollect ( _T ( " Postcode " ) , Address . szPostcode ) ;
m_AdoRS . PutCollect ( _T ( " Tel " ) , Address . szTel ) ;
m_AdoRS . PutCollect ( _T ( " Mobile " ) , Address . szMobile ) ;
m_AdoRS . PutCollect ( _T ( " SFZ " ) , Address . szSFZ ) ;
m_AdoRS . PutCollect ( _T ( " Birthday " ) , Address . tBirthday ) ;
m_AdoRS . PutCollect ( _T ( " BuyDate " ) , Address . tBuyDate ) ;
m_AdoRS . PutCollect ( _T ( " RegDate " ) , Address . tRegDate ) ;
m_AdoRS . PutCollect ( _T ( " SCDate " ) , Address . tSCDate ) ;
m_AdoRS . PutCollect ( _T ( " BuyProvince " ) , Address . szBuyProvince ) ;
m_AdoRS . PutCollect ( _T ( " BuyCity " ) , Address . szBuyCity ) ;
m_AdoRS . PutCollect ( _T ( " CarType " ) , Address . szCarType ) ;
m_AdoRS . PutCollect ( _T ( " FDJNum " ) , Address . szFDJNum ) ;
m_AdoRS . PutCollect ( _T ( " DPNum " ) , Address . szDPNum ) ;
m_AdoRS . PutCollect ( _T ( " SCNum " ) , Address . szSCNum ) ;
m_AdoRS . PutCollect ( _T ( " FWNum " ) , Address . szFWNum ) ;
m_AdoRS . PutCollect ( _T ( " FWName " ) , Address . szFWName ) ;
m_AdoRS . PutCollect ( _T ( " BZ " ) , Address . szBZ ) ;
m_AdoRS . Update ( ) ;
m_AdoRS . Close ( ) ;
}
}
}
}
void CFKAddress : : On_User_Del ( )
{
long lRet = MessageBox ( _T ( " ȷʵҪɾ<EFBFBD> <EFBFBD> ѡ <EFBFBD> е <EFBFBD> <EFBFBD> û<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2 ) ;
if ( lRet ! = IDYES )
return ;
long lCount = m_wndList . GetSelectedCount ( ) ;
long * lDel = new long [ lCount + 2 ] ;
POSITION pos = m_wndList . GetFirstSelectedItemPosition ( ) ;
long i = 0 ;
while ( pos )
{
lDel [ i ] = m_wndList . GetNextSelectedItem ( pos ) ;
i + + ;
}
long lUserID = 0 ;
TCHAR szSelect [ 128 ] ;
//<2F> <> תɾ<D7AA> <C9BE>
m_wndList . ShowWindow ( SW_HIDE ) ; //<2F> ӿ<EFBFBD> <D3BF> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> ٶ<EFBFBD>
for ( i = lCount ; i > 0 ; i - - )
{
lUserID = m_wndList . GetItemData ( lDel [ i - 1 ] ) ;
_stprintf ( szSelect , _T ( " delete from kaddress where UserID=%d " ) , lUserID ) ;
BOOL b = m_AdoRS . Open ( szSelect ) ;
if ( b & & m_AdoRS . GetRecordCount ( ) )
{
m_wndList . DeleteItem ( lDel [ i - 1 ] ) ; //<2F> <> <EFBFBD> б <EFBFBD> <D0B1> <EFBFBD> ɾ<EFBFBD> <C9BE>
}
}
m_wndList . ShowWindow ( SW_SHOW ) ; //<2F> ӿ<EFBFBD> <D3BF> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> ٶ<EFBFBD>
delete lDel ;
}
void CFKAddress : : On_User_Find ( )
{
KAddress Address = { 0 } ;
_tcscpy ( Address . szGroupID , m_szGroupID ) ;
Address . szUserType [ 0 ] = ' 1 ' ; //<2F> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD>
DLG_User_ModifyK dlg ( this ) ;
dlg . SetParam ( Address , m_szLocal , true , true ) ;
if ( dlg . DoModal ( ) = = IDOK )
{
CString strFind = " " ;
CString strTemp ;
Address = dlg . GetParam ( ) ;
if ( _tcslen ( Address . szName ) > 0 ) //<2F> <> <20> <>
{
strTemp . Format ( _T ( " and Name like '%%%s%%' " ) , Address . szName ) ;
strFind + = strTemp ;
}
if ( _tcslen ( Address . szCarNum ) > 0 ) //<2F> <> <20> <>
{
strTemp . Format ( _T ( " and CarNum like '%%%s%%' " ) , Address . szCarNum ) ;
strFind + = strTemp ;
}
if ( _tcslen ( Address . szProvince ) > 0 ) //ʡ <20> <>
{
strTemp . Format ( _T ( " and Province like '%%%s%%' " ) , Address . szProvince ) ;
strFind + = strTemp ;
}
if ( _tcslen ( Address . szAddr ) > 0 ) //<2F> <> ַ
{
strTemp . Format ( _T ( " and Addr like '%%%s%%' " ) , Address . szAddr ) ;
strFind + = strTemp ;
}
if ( _tcslen ( Address . szCorp ) > 0 ) //<2F> <> ַ
{
strTemp . Format ( _T ( " and Corp like '%%%s%%' " ) , Address . szCorp ) ;
strFind + = strTemp ;
}
if ( _tcslen ( Address . szPostcode ) > 0 ) //<2F> <> <20> <>
{
strTemp . Format ( _T ( " and Postcode like '%%%s%%' " ) , Address . szPostcode ) ;
strFind + = strTemp ;
}
if ( _tcslen ( Address . szTel ) > 0 ) //<2F> <> <20> <>
{
strTemp . Format ( _T ( " and Tel like '%%%s%%' " ) , Address . szTel ) ;
strFind + = strTemp ;
}
if ( _tcslen ( Address . szMobile ) > 0 ) //<2F> <> <20> <>
{
strTemp . Format ( _T ( " and Mobile like '%%%s%%' " ) , Address . szMobile ) ;
strFind + = strTemp ;
}
if ( _tcslen ( Address . szSFZ ) > 0 ) //<2F> <> <EFBFBD> <EFBFBD> ֤<EFBFBD> <D6A4>
{
strTemp . Format ( _T ( " and SFZ like '%%%s%%' " ) , Address . szSFZ ) ;
strFind + = strTemp ;
}
if ( _tcslen ( Address . szBuyProvince ) > 0 ) //<2F> <> <EFBFBD> <EFBFBD> ʡ<EFBFBD> <CAA1>
{
strTemp . Format ( _T ( " and BuyProvince like '%%%s%%' " ) , Address . szBuyProvince ) ;
strFind + = strTemp ;
}
if ( _tcslen ( Address . szBuyCity ) > 0 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
strTemp . Format ( _T ( " and BuyCity like '%%%s%%' " ) , Address . szBuyCity ) ;
strFind + = strTemp ;
}
if ( _tcslen ( Address . szCarType ) > 0 ) //<2F> <> <20> <>
{
strTemp . Format ( _T ( " and CarType like '%%%s%%' " ) , Address . szCarType ) ;
strFind + = strTemp ;
}
if ( _tcslen ( Address . szFDJNum ) > 0 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
strTemp . Format ( _T ( " and FDJNum like '%%%s%%' " ) , Address . szFDJNum ) ;
strFind + = strTemp ;
}
if ( _tcslen ( Address . szDPNum ) > 0 ) //<2F> <> <EFBFBD> ̺<EFBFBD>
{
strTemp . Format ( _T ( " and DPNum like '%%%s%%' " ) , Address . szDPNum ) ;
strFind + = strTemp ;
}
if ( _tcslen ( Address . szSCNum ) > 0 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
strTemp . Format ( _T ( " and SCNum like '%%%s%%' " ) , Address . szSCNum ) ;
strFind + = strTemp ;
}
if ( _tcslen ( Address . szFWNum ) > 0 ) //<2F> <> <EFBFBD> <EFBFBD> վ<EFBFBD> <D5BE> <EFBFBD> <EFBFBD>
{
strTemp . Format ( _T ( " and FWNum like '%%%s%%' " ) , Address . szFWNum ) ;
strFind + = strTemp ;
}
if ( _tcslen ( Address . szFWName ) > 0 ) //<2F> <> <EFBFBD> <EFBFBD> վ<EFBFBD> <D5BE> <EFBFBD> <EFBFBD>
{
strTemp . Format ( _T ( " and FWName like '%%%s%%' " ) , Address . szFWName ) ;
strFind + = strTemp ;
}
if ( _tcslen ( Address . szBZ ) > 0 ) //<2F> <> ע
{
strTemp . Format ( _T ( " and BZ like '%%%s%%' " ) , Address . szBZ ) ;
strFind + = strTemp ;
}
if ( COleDateTime ( Address . tBirthday ) . GetStatus ( ) = = COleDateTime : : valid )
{
if ( m_pMainFrame - > m_Setup . bSQLUse )
strTemp . Format ( _T ( " and Birthday='%04d%02d%02d' " ) , Address . tBirthday . wYear , Address . tBirthday . wMonth , Address . tBirthday . wDay ) ;
else
strTemp . Format ( _T ( " and Birthday=#%04d-%02d-%02d# " ) , Address . tBirthday . wYear , Address . tBirthday . wMonth , Address . tBirthday . wDay ) ;
strFind + = strTemp ;
}
if ( COleDateTime ( Address . tBuyDate ) . GetStatus ( ) = = COleDateTime : : valid )
{
if ( m_pMainFrame - > m_Setup . bSQLUse )
strTemp . Format ( _T ( " and BuyDate='%04d%02d%02d' " ) , Address . tBuyDate . wYear , Address . tBuyDate . wMonth , Address . tBuyDate . wDay ) ;
else
strTemp . Format ( _T ( " and BuyDate=#%04d-%02d-%02d# " ) , Address . tBuyDate . wYear , Address . tBuyDate . wMonth , Address . tBuyDate . wDay ) ;
strFind + = strTemp ;
}
if ( COleDateTime ( Address . tRegDate ) . GetStatus ( ) = = COleDateTime : : valid )
{
if ( m_pMainFrame - > m_Setup . bSQLUse )
strTemp . Format ( _T ( " and RegDate='%04d%02d%02d' " ) , Address . tRegDate . wYear , Address . tRegDate . wMonth , Address . tRegDate . wDay ) ;
else
strTemp . Format ( _T ( " and RegDate=#%04d-%02d-%02d# " ) , Address . tRegDate . wYear , Address . tRegDate . wMonth , Address . tRegDate . wDay ) ;
strFind + = strTemp ;
}
if ( COleDateTime ( Address . tSCDate ) . GetStatus ( ) = = COleDateTime : : valid )
{
if ( m_pMainFrame - > m_Setup . bSQLUse )
strTemp . Format ( _T ( " and SCDate='%04d%02d%02d' " ) , Address . tSCDate . wYear , Address . tSCDate . wMonth , Address . tSCDate . wDay ) ;
else
strTemp . Format ( _T ( " and SCDate=#%04d-%02d-%02d# " ) , Address . tSCDate . wYear , Address . tSCDate . wMonth , Address . tSCDate . wDay ) ;
strFind + = strTemp ;
}
ShowUser ( m_lUserID , strFind , Address . bGroupAll ) ;
if ( m_wndList . GetItemCount ( ) < = 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> " ) , _T ( " <EFBFBD> <EFBFBD> Ϣ" ) , MB_ICONINFORMATION ) ;
}
}
}
void CFKAddress : : On_User_AddToList ( )
{
if ( ! m_pMainFrame - > GetUserPurview ( PURVIEW_SENDP , true ) )
return ;
long lCount = m_wndList . GetSelectedCount ( ) ;
if ( lCount < = 0 )
return ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
long lSize = sizeof ( Send_User ) * lCount ;
BYTE * pS = new BYTE [ lSize ] ;
memset ( pS , 0 , lSize ) ;
Send_User * pUser = ( Send_User * ) pS ;
TCHAR szSelect [ 128 ] = { 0 } ;
POSITION pos = m_wndList . GetFirstSelectedItemPosition ( ) ;
while ( pos )
{
long lItem = m_wndList . GetNextSelectedItem ( pos ) ;
long lUserID = m_wndList . GetItemData ( lItem ) ;
if ( lUserID > 0 )
{
_stprintf ( szSelect , _T ( " select * from kaddress where UserID=%d " ) , lUserID ) ;
BOOL b = m_AdoRS . Open ( szSelect ) ;
if ( b & & m_AdoRS . GetRecordCount ( ) )
{
m_AdoRS . MoveFirst ( ) ;
m_AdoRS . GetCollect ( _T ( " Name " ) , pUser - > szName ) ;
//m_AdoRS.GetCollect( _T("NickName") , pUser->szNickName);
m_AdoRS . GetCollect ( _T ( " Mobile " ) , pUser - > szMobile ) ;
m_AdoRS . GetCollect ( _T ( " BZ " ) , pUser - > szBZ ) ;
}
}
pUser + + ;
}
m_pFuncView - > On_User_List_AddUser ( lCount , ( Send_User * ) pS ) ;
delete pS ;
}
void CFKAddress : : On_User_Inport ( )
{
if ( m_bFind2 ) //<2F> <> <EFBFBD> ڲ<EFBFBD> ѯ<EFBFBD> <D1AF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> ˲<EFBFBD> <CBB2> <EFBFBD> <EFBFBD> <EFBFBD> Ч
return ;
DLG_User_InportK dlg ( this ) ;
dlg . SetInport ( this , & m_wndList , true ) ;
if ( dlg . DoModal ( ) = = IDOK )
{
/*
POSITION pos = dlg . m_User . GetHeadPosition ( ) ;
CString str ;
BOOL bShowReMobile = true ;
long lReMobileType = 0 ; ;
m_wndList . ShowWindow ( SW_HIDE ) ; //Ϊ<> ˼ӿ<CBBC> <D3BF> <EFBFBD> ʾ <EFBFBD> ٶ<EFBFBD>
while ( pos )
{
BOOL bAdd = true ;
ANS_GAddress_SeeData Address = * dlg . m_User . GetNext ( pos ) ;
if ( _tcslen ( Address . szName ) > 0 )
{
//<2F> ȼ<EFBFBD> <C8BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƿ<EFBFBD> <C7B7> <EFBFBD> <EFBFBD> ڴ<EFBFBD> <DAB4> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڣ<EFBFBD> <DAA3> <EFBFBD> ʾ
if ( dlg . m_bReMobile & & _tcslen ( Address . szMobile ) > = 11 )
{
str . Format ( " select * from kaddress where Mobile='%s' " , Address . szMobile ) ;
if ( m_AdoRS . Open ( str ) & & m_AdoRS . GetRecordCount ( ) > 0 )
{
//<2F> ҵ<EFBFBD> <D2B5> <EFBFBD> ¼<EFBFBD> <C2BC> ֤<EFBFBD> <D6A4> <EFBFBD> <EFBFBD> <EFBFBD> ظ<EFBFBD> <D8B8> ĺ<EFBFBD> <C4BA> <EFBFBD>
m_AdoRS . Close ( ) ;
if ( bShowReMobile )
{
str . Format ( " %s,%s " , Address . szName , Address . szMobile ) ;
DLG_AddWarning dlg ( str , this ) ; //<2F> <> ʾ <EFBFBD> ظ<EFBFBD> <D8B8> <EFBFBD> <EFBFBD> <EFBFBD>
dlg . DoModal ( ) ;
bShowReMobile = dlg . m_bShowReMobile ;
lReMobileType = dlg . m_lReMobileType ;
}
if ( lReMobileType = = 0 ) //<2F> <> <EFBFBD> <EFBFBD>
{
bAdd = false ;
}
}
}
if ( bAdd )
{
long lCount = m_wndList . GetItemCount ( ) ;
char Buf [ 32 ] ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> µ<EFBFBD> <C2B5> <EFBFBD> <EFBFBD> <EFBFBD>
//m_wndList.SetHeadings(_T("<22> <> <EFBFBD> <EFBFBD> ,50;<3B> <> ¼<EFBFBD> <C2BC> ,80; <20> <> <EFBFBD> <EFBFBD> ,80; <20> dz<EFBFBD> 80;ְ<> <D6B0> ,80;<3B> 绰,80;<3B> ֻ<EFBFBD> ,80;Email,80;"));
m_wndList . InsertItem ( lCount , _itot ( lCount + 1 , Buf , 10 ) ) ; //<2F> <> <EFBFBD> <EFBFBD>
m_wndList . SetItemText ( lCount , 1 , Address . szName ) ;
m_wndList . SetItemText ( lCount , 2 , Address . szNickName ) ;
COleDateTime t ( Address . tBirthday ) ;
if ( t . GetStatus ( ) = = COleDateTime : : valid )
{
str . Format ( " %04d.%02d.%02d " , t . GetYear ( ) , t . GetMonth ( ) , t . GetDay ( ) ) ;
m_wndList . SetItemText ( lCount , 3 , str ) ;
}
else
{
m_wndList . SetItemText ( lCount , 3 , " " ) ;
}
m_wndList . SetItemText ( lCount , 4 , Address . szJob ) ;
m_wndList . SetItemText ( lCount , 5 , Address . szTel ) ;
m_wndList . SetItemText ( lCount , 6 , Address . szMobile ) ;
m_wndList . SetItemText ( lCount , 7 , Address . szEmail ) ;
//<2F> <> <EFBFBD> ӵ<EFBFBD> <D3B5> <EFBFBD> <EFBFBD> ݿ<EFBFBD> <DDBF> <EFBFBD>
BOOL b = m_AdoRS . Open ( " kaddress " , adCmdTable ) ;
if ( b )
{
m_AdoRS . AddNew ( ) ;
m_AdoRS . PutCollect ( " UserType " , " 1 " ) ;
m_AdoRS . PutCollect ( " GroupID " , m_szGroupID ) ;
m_AdoRS . PutCollect ( " Name " , Address . szName ) ;
m_AdoRS . PutCollect ( " NickName " , Address . szNickName ) ;
m_AdoRS . PutCollect ( " Sex " , Address . szSex ) ;
m_AdoRS . PutCollect ( " Birthday " , Address . tBirthday ) ;
m_AdoRS . PutCollect ( " Job " , Address . szJob ) ;
m_AdoRS . PutCollect ( " Tel " , Address . szTel ) ;
m_AdoRS . PutCollect ( " Fax " , Address . szFax ) ;
m_AdoRS . PutCollect ( " Mobile " , Address . szMobile ) ;
m_AdoRS . PutCollect ( " Email " , Address . szEmail ) ;
m_AdoRS . PutCollect ( " QQ " , Address . szQQ ) ;
m_AdoRS . PutCollect ( " BZ " , Address . szBZ ) ;
m_AdoRS . Update ( ) ;
m_AdoRS . GetCollect ( " UserID " , Address . lUserID ) ; //ȡ<> <C8A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ӵ<EFBFBD> UserID
m_wndList . SetItemData ( lCount , Address . lUserID ) ;
m_AdoRS . Close ( ) ;
}
}
}
}
m_wndList . ShowWindow ( SW_SHOW ) ; //Ϊ<> ˼ӿ<CBBC> <D3BF> <EFBFBD> ʾ <EFBFBD> ٶ<EFBFBD>
*/
}
// dlg.Close(); //<2F> ر<EFBFBD> <D8B1> <EFBFBD> <EFBFBD> <EFBFBD>
}
void CFKAddress : : On_User_Export ( )
{
DLG_User_InportK dlg ( this ) ;
dlg . SetInport ( this , & m_wndList , false ) ;
dlg . DoModal ( ) ;
}
void CFKAddress : : On_User_Refresh ( )
{
ShowUser ( m_lUserID ) ; //ˢ<> <CBA2>
}
void CFKAddress : : On_User_Copy ( )
{
if ( m_bFind2 ) //<2F> <> <EFBFBD> ڲ<EFBFBD> ѯ<EFBFBD> <D1AF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> ˲<EFBFBD> <CBB2> <EFBFBD> <EFBFBD> <EFBFBD> Ч
return ;
long lCount = m_wndList . GetSelectedCount ( ) ;
if ( lCount < = 0 )
return ;
m_Copy_UserID = m_lUserID ;
_tcscpy ( m_Copy_GroupID , m_szGroupID ) ;
m_Copy_Count = lCount ;
if ( m_Copy_Data )
{
delete m_Copy_Data ;
m_Copy_Data = NULL ;
}
m_Copy_Data = new KAddress [ lCount ] ;
memset ( m_Copy_Data , 0 , sizeof ( PAddress ) * lCount ) ;
POSITION pos = m_wndList . GetFirstSelectedItemPosition ( ) ;
long i = 0 ;
long lItem = 0 ;
long lUserID = 0 ;
while ( pos )
{
lItem = m_wndList . GetNextSelectedItem ( pos ) ;
lUserID = m_wndList . GetItemData ( lItem ) ;
m_Copy_Data [ i ] = GetUserData ( lUserID ) ;
i + + ;
}
m_Copy_Count = i ;
m_Copy_Type = KADDRESS_COPYTYPE_COPY ;
}
void CFKAddress : : On_User_Cut ( )
{
On_User_Copy ( ) ;
m_Copy_Type = KADDRESS_COPYTYPE_CUT ;
}
void CFKAddress : : On_User_Paste ( )
{
if ( m_bFind2 | | m_lUserID = = m_Copy_UserID | | m_Copy_Count < = 0 ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
return ;
CString str ;
if ( m_Copy_Type = = KADDRESS_COPYTYPE_CUT ) //<2F> <> <EFBFBD> <EFBFBD> ,ֱ<> Ӹ<EFBFBD> <D3B8> <EFBFBD> <EFBFBD> <EFBFBD> ID<49> <44> <EFBFBD> <EFBFBD>
{
for ( int i = 0 ; i < m_Copy_Count ; i + + )
{
str . Format ( _T ( " Update kaddress set GroupID='%s' where UserID=%d " ) , m_szGroupID , m_Copy_Data [ i ] . lUserID ) ;
m_AdoRS . Open ( str ) ;
m_AdoRS . Close ( ) ;
}
}
else
{
if ( m_AdoRS . Open ( _T ( " kaddress " ) , adCmdTable ) )
{
for ( int i = 0 ; i < m_Copy_Count ; i + + )
{
m_AdoRS . AddNew ( ) ;
m_AdoRS . PutCollect ( _T ( " UserType " ) , m_Copy_Data [ i ] . szUserType ) ;
m_AdoRS . PutCollect ( _T ( " GroupID " ) , m_szGroupID ) ;
m_AdoRS . PutCollect ( _T ( " Name " ) , m_Copy_Data [ i ] . szName ) ;
m_AdoRS . PutCollect ( _T ( " CarNum " ) , m_Copy_Data [ i ] . szCarNum ) ;
m_AdoRS . PutCollect ( _T ( " Province " ) , m_Copy_Data [ i ] . szProvince ) ;
m_AdoRS . PutCollect ( _T ( " Addr " ) , m_Copy_Data [ i ] . szAddr ) ;
m_AdoRS . PutCollect ( _T ( " Corp " ) , m_Copy_Data [ i ] . szCorp ) ;
m_AdoRS . PutCollect ( _T ( " Postcode " ) , m_Copy_Data [ i ] . szPostcode ) ;
m_AdoRS . PutCollect ( _T ( " Tel " ) , m_Copy_Data [ i ] . szTel ) ;
m_AdoRS . PutCollect ( _T ( " Mobile " ) , m_Copy_Data [ i ] . szMobile ) ;
m_AdoRS . PutCollect ( _T ( " SFZ " ) , m_Copy_Data [ i ] . szSFZ ) ;
m_AdoRS . PutCollect ( _T ( " Birthday " ) , m_Copy_Data [ i ] . tBirthday ) ;
m_AdoRS . PutCollect ( _T ( " BuyDate " ) , m_Copy_Data [ i ] . tBuyDate ) ;
m_AdoRS . PutCollect ( _T ( " RegDate " ) , m_Copy_Data [ i ] . tRegDate ) ;
m_AdoRS . PutCollect ( _T ( " SCDate " ) , m_Copy_Data [ i ] . tSCDate ) ;
m_AdoRS . PutCollect ( _T ( " BuyProvince " ) , m_Copy_Data [ i ] . szBuyProvince ) ;
m_AdoRS . PutCollect ( _T ( " BuyCity " ) , m_Copy_Data [ i ] . szBuyCity ) ;
m_AdoRS . PutCollect ( _T ( " CarType " ) , m_Copy_Data [ i ] . szCarType ) ;
m_AdoRS . PutCollect ( _T ( " FDJNum " ) , m_Copy_Data [ i ] . szFDJNum ) ;
m_AdoRS . PutCollect ( _T ( " DPNum " ) , m_Copy_Data [ i ] . szDPNum ) ;
m_AdoRS . PutCollect ( _T ( " SCNum " ) , m_Copy_Data [ i ] . szSCNum ) ;
m_AdoRS . PutCollect ( _T ( " FWNum " ) , m_Copy_Data [ i ] . szFWNum ) ;
m_AdoRS . PutCollect ( _T ( " FWName " ) , m_Copy_Data [ i ] . szFWName ) ;
m_AdoRS . PutCollect ( _T ( " BZ " ) , m_Copy_Data [ i ] . szBZ ) ;
m_AdoRS . PutCollect ( _T ( " CreateTime " ) , COleDateTime : : GetCurrentTime ( ) ) ;
m_AdoRS . Update ( ) ;
m_AdoRS . GetCollect ( _T ( " UserID " ) , m_Copy_Data [ i ] . lUserID ) ; //ȡ<> <C8A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ӵ<EFBFBD> UserID
}
m_AdoRS . Close ( ) ;
}
}
//<2F> <> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD>
for ( int i = 0 ; i < m_Copy_Count ; i + + )
{
long lCount = m_wndList . GetItemCount ( ) ;
TCHAR Buf [ 32 ] ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> µ<EFBFBD> <C2B5> <EFBFBD> <EFBFBD> <EFBFBD>
//m_wndList.SetHeadings(_T("<22> <> <EFBFBD> <EFBFBD> ,50;<3B> <> ¼<EFBFBD> <C2BC> ,80; <20> <> <EFBFBD> <EFBFBD> ,80; <20> dz<EFBFBD> 80;ְ<> <D6B0> ,80;<3B> 绰,80;<3B> ֻ<EFBFBD> ,80;Email,80;"));
m_wndList . InsertItem ( lCount , _itot ( lCount + 1 , Buf , 10 ) ) ; //<2F> <> <EFBFBD> <EFBFBD>
m_wndList . SetItemText ( lCount , 1 , m_Copy_Data [ i ] . szName ) ;
m_wndList . SetItemText ( lCount , 2 , m_Copy_Data [ i ] . szTel ) ;
m_wndList . SetItemText ( lCount , 3 , m_Copy_Data [ i ] . szMobile ) ;
COleDateTime t ( m_Copy_Data [ i ] . tBirthday ) ;
if ( t . GetStatus ( ) = = COleDateTime : : valid )
{
str . Format ( _T ( " %04d.%02d.%02d " ) , t . GetYear ( ) , t . GetMonth ( ) , t . GetDay ( ) ) ;
m_wndList . SetItemText ( lCount , 4 , str ) ;
}
else
{
m_wndList . SetItemText ( lCount , 4 , _T ( " " ) ) ;
}
m_wndList . SetItemText ( lCount , 5 , m_Copy_Data [ i ] . szProvince ) ;
m_wndList . SetItemText ( lCount , 6 , m_Copy_Data [ i ] . szCarNum ) ;
m_wndList . SetItemText ( lCount , 7 , m_Copy_Data [ i ] . szCarType ) ;
m_wndList . SetItemData ( lCount , m_Copy_Data [ i ] . lUserID ) ;
}
if ( m_Copy_Type = = PADDRESS_COPYTYPE_CUT )
{
//ÿ<> <C3BF> ֻ<EFBFBD> <D6BB> <EFBFBD> <EFBFBD> һ <EFBFBD> β<EFBFBD> <CEB2> <EFBFBD>
m_Copy_UserID = 0 ;
memset ( m_Copy_GroupID , 0 , sizeof ( m_Copy_GroupID ) ) ;
m_Copy_Count = 0 ;
m_Copy_Type = 0 ;
m_Copy_Data = NULL ;
}
}
BOOL CFKAddress : : AddUser ( KAddress user , BOOL bShow )
{
KAddress Address = user ;
long lCount = 0 ;
if ( bShow )
{
lCount = m_wndList . GetItemCount ( ) ;
TCHAR Buf [ 32 ] ;
CString str ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> µ<EFBFBD> <C2B5> <EFBFBD> <EFBFBD> <EFBFBD>
//m_wndList.SetHeadings(_T("<22> <> <EFBFBD> <EFBFBD> ,50; <20> <> <EFBFBD> <EFBFBD> ,80; <20> 绰,80;<3B> ֻ<EFBFBD> ,100; <20> <> <EFBFBD> <EFBFBD> ,90; ʡ<> <CAA1> ,100; <20> <> <EFBFBD> <EFBFBD> ,100; <20> <> <EFBFBD> <EFBFBD> ,100;"));
m_wndList . InsertItem ( lCount , _itot ( lCount + 1 , Buf , 10 ) ) ; //<2F> <> <EFBFBD> <EFBFBD>
m_wndList . SetItemText ( lCount , 1 , Address . szName ) ;
m_wndList . SetItemText ( lCount , 2 , Address . szTel ) ;
m_wndList . SetItemText ( lCount , 3 , Address . szMobile ) ;
COleDateTime t ( Address . tBirthday ) ;
if ( t . GetStatus ( ) = = COleDateTime : : valid )
{
str . Format ( _T ( " %04d.%02d.%02d " ) , t . GetYear ( ) , t . GetMonth ( ) , t . GetDay ( ) ) ;
m_wndList . SetItemText ( lCount , 4 , str ) ;
}
else
{
m_wndList . SetItemText ( lCount , 4 , _T ( " " ) ) ;
}
m_wndList . SetItemText ( lCount , 5 , Address . szProvince ) ;
m_wndList . SetItemText ( lCount , 6 , Address . szCarNum ) ;
m_wndList . SetItemText ( lCount , 7 , Address . szCarType ) ;
}
//<2F> <> <EFBFBD> ӵ<EFBFBD> <D3B5> <EFBFBD> <EFBFBD> ݿ<EFBFBD> <DDBF> <EFBFBD>
BOOL b = m_AdoRS . Open ( _T ( " kaddress " ) , adCmdTable ) ;
if ( b )
{
m_AdoRS . AddNew ( ) ;
m_AdoRS . PutCollect ( _T ( " UserType " ) , Address . szUserType ) ;
m_AdoRS . PutCollect ( _T ( " GroupID " ) , Address . szGroupID ) ;
m_AdoRS . PutCollect ( _T ( " Name " ) , Address . szName ) ;
m_AdoRS . PutCollect ( _T ( " CarNum " ) , Address . szCarNum ) ;
m_AdoRS . PutCollect ( _T ( " Province " ) , Address . szProvince ) ;
m_AdoRS . PutCollect ( _T ( " Addr " ) , Address . szAddr ) ;
m_AdoRS . PutCollect ( _T ( " Corp " ) , Address . szCorp ) ;
m_AdoRS . PutCollect ( _T ( " Postcode " ) , Address . szPostcode ) ;
m_AdoRS . PutCollect ( _T ( " Tel " ) , Address . szTel ) ;
m_AdoRS . PutCollect ( _T ( " Mobile " ) , Address . szMobile ) ;
m_AdoRS . PutCollect ( _T ( " SFZ " ) , Address . szSFZ ) ;
Address . tBirthday . wHour = 0 ; Address . tBirthday . wMinute = 0 ; Address . tBirthday . wMinute = 0 ; Address . tBirthday . wSecond = 0 ; Address . tBirthday . wMilliseconds = 0 ;
Address . tBuyDate . wHour = 0 ; Address . tBuyDate . wMinute = 0 ; Address . tBuyDate . wMinute = 0 ; Address . tBuyDate . wSecond = 0 ; Address . tBuyDate . wMilliseconds = 0 ;
Address . tRegDate . wHour = 0 ; Address . tRegDate . wMinute = 0 ; Address . tRegDate . wMinute = 0 ; Address . tRegDate . wSecond = 0 ; Address . tRegDate . wMilliseconds = 0 ;
m_AdoRS . PutCollect ( _T ( " Birthday " ) , Address . tBirthday ) ;
m_AdoRS . PutCollect ( _T ( " BuyDate " ) , Address . tBuyDate ) ;
m_AdoRS . PutCollect ( _T ( " RegDate " ) , Address . tRegDate ) ;
m_AdoRS . PutCollect ( _T ( " SCDate " ) , Address . tSCDate ) ;
m_AdoRS . PutCollect ( _T ( " BuyProvince " ) , Address . szBuyProvince ) ;
m_AdoRS . PutCollect ( _T ( " BuyCity " ) , Address . szBuyCity ) ;
m_AdoRS . PutCollect ( _T ( " CarType " ) , Address . szCarType ) ;
m_AdoRS . PutCollect ( _T ( " FDJNum " ) , Address . szFDJNum ) ;
m_AdoRS . PutCollect ( _T ( " DPNum " ) , Address . szDPNum ) ;
m_AdoRS . PutCollect ( _T ( " SCNum " ) , Address . szSCNum ) ;
m_AdoRS . PutCollect ( _T ( " FWNum " ) , Address . szFWNum ) ;
m_AdoRS . PutCollect ( _T ( " FWName " ) , Address . szFWName ) ;
m_AdoRS . PutCollect ( _T ( " BZ " ) , Address . szBZ ) ;
m_AdoRS . PutCollect ( _T ( " CreateTime " ) , COleDateTime : : GetCurrentTime ( ) ) ;
m_AdoRS . Update ( ) ;
m_AdoRS . GetCollect ( _T ( " UserID " ) , Address . lUserID ) ; //ȡ<> <C8A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ӵ<EFBFBD> UserID
if ( bShow )
m_wndList . SetItemData ( lCount , Address . lUserID ) ;
}
m_AdoRS . Close ( ) ;
return true ;
}
KAddress CFKAddress : : GetUserData ( long lUserID )
{
KAddress Address = { 0 } ;
TCHAR szSelect [ 128 ] = { 0 } ;
_stprintf ( szSelect , _T ( " Select * from kaddress where UserID=%d AND UserType='1' " ) , lUserID ) ;
BOOL b = m_AdoRS . Open ( szSelect ) ;
if ( b & & m_AdoRS . GetRecordCount ( ) )
{
COleDateTime t ;
m_AdoRS . MoveFirst ( ) ;
m_AdoRS . GetCollect ( _T ( " UserID " ) , Address . lUserID ) ;
m_AdoRS . GetCollect ( _T ( " UserType " ) , Address . szUserType ) ;
m_AdoRS . GetCollect ( _T ( " GroupID " ) , Address . szGroupID ) ;
m_AdoRS . GetCollect ( _T ( " Name " ) , Address . szName ) ;
m_AdoRS . GetCollect ( _T ( " CarNum " ) , Address . szCarNum ) ;
m_AdoRS . GetCollect ( _T ( " Province " ) , Address . szProvince ) ;
m_AdoRS . GetCollect ( _T ( " Addr " ) , Address . szAddr ) ;
m_AdoRS . GetCollect ( _T ( " Corp " ) , Address . szCorp ) ;
m_AdoRS . GetCollect ( _T ( " Postcode " ) , Address . szPostcode ) ;
m_AdoRS . GetCollect ( _T ( " Tel " ) , Address . szTel ) ;
m_AdoRS . GetCollect ( _T ( " Mobile " ) , Address . szMobile ) ;
m_AdoRS . GetCollect ( _T ( " SFZ " ) , Address . szSFZ ) ;
m_AdoRS . GetCollect ( _T ( " Birthday " ) , t ) ; t . GetAsSystemTime ( Address . tBirthday ) ;
m_AdoRS . GetCollect ( _T ( " BuyDate " ) , t ) ; t . GetAsSystemTime ( Address . tBuyDate ) ;
m_AdoRS . GetCollect ( _T ( " RegDate " ) , t ) ; t . GetAsSystemTime ( Address . tRegDate ) ;
m_AdoRS . GetCollect ( _T ( " SCDate " ) , t ) ; t . GetAsSystemTime ( Address . tSCDate ) ;
m_AdoRS . GetCollect ( _T ( " BuyProvince " ) , Address . szBuyProvince ) ;
m_AdoRS . GetCollect ( _T ( " BuyCity " ) , Address . szBuyCity ) ;
m_AdoRS . GetCollect ( _T ( " CarType " ) , Address . szCarType ) ;
m_AdoRS . GetCollect ( _T ( " FDJNum " ) , Address . szFDJNum ) ;
m_AdoRS . GetCollect ( _T ( " DPNum " ) , Address . szDPNum ) ;
m_AdoRS . GetCollect ( _T ( " SCNum " ) , Address . szSCNum ) ;
m_AdoRS . GetCollect ( _T ( " FWNum " ) , Address . szFWNum ) ;
m_AdoRS . GetCollect ( _T ( " FWName " ) , Address . szFWName ) ;
m_AdoRS . GetCollect ( _T ( " CreateTime " ) , t ) ; t . GetAsSystemTime ( Address . tCreateTime ) ;
m_AdoRS . GetCollect ( _T ( " BZ " ) , Address . szBZ ) ;
}
return Address ;
}
void CFKAddress : : OnDestroy ( )
{
if ( m_Copy_Data )
{
delete m_Copy_Data ;
m_Copy_Data = NULL ;
}
CDialog : : OnDestroy ( ) ;
}