2025-02-27 16:58:16 +08:00
// FPAddress.cpp : implementation file
//
# include "stdafx.h"
# include "corpsms.h"
# include "FPAddress.h"
# ifdef _DEBUG
# define new DEBUG_NEW
# undef THIS_FILE
static char THIS_FILE [ ] = __FILE__ ;
# endif
/////////////////////////////////////////////////////////////////////////////
// CFPAddress dialog
# include "MainFrm.h"
# include "ProcessSocket.h"
# include "DLG_User_ModifyP.h"
# include "DLG_Group_Modify.h"
# include "FuncView.h"
# include "DLG_User_Inport2.h"
# include "DLG_AddWarning.h"
# include "DLG_User_Log.h"
# include "DLG_User_InportP2.h"
# include "..\public\StringSort\StringSort.h"
CFPAddress : : CFPAddress ( CWnd * pParent /*=NULL*/ )
: CDialog ( CFPAddress : : IDD , pParent )
{
//{{AFX_DATA_INIT(CFPAddress)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_bInit = false ;
m_bRefresh = false ;
m_lUserID = 0 ;
memset ( m_szGroupID , 0 , sizeof ( m_szGroupID ) ) ;
memset ( m_szLocal , 0 , sizeof ( m_szLocal ) ) ;
m_bFind2 = false ;
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 ;
m_bShowAllRecord = false ;
m_FindPro . m_bName = TRUE ;
m_FindPro . m_bNickName = TRUE ;
m_FindPro . m_bJob = TRUE ;
m_FindPro . m_bTel = TRUE ;
m_FindPro . m_bMobile = TRUE ;
m_FindPro . m_bEmail = TRUE ;
m_FindPro . m_bSex = TRUE ;
m_FindPro . m_bBZ = TRUE ;
m_FindPro . m_bLTD = TRUE ;
m_lCurUserID = 0 ;
m_lPlace_Count = 0 ;
m_lPlace_Index = 0 ;
}
void CFPAddress : : DoDataExchange ( CDataExchange * pDX )
{
CDialog : : DoDataExchange ( pDX ) ;
//{{AFX_DATA_MAP(CFPAddress)
DDX_Control ( pDX , IDC_PADDRESS_LIST , m_wndList ) ;
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP ( CFPAddress , CDialog )
//{{AFX_MSG_MAP(CFPAddress)
ON_WM_SIZE ( )
ON_WM_TIMER ( )
ON_NOTIFY ( NM_DBLCLK , IDC_PADDRESS_LIST , OnDblclkPaddressList )
ON_NOTIFY ( NM_RCLICK , IDC_PADDRESS_LIST , OnRclickPaddressList )
ON_NOTIFY ( LVN_KEYDOWN , IDC_PADDRESS_LIST , OnKeydownPaddressList )
ON_WM_DESTROY ( )
//}}AFX_MSG_MAP
ON_MESSAGE ( LIST_DROP_BEGIN , On_List_DropBegin )
ON_COMMAND ( MENU_PADDRESS_ADD , On_User_Add )
ON_COMMAND ( MENU_PADDRESS_ADDGROUP , On_User_AddGroup )
ON_COMMAND ( MENU_PADDRESS_MODIFY , On_User_Modify )
ON_COMMAND ( MENU_PADDRESS_DEL , On_User_Del )
ON_COMMAND ( MENU_PADDRESS_FIND , On_User_Find )
ON_COMMAND ( MENU_PADDRESS_ADDTOLIST , On_User_AddToList )
ON_COMMAND ( MENU_PADDRESS_ADDTOLIST_FAX , On_User_AddToList_Fax )
ON_COMMAND ( MENU_PADDRESS_ADDTOLIST_MMS , On_User_AddToList_Mms )
ON_COMMAND ( MENU_PADDRESS_INPORT , On_User_Inport )
ON_COMMAND ( MENU_PADDRESS_EXPORT , On_User_Export )
ON_COMMAND ( MENU_PADDRESS_REFRESH , On_User_Refresh )
ON_COMMAND ( MENU_PADDRESS_LOG , On_User_Log )
ON_COMMAND ( MENU_PADDRESS_COPY , On_User_Copy )
ON_COMMAND ( MENU_PADDRESS_CUT , On_User_Cut )
ON_COMMAND ( MENU_PADDRESS_PASTE , On_User_Paste )
ON_COMMAND ( MENU_PADDRESS_SHOWALLRECORD , On_User_Refresh_All )
ON_COMMAND ( MENU_GADDRESS_UBOX_MOBILE , On_User_UBox_Mobile )
ON_COMMAND ( MENU_GADDRESS_UBOX_TEL , On_User_UBox_Tel )
ON_COMMAND ( MENU_GADDRESS_UBOX_LOG , On_User_UBox_Log )
END_MESSAGE_MAP ( )
/////////////////////////////////////////////////////////////////////////////
// CFPAddress message handlers
BOOL CFPAddress : : ReHide ( )
{
ShowWindow ( SW_HIDE ) ;
return true ;
}
BOOL CFPAddress : : ReShow ( BOOL bRefresh )
{
ShowWindow ( SW_SHOW ) ;
if ( bRefresh | | ! m_bRefresh )
{
RefreshInfo ( ) ;
}
return true ;
}
BOOL CFPAddress : : RefreshInfo ( )
{
return true ;
}
long CFPAddress : : ShowUser ( long lUserID )
{
m_bFind2 = false ;
m_wndList . ShowWindow ( SW_HIDE ) ; //Ϊ<> ˼ӿ<CBBC> <D3BF> <EFBFBD> ʾ <EFBFBD> ٶ<EFBFBD>
m_wndList . DeleteAllItems ( ) ;
TCHAR szSelect [ 128 ] = { 0 } ;
CString str , str2 ;
m_lUserID = lUserID ;
memset ( m_szGroupID , 0 , sizeof ( m_szGroupID ) ) ;
if ( lUserID ! = - 1 ) //<2F> <> <EFBFBD> <EFBFBD> -1<> Ǵ<EFBFBD> <C7B4> <EFBFBD> <EFBFBD> <EFBFBD>
{
_stprintf ( szSelect , _T ( " select GroupID from paddress 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 ;
}
}
//DWORD dwTime = GetTickCount();
CString strTop ;
if ( ! m_bShowAllRecord & & m_pMainFrame - > m_Setup . lTopRecord > 0 )
{
strTop . Format ( _T ( " top %d " ) , m_pMainFrame - > m_Setup . lTopRecord ) ;
}
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 %s * from paddress where GroupID is null or len(GroupID)=0 and UserType='1' order by UserID " ) , strTop ) ; //<2F> <> <EFBFBD> Ҵ<EFBFBD> <D2B4> <EFBFBD> <EFBFBD> µ<EFBFBD> <C2B5> û<EFBFBD>
else
_stprintf ( szSelect , _T ( " Select %s * from paddress where GroupID='%s' AND UserType='1' order by UserID " ) , strTop , m_szGroupID ) ; //<2F> <> <EFBFBD> Ҵ<EFBFBD> <D2B4> <EFBFBD> <EFBFBD> µ<EFBFBD> <C2B5> û<EFBFBD>
BOOL b = m_AdoRS . Open ( szSelect ) ;
long lCount = m_AdoRS . GetRecordCount ( ) ;
if ( ! m_bShowAllRecord & & m_pMainFrame - > m_Setup . lTopRecord > 0 & &
lCount > m_pMainFrame - > m_Setup . lTopRecord )
{
lCount = m_pMainFrame - > m_Setup . lTopRecord ;
}
m_bShowAllRecord = false ; //<2F> <> ʾ <EFBFBD> <CABE> һ <EFBFBD> κ<CEBA> <F3A3ACB2> <EFBFBD> <EFBFBD> <EFBFBD> ȫ<EFBFBD> <C8AB> <EFBFBD> <EFBFBD> ʾ
if ( b & & lCount > 0 )
{
//CAdopAddress adoAddr;
//m_AdoRS.RecordBinding( adoAddr );
COleDateTime t ;
m_AdoRS . MoveFirst ( ) ;
for ( int i = 0 ; i < lCount ; i + + )
{
PAddress user = { 0 } ;
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 ( " NickName " ) , user . szNickName ) ;
m_AdoRS . GetCollect ( _T ( " Sex " ) , user . szSex ) ;
m_AdoRS . GetCollect ( _T ( " Birthday " ) , t ) ; t . GetAsSystemTime ( user . tBirthday ) ;
m_AdoRS . GetCollect ( _T ( " Ltd " ) , user . szLtd ) ;
m_AdoRS . GetCollect ( _T ( " Job " ) , user . szJob ) ;
m_AdoRS . GetCollect ( _T ( " Tel " ) , user . szTel ) ;
m_AdoRS . GetCollect ( _T ( " Fax " ) , user . szFax ) ;
m_AdoRS . GetCollect ( _T ( " Email " ) , user . szEmail ) ;
m_AdoRS . GetCollect ( _T ( " Mobile " ) , user . szMobile ) ;
m_AdoRS . GetCollect ( _T ( " QQ " ) , user . szQQ ) ;
m_AdoRS . GetCollect ( _T ( " BZ " ) , user . szBZ ) ;
# ifdef MOBSET_VIPINT
m_AdoRS . GetCollect ( _T ( " VipInt " ) , user . lVipInt ) ;
# endif
# ifdef GZTJJ_VER
m_AdoRS . GetCollect ( _T ( " Place " ) , user . szPlace ) ;
# endif
/*
user . lUserID = adoAddr . m_UserID ;
_tcscpy ( user . szUserType , adoAddr . m_UserType ) ;
_tcscpy ( user . szGroupID , adoAddr . m_GroupID ) ;
_tcscpy ( user . szName , adoAddr . m_Name ) ;
_tcscpy ( user . szNickName , adoAddr . m_NickName ) ;
_tcscpy ( user . szSex , adoAddr . m_Sex ) ;
adoAddr . m_Birthday . GetAsSystemTime ( user . tBirthday ) ;
_tcscpy ( user . szLtd , adoAddr . m_Ltd ) ;
_tcscpy ( user . szJob , adoAddr . m_Job ) ;
_tcscpy ( user . szTel , adoAddr . m_Tel ) ;
_tcscpy ( user . szFax , adoAddr . m_Fax ) ;
_tcscpy ( user . szEmail , adoAddr . m_Email ) ;
_tcscpy ( user . szMobile , adoAddr . m_Mobile ) ;
_tcscpy ( user . szQQ , adoAddr . m_QQ ) ;
_tcscpy ( user . szBZ , adoAddr . m_BZ ) ;
memset ( & adoAddr , 0 , sizeof ( adoAddr ) ) ;
*/
# ifdef SHMZ_VER
if ( this - > m_pMainFrame - > GetUserPurview_HideNum ( ) )
{
user . szMobile [ 4 ] = ' * ' ;
user . szMobile [ 5 ] = ' * ' ;
user . szMobile [ 6 ] = ' * ' ;
user . szMobile [ 7 ] = ' * ' ;
//user.szMobile[8]='*';
}
# endif
COleDateTime t ( user . tBirthday ) ;
str = _T ( " " ) ;
if ( t . GetStatus ( ) = = COleDateTime : : valid )
{
str . Format ( _T ( " %04d.%02d.%02d " ) , t . GetYear ( ) , t . GetMonth ( ) , t . GetDay ( ) ) ;
}
# ifdef SHOWBZ_VER
2025-04-14 17:24:47 +08:00
m_wndList . InsertItemAndCol ( i , _itot ( i + 1 , szSelect , 10 ) , user . szName , user . szNickName , user . szMobile , user . szTel , str , user . szLtd , user . szJob , user . szEmail , user . szBZ ) ;
2025-02-27 16:58:16 +08:00
# else
# ifdef MOBSET_OEM_YTLE
2025-04-14 17:24:47 +08:00
m_wndList . InsertItemAndCol ( i , _itot ( i + 1 , szSelect , 10 ) , user . szName , user . szNickName , user . szMobile , user . szTel , user . szFax , user . szLtd , user . szJob , user . szEmail , str , user . szBZ ) ;
2025-02-27 16:58:16 +08:00
# else
# ifdef MOBSET_VIPINT
str2 . Format ( _T ( " %d " ) , user . lVipInt ) ;
2025-04-14 17:24:47 +08:00
m_wndList . InsertItemAndCol ( i , _itot ( i + 1 , szSelect , 10 ) , user . szName , user . szNickName , user . szMobile , user . szTel , str , user . szLtd , user . szJob , user . szEmail , str2 ) ;
2025-02-27 16:58:16 +08:00
# else
# ifdef GZTJJ_VER
2025-04-14 17:24:47 +08:00
m_wndList . InsertItemAndCol ( i , _itot ( i + 1 , szSelect , 10 ) , user . szName , user . szNickName , user . szMobile , user . szTel , str , user . szLtd , user . szJob , user . szEmail , user . szPlace ) ;
2025-02-27 16:58:16 +08:00
# else
2025-04-14 17:24:47 +08:00
m_wndList . InsertItemAndCol ( i , _itot ( i + 1 , szSelect , 10 ) , user . szName , user . szNickName , user . szMobile , user . szTel , str , user . szLtd , user . szJob , user . szEmail ) ;
2025-02-27 16:58:16 +08:00
# endif
# endif
# endif
# endif
long lIcon = 2 ;
if ( _tcscmp ( user . szSex , _T ( " <EFBFBD> <EFBFBD> " ) ) = = 0 )
lIcon = 0 ;
if ( _tcscmp ( user . szSex , _T ( " Ů " ) ) = = 0 )
lIcon = 1 ;
m_wndList . SetIconIndex ( i , lIcon ) ;
m_wndList . SetItemData ( i , user . lUserID ) ;
m_AdoRS . MoveNext ( ) ;
/*
//_T("<22> <> <EFBFBD> <EFBFBD> ,50; <20> <> <EFBFBD> <EFBFBD> ,80; <20> dz<EFBFBD> ,80;<3B> ֻ<EFBFBD> ,100;<3B> 绰,80; <20> <> <EFBFBD> <EFBFBD> ,90;ְ<> <D6B0> ,80;Email,80;")
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 . szNickName ) ;
m_wndList . SetItemText ( i , 3 , user . szMobile ) ;
m_wndList . SetItemText ( i , 4 , user . szTel ) ;
COleDateTime t ( user . tBirthday ) ;
if ( t . GetStatus ( ) = = COleDateTime : : valid )
{
str . Format ( " %04d.%02d.%02d " , t . GetYear ( ) , t . GetMonth ( ) , t . GetDay ( ) ) ;
m_wndList . SetItemText ( i , 5 , str ) ;
}
else
{
m_wndList . SetItemText ( i , 5 , " " ) ;
}
m_wndList . SetItemText ( i , 6 , user . szLtd ) ;
m_wndList . SetItemText ( i , 7 , user . szJob ) ;
m_wndList . SetItemText ( i , 8 , user . szEmail ) ;
*/
}
// return lCount;
}
//dwTime = ::GetTickCount() - dwTime;
//CString strTemp;
//strTemp.Format( "<22> <> ʱ:%d" , dwTime );
//MessageBox(strTemp);
m_wndList . ShowWindow ( SW_SHOW ) ; //Ϊ<> ˼ӿ<CBBC> <D3BF> <EFBFBD> ʾ <EFBFBD> ٶ<EFBFBD>
if ( strTop . GetLength ( ) > 0 & & lCount > = m_pMainFrame - > m_Setup . lTopRecord ) //<2F> <> ʾ <EFBFBD> <CABE> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> м<EFBFBD> ¼<EFBFBD> <C2BC> <EFBFBD> <EFBFBD> ѡ <EFBFBD> <D1A1>
{
CMenu menu ;
menu . CreatePopupMenu ( ) ;
menu . AppendMenu ( MF_SEPARATOR ) ;
menu . AppendMenu ( MF_STRING , MENU_PADDRESS_SHOWALLRECORD , _T ( " <20> <> ʾ <EFBFBD> <CABE> <EFBFBD> м<EFBFBD> ¼ " ) ) ;
menu . AppendMenu ( MF_SEPARATOR ) ;
CRect rect ;
GetWindowRect ( & rect ) ;
//ClientToScreen(&rect);
//<2F> <> ʾ <EFBFBD> ˵<EFBFBD>
POINT pt ;
pt . x = rect . Width ( ) / 2 ;
pt . y = rect . Height ( ) / 3 ;
ClientToScreen ( & pt ) ;
//menu.TrackPopupMenu(TPM_LEFTBUTTON | TPM_RIGHTBUTTON,pt.x,pt.y, this, NULL);
menu . TrackPopupMenu ( TPM_CENTERALIGN , pt . x , pt . y , this , NULL ) ;
menu . DestroyMenu ( ) ;
}
return 0 ;
}
long CFPAddress : : GetCurrentSelected ( )
{
POSITION pos = m_wndList . GetFirstSelectedItemPosition ( ) ;
if ( pos )
{
return m_wndList . GetNextSelectedItem ( pos ) ;
}
return - 1 ;
}
void CFPAddress : : GetLocal ( TCHAR * pLocal , TCHAR * pGroupID )
{
long lLen = _tcslen ( pGroupID ) ;
TCHAR szGroup [ 16 ] = { 0 } ;
TCHAR szTemp [ 64 ] = { 0 } ;
TCHAR szSelect [ 256 ] = { 0 } ;
# ifdef MOBSET_CARD_VER
_stprintf ( pLocal , _T ( " ͨѶ¼ " ) ) ;
# else
_stprintf ( pLocal , _T ( " ˽<EFBFBD> <EFBFBD> ͨѶ¼ " ) ) ;
# endif
m_strGroupName = pLocal ;
for ( int i = 1 ; i < = lLen ; i + + )
{
_tcsncpy ( szGroup , pGroupID , i ) ;
_stprintf ( szSelect , _T ( " select Name from paddress 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 ) ;
m_strGroupName = szTemp ; //<2F> <> ¼<EFBFBD> <C2BC> <EFBFBD> <EFBFBD>
}
}
}
BOOL CFPAddress : : 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 ) ;
m_AdoRS_Place . 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_ADDRESSW ) ) ;
m_Image . Add ( AfxGetApp ( ) - > LoadIcon ( IDI_L_ADDRESSN ) ) ; //<2F> ֲ<EFBFBD> <D6B2> <EFBFBD> <EFBFBD> Ա<EFBFBD> <D4B1> ģ<EFBFBD> <C4A3> <EFBFBD> <EFBFBD> <EFBFBD> ͼ<EFBFBD> <CDBC>
m_Image . Add ( AfxGetApp ( ) - > LoadIcon ( IDI_L_LOCK ) ) ;
m_wndList . SubClassWindow2 ( ) ;
# ifdef SHOWBZ_VER
m_wndList . SetHeadings ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,50; <20> <> <EFBFBD> <EFBFBD> ,80; <20> dz<EFBFBD> ,80;<3B> ֻ<EFBFBD> ,100;<3B> 绰,80; <20> <> <EFBFBD> <EFBFBD> ,90; <20> <> ˾,120;ְ<> <D6B0> ,80;Email,80;<3B> <> ע,120;" ) ) ;
# else
# ifdef MOBSET_OEM_YTLE
m_wndList . SetHeadings ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,50; <20> <> <EFBFBD> <EFBFBD> ,80; <20> <> ҵ,80;<3B> ֻ<EFBFBD> ,100;<3B> <> ҵͨ,80;<3B> 绰,80; <20> <> ˾,120;<3B> <> Ʒ ,80;Email,80; <20> <> <EFBFBD> <EFBFBD> ,90;<3B> <> ע,120;" ) ) ;
# else
# ifdef MOBSET_VIPINT
m_wndList . SetHeadings ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,50; <20> <> <EFBFBD> <EFBFBD> ,80; <20> dz<EFBFBD> ,80;<3B> ֻ<EFBFBD> ,100;<3B> 绰,80; <20> <> <EFBFBD> <EFBFBD> ,90; <20> <> ˾,120;ְ<> <D6B0> ,80;Email,80;<3B> <> <EFBFBD> <EFBFBD> ,60;" ) ) ;
# else
m_wndList . SetHeadings ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,50; <20> <> <EFBFBD> <EFBFBD> ,80; <20> dz<EFBFBD> ,80;<3B> ֻ<EFBFBD> ,100;<3B> 绰,80; <20> <> <EFBFBD> <EFBFBD> ,90; <20> <> ˾,120;ְ<> <D6B0> ,80;Email,80;" ) ) ;
# endif
# endif
# endif
# ifdef GZTJJ_VER
long lCol = m_wndList . GetColumnCount ( ) ;
m_wndList . InsertColumn ( lCol , _T ( " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , 0 , 150 ) ;
# endif
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 CFPAddress : : 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 CFPAddress : : 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 ;
}
}
void CFPAddress : : OnDblclkPaddressList ( NMHDR * pNMHDR , LRESULT * pResult )
{
* pResult = 0 ;
On_User_Modify ( ) ;
}
void CFPAddress : : OnRclickPaddressList ( NMHDR * pNMHDR , LRESULT * pResult )
{
* pResult = 0 ;
ShowRMenu ( ) ;
}
LRESULT CFPAddress : : 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 paddress 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 CFPAddress : : 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 ;
PAddress Address = { 0 } ;
_tcscpy ( Address . szGroupID , m_szGroupID ) ;
Address . szUserType [ 0 ] = ' 1 ' ; //<2F> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD>
DLG_User_ModifyP dlg ( this ) ;
dlg . SetParam ( Address , m_szLocal , true , 0 ) ;
dlg . DoModal ( ) ;
}
void CFPAddress : : 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 [ 512 ] = { 0 } ;
//_stprintf( szSelect , _T("select GroupID from paddress where GroupID like '%s_' AND UserType='0' group by GroupID order by GroupID") , m_szGroupID); //<2F> <> <EFBFBD> ҵ<EFBFBD> ǰ<EFBFBD> <C7B0> <EFBFBD> µĵ<C2B5> һ <EFBFBD> <D2BB>
_stprintf ( szSelect , _T ( " select GroupID from paddress 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 ( " paddress " ) ) ;
if ( dlg . DoModal ( ) = = IDOK )
{
GAdd = dlg . GetParam ( ) ;
//<2F> <> <EFBFBD> ӵ<EFBFBD> <D3B5> <EFBFBD> <EFBFBD> ݿ<EFBFBD> <DDBF> <EFBFBD>
BOOL b = m_AdoRS . Open ( _T ( " paddress " ) , adCmdTable ) ;
if ( b )
{
m_AdoRS . AddNew ( ) ;
m_AdoRS . PutCollect ( _T ( " UserType " ) , _T ( " 0 " ) ) ; //<2F> û<EFBFBD> <C3BB> <EFBFBD>
m_AdoRS . PutCollect ( _T ( " GroupID " ) , GAdd . szGroupID ) ;
# ifdef DGZD_VER
m_AdoRS . PutCollect ( _T ( " Name " ) , dlg . m_szDGZDGroupName ) ;
# else
m_AdoRS . PutCollect ( _T ( " Name " ) , GAdd . szGroupName ) ;
# endif
m_AdoRS . PutCollect ( _T ( " CreateTime " ) , COleDateTime : : GetCurrentTime ( ) ) ;
# ifdef SHMZ_VER_GROUPSEND
m_AdoRS . PutCollect ( _T ( " BZ " ) , dlg . m_strBZ ) ;
# else
m_AdoRS . PutCollect ( _T ( " BZ " ) , GAdd . szBZ ) ;
# endif
m_AdoRS . Update ( ) ;
m_AdoRS . GetCollect ( _T ( " UserID " ) , GAdd . lUserID ) ;
m_AdoRS . Close ( ) ;
if ( this - > m_pMainFrame - > m_Setup . bSQLUse )
{
CString str ;
str . Format ( _T ( " select * from paddress where UserType='0' and GroupID='%s' and Name='%s' " ) , GAdd . szGroupID , GAdd . szGroupName ) ;
if ( m_AdoRS . Open ( str ) & & m_AdoRS . GetRecordCount ( ) > 0 )
{
m_AdoRS . MoveFirst ( ) ;
m_AdoRS . GetCollect ( _T ( " UserID " ) , GAdd . lUserID ) ;
m_AdoRS . Close ( ) ;
}
}
}
//<2F> <> <EFBFBD> ӵ<EFBFBD> <D3B5> <EFBFBD>
# ifdef DGZD_VER
m_pFuncView - > AddPGroup ( dlg . m_szDGZDGroupName . GetBuffer ( 0 ) , m_lUserID , GAdd . lUserID ) ;
# else
m_pFuncView - > AddPGroup ( GAdd . szGroupName , m_lUserID , GAdd . lUserID ) ;
# endif
}
}
void CFPAddress : : On_User_Modify ( )
{
# ifdef SHMZ_VER
if ( this - > m_pMainFrame - > GetUserPurview_HideNum ( ) )
{
return ;
}
# endif
long lItem = GetCurrentSelected ( ) ;
if ( lItem < 0 )
return ;
long lUserID = m_wndList . GetItemData ( lItem ) ;
CString str ;
PAddress Address = GetUserData ( lUserID ) ;
if ( _tcslen ( Address . szName ) > 0 )
{
DLG_User_ModifyP dlg ( this ) ;
TCHAR szLocal [ 1024 ] = { 0 } ;
GetLocal ( szLocal , Address . szGroupID ) ; //ȡ<> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λ<EFBFBD> <CEBB>
dlg . SetParam ( Address , szLocal , false , 0 ) ;
if ( dlg . DoModal ( ) = = IDOK )
{
Address = dlg . GetParam ( ) ;
long lIcon = 2 ;
if ( _tcscmp ( Address . szSex , _T ( " <EFBFBD> <EFBFBD> " ) ) = = 0 )
lIcon = 0 ;
if ( _tcscmp ( Address . szSex , _T ( " Ů " ) ) = = 0 )
lIcon = 1 ;
m_wndList . SetIconIndex ( lItem , lIcon ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> µ<EFBFBD> <C2B5> <EFBFBD> <EFBFBD> <EFBFBD>
m_wndList . SetItemText ( lItem , 1 , Address . szName ) ;
m_wndList . SetItemText ( lItem , 2 , Address . szNickName ) ;
m_wndList . SetItemText ( lItem , 3 , Address . szMobile ) ;
m_wndList . SetItemText ( lItem , 4 , Address . szTel ) ;
# ifdef MOBSET_OEM_YTLE
m_wndList . SetItemText ( lItem , 5 , Address . szFax ) ;
# else
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 , 5 , str ) ;
}
else
{
m_wndList . SetItemText ( lItem , 5 , _T ( " " ) ) ;
}
# endif
m_wndList . SetItemText ( lItem , 6 , Address . szLtd ) ;
m_wndList . SetItemText ( lItem , 7 , Address . szJob ) ;
m_wndList . SetItemText ( lItem , 8 , Address . szEmail ) ;
# ifdef MOBSET_OEM_YTLE
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 , 5 , str ) ;
}
else
{
m_wndList . SetItemText ( lItem , 5 , _T ( " " ) ) ;
}
m_wndList . SetItemText ( lItem , 10 , Address . szBZ ) ;
# endif
# ifdef MOBSET_VIPINT
str . Format ( _T ( " %d " ) , Address . lVipInt ) ;
m_wndList . SetItemText ( lItem , 9 , str ) ;
# endif
# ifdef GZTJJ_VER
m_wndList . SetItemText ( lItem , 9 , Address . szPlace ) ;
# endif
//<2F> <> <EFBFBD> µ<EFBFBD> <C2B5> <EFBFBD> <EFBFBD> <EFBFBD> д<EFBFBD> 뱾<EFBFBD> <EBB1BE> <EFBFBD> <EFBFBD> <EFBFBD> ݿ<EFBFBD>
TCHAR szSelect [ 128 ] = { 0 } ;
_stprintf ( szSelect , _T ( " select * from paddress where UserID=%d " ) , Address . lUserID ) ;
BOOL b = m_AdoRS . Open ( szSelect ) ;
if ( b & & m_AdoRS . GetRecordCount ( ) )
{
m_AdoRS . MoveFirst ( ) ;
m_AdoRS . PutCollect ( _T ( " GroupID " ) , Address . szGroupID ) ;
m_AdoRS . PutCollect ( _T ( " Name " ) , Address . szName ) ;
m_AdoRS . PutCollect ( _T ( " NickName " ) , Address . szNickName ) ;
m_AdoRS . PutCollect ( _T ( " Sex " ) , Address . szSex ) ;
m_AdoRS . PutCollect ( _T ( " Birthday " ) , Address . tBirthday ) ;
m_AdoRS . PutCollect ( _T ( " Ltd " ) , Address . szLtd ) ;
m_AdoRS . PutCollect ( _T ( " Addr " ) , Address . szAddress ) ;
m_AdoRS . PutCollect ( _T ( " Job " ) , Address . szJob ) ;
m_AdoRS . PutCollect ( _T ( " Tel " ) , Address . szTel ) ;
m_AdoRS . PutCollect ( _T ( " Fax " ) , Address . szFax ) ;
m_AdoRS . PutCollect ( _T ( " Mobile " ) , Address . szMobile ) ;
m_AdoRS . PutCollect ( _T ( " Email " ) , Address . szEmail ) ;
m_AdoRS . PutCollect ( _T ( " QQ " ) , Address . szQQ ) ;
m_AdoRS . PutCollect ( _T ( " BZ " ) , Address . szBZ ) ;
# ifdef MOBSET_VIPINT
m_AdoRS . PutCollect ( _T ( " VipInt " ) , Address . lVipInt ) ;
# endif
# ifdef GZTJJ_VER
m_AdoRS . PutCollect ( _T ( " Place " ) , Address . szPlace ) ;
# endif
m_AdoRS . Update ( ) ;
m_AdoRS . Close ( ) ;
}
}
}
}
void CFPAddress : : 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 paddress 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 CFPAddress : : On_User_Find ( )
{
DLG_FindUser dlg ( this ) ;
dlg . SetParam ( m_FindPro ) ;
if ( dlg . DoModal ( ) = = IDOK )
{
m_FindPro = dlg . m_FindPro ;
On_User_Find2 ( & dlg ) ;
}
return ;
/*
m_wndList . UnSelectAllItems ( ) ;
DLG_FindUser dlg ( this ) ;
if ( dlg . DoModal ( ) = = IDOK )
{
if ( dlg . m_bFindAll )
{
On_User_Find2 ( & dlg ) ;
return ;
}
long lFindItem = - 1 ;
BOOL bFind ;
char szFind [ 32 ] = { 0 } ;
_tcscpy ( szFind , dlg . m_strMsg ) ;
long lCount = m_wndList . GetItemCount ( ) ;
char szMsg [ 64 ] ;
for ( int i = 0 ; i < lCount ; i + + )
{
bFind = false ;
if ( dlg . m_bName ) //name
{
memset ( szMsg , 0 , sizeof ( szMsg ) ) ;
m_wndList . GetItemText ( i , 1 , szMsg , sizeof ( szMsg ) ) ;
bFind = FoundChar ( szMsg , szFind , _tcslen ( szMsg ) ) ;
}
if ( ! bFind & & dlg . m_bNickName ) //nickname
{
memset ( szMsg , 0 , sizeof ( szMsg ) ) ;
m_wndList . GetItemText ( i , 2 , szMsg , sizeof ( szMsg ) ) ;
bFind = FoundChar ( szMsg , szFind , _tcslen ( szMsg ) ) ;
}
if ( ! bFind & & dlg . m_bJob ) //job
{
memset ( szMsg , 0 , sizeof ( szMsg ) ) ;
m_wndList . GetItemText ( i , 7 , szMsg , sizeof ( szMsg ) ) ;
bFind = FoundChar ( szMsg , szFind , _tcslen ( szMsg ) ) ;
}
if ( ! bFind & & dlg . m_bTel ) //Tel
{
memset ( szMsg , 0 , sizeof ( szMsg ) ) ;
m_wndList . GetItemText ( i , 4 , szMsg , sizeof ( szMsg ) ) ;
bFind = FoundChar ( szMsg , szFind , _tcslen ( szMsg ) ) ;
}
if ( ! bFind & & dlg . m_bMobile ) //Mobile
{
memset ( szMsg , 0 , sizeof ( szMsg ) ) ;
m_wndList . GetItemText ( i , 3 , szMsg , sizeof ( szMsg ) ) ;
bFind = FoundChar ( szMsg , szFind , _tcslen ( szMsg ) ) ;
}
if ( ! bFind & & dlg . m_bEmail ) //Email
{
memset ( szMsg , 0 , sizeof ( szMsg ) ) ;
m_wndList . GetItemText ( i , 8 , szMsg , sizeof ( szMsg ) ) ;
bFind = FoundChar ( szMsg , szFind , _tcslen ( szMsg ) ) ;
}
if ( bFind )
{
if ( lFindItem = = - 1 )
lFindItem = i ; //<2F> <> ¼<EFBFBD> <C2BC> һ <EFBFBD> <D2BB> <EFBFBD> ҵ<EFBFBD> <D2B5> ļ<EFBFBD> ¼
m_wndList . SelectItem ( i ) ;
}
}
if ( lFindItem ! = - 1 ) //<2F> <> ʾ <EFBFBD> <CABE> һ <EFBFBD> <D2BB> <EFBFBD> ҵ<EFBFBD> <D2B5> <EFBFBD>
{
m_wndList . EnsureVisible ( lFindItem , false ) ;
m_wndList . SetFocus ( ) ;
}
else
{
MessageBox ( " <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> Ϣ" , MB_ICONINFORMATION ) ;
}
}
*/
}
void CFPAddress : : On_User_AddToList ( )
{
On_User_AddToList_Publie ( 0 ) ;
}
void CFPAddress : : On_User_AddToList_Fax ( )
{
On_User_AddToList_Publie ( 1 ) ;
}
void CFPAddress : : On_User_AddToList_Mms ( )
{
On_User_AddToList_Publie ( 2 ) ;
}
void CFPAddress : : On_User_AddToList_Publie ( long lSendType )
{
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 paddress where UserID=%d " ) , lUserID ) ;
BOOL b = m_AdoRS . Open ( szSelect ) ;
if ( b & & m_AdoRS . GetRecordCount ( ) )
{
//CAdopAddress adoAddr;
//m_AdoRS.RecordBinding( adoAddr );
m_AdoRS . MoveFirst ( ) ;
m_AdoRS . GetCollect ( _T ( " Name " ) , pUser - > szName ) ;
m_AdoRS . GetCollect ( _T ( " NickName " ) , pUser - > szNickName ) ;
if ( lSendType = = 1 ) //fax
m_AdoRS . GetCollect ( _T ( " Fax " ) , pUser - > szMobile ) ;
else
m_AdoRS . GetCollect ( _T ( " Mobile " ) , pUser - > szMobile ) ;
m_AdoRS . GetCollect ( _T ( " BZ " ) , pUser - > szBZ ) ;
/*
_tcscpy ( pUser - > szName , adoAddr . m_Name ) ;
_tcscpy ( pUser - > szNickName , adoAddr . m_NickName ) ;
_tcscpy ( pUser - > szMobile , adoAddr . m_Mobile ) ;
_tcscpy ( pUser - > szBZ , adoAddr . m_BZ ) ;
*/
}
}
pUser + + ;
}
switch ( lSendType )
{
case 0 :
m_pFuncView - > On_User_List_AddUser ( lCount , ( Send_User * ) pS ) ;
break ;
case 1 :
m_pFuncView - > On_User_List_AddUser_Fax ( lCount , ( Send_User * ) pS ) ;
break ;
case 2 :
m_pFuncView - > On_User_List_AddUser_Mms ( lCount , ( Send_User * ) pS ) ;
break ;
}
delete pS ;
}
void CFPAddress : : 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 ;
Inport_Field Field [ ] =
{
{ _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , 0 , 0 , - 1 } ,
{ _T ( " <EFBFBD> dz<EFBFBD> " ) , 0 , 1 , - 1 } ,
{ _T ( " <EFBFBD> Ա<EFBFBD> " ) , 0 , 2 , - 1 } ,
{ _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , 0 , 3 , - 1 } ,
{ _T ( " <EFBFBD> <EFBFBD> ˾" ) , 0 , 4 , - 1 } ,
{ _T ( " ְ<EFBFBD> <EFBFBD> " ) , 0 , 5 , - 1 } ,
{ _T ( " <EFBFBD> <EFBFBD> ַ" ) , 0 , 6 , - 1 } ,
{ _T ( " <EFBFBD> ֻ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , 0 , 7 , - 1 } ,
{ _T ( " <EFBFBD> 绰<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , 0 , 8 , - 1 } ,
{ _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , 0 , 9 , - 1 } ,
{ _T ( " Email " ) , 0 , 10 , - 1 } ,
{ _T ( " QQ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , 0 , 11 , - 1 } ,
{ _T ( " <EFBFBD> <EFBFBD> ע" ) , 0 , 12 , - 1 } ,
} ;
DLG_User_InportP2 dlg ( this ) ;
dlg . SetParam ( & Field [ 0 ] , sizeof ( Field ) / sizeof ( Inport_Field ) , 0 ) ;
if ( dlg . DoModal ( ) = = IDOK )
{
this - > On_User_Refresh ( ) ;
}
return ;
/*
DLG_User_Inport dlg ( this ) ;
dlg . SetInport ( this , & m_wndList , true , true ) ;
if ( dlg . DoModal ( ) = = IDOK )
{
this - > On_User_Refresh ( ) ;
}
dlg . Close ( ) ; //<2F> ر<EFBFBD> <D8B1> <EFBFBD> <EFBFBD> <EFBFBD>
*/
}
void CFPAddress : : On_User_Export ( )
{
DLG_User_Inport2 dlg ( this ) ;
dlg . SetInport ( & m_AdoRS , m_szGroupID , true , false ) ;
dlg . SetOutportName ( m_strGroupName ) ;
dlg . DoModal ( ) ;
}
void CFPAddress : : On_User_Refresh ( )
{
ShowUser ( m_lUserID ) ; //ˢ<> <CBA2>
}
void CFPAddress : : On_User_Refresh_All ( )
{
m_bShowAllRecord = true ;
On_User_Refresh ( ) ;
}
void CFPAddress : : On_User_Log ( )
{
long lItem = GetCurrentSelected ( ) ;
if ( lItem < 0 )
return ;
//CString strMobile = m_wndList.GetItemText(lItem,3);
long lUserID = m_wndList . GetItemData ( lItem ) ;
PAddress Address = GetUserData ( lUserID ) ;
CString strMobile = Address . szMobile ;
DLG_User_Log dlg ( this ) ;
# ifdef SHMZ_VER
dlg . SetHideNum ( m_pMainFrame - > GetUserPurview_HideNum ( ) ) ;
# endif
dlg . SetParam ( & m_AdoRS , strMobile ) ;
dlg . DoModal ( ) ;
}
void CFPAddress : : 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 PAddress [ 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 = PADDRESS_COPYTYPE_COPY ;
}
void CFPAddress : : On_User_Cut ( )
{
On_User_Copy ( ) ;
m_Copy_Type = PADDRESS_COPYTYPE_CUT ;
}
void CFPAddress : : 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 ;
if ( m_bFind2 | | m_Copy_Count < = 0 | | ( m_lUserID = = m_Copy_UserID & & m_Copy_Type = = PADDRESS_COPYTYPE_CUT ) ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
return ;
CString str ;
if ( m_Copy_Type = = PADDRESS_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 paddress 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 ( " paddress " ) , adCmdTable ) )
{
for ( int i = 0 ; i < m_Copy_Count ; i + + )
{
m_AdoRS . AddNew ( ) ;
m_AdoRS . PutCollect ( _T ( " UserType " ) , _T ( " 1 " ) ) ;
m_AdoRS . PutCollect ( _T ( " GroupID " ) , m_szGroupID ) ;
m_AdoRS . PutCollect ( _T ( " Name " ) , m_Copy_Data [ i ] . szName ) ;
m_AdoRS . PutCollect ( _T ( " NickName " ) , m_Copy_Data [ i ] . szNickName ) ;
m_AdoRS . PutCollect ( _T ( " Sex " ) , m_Copy_Data [ i ] . szSex ) ;
m_AdoRS . PutCollect ( _T ( " Birthday " ) , m_Copy_Data [ i ] . tBirthday ) ;
m_AdoRS . PutCollect ( _T ( " Ltd " ) , m_Copy_Data [ i ] . szLtd ) ;
m_AdoRS . PutCollect ( _T ( " Addr " ) , m_Copy_Data [ i ] . szAddress ) ;
m_AdoRS . PutCollect ( _T ( " Job " ) , m_Copy_Data [ i ] . szJob ) ;
m_AdoRS . PutCollect ( _T ( " Tel " ) , m_Copy_Data [ i ] . szTel ) ;
m_AdoRS . PutCollect ( _T ( " Fax " ) , m_Copy_Data [ i ] . szFax ) ;
m_AdoRS . PutCollect ( _T ( " Mobile " ) , m_Copy_Data [ i ] . szMobile ) ;
m_AdoRS . PutCollect ( _T ( " Email " ) , m_Copy_Data [ i ] . szEmail ) ;
m_AdoRS . PutCollect ( _T ( " QQ " ) , m_Copy_Data [ i ] . szQQ ) ;
m_AdoRS . PutCollect ( _T ( " BZ " ) , m_Copy_Data [ i ] . szBZ ) ;
m_AdoRS . PutCollect ( _T ( " CreateTime " ) , COleDateTime : : GetCurrentTime ( ) ) ;
# ifdef MOBSET_VIPINT
m_AdoRS . PutCollect ( _T ( " VipInt " ) , m_Copy_Data [ i ] . lVipInt ) ;
# endif
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>
long lIcon = 2 ;
if ( _tcscmp ( m_Copy_Data [ i ] . szSex , _T ( " <EFBFBD> <EFBFBD> " ) ) = = 0 )
lIcon = 0 ;
if ( _tcscmp ( m_Copy_Data [ i ] . szSex , _T ( " Ů " ) ) = = 0 )
lIcon = 1 ;
m_wndList . SetIconIndex ( lCount , lIcon ) ;
m_wndList . SetItemText ( lCount , 1 , m_Copy_Data [ i ] . szName ) ;
m_wndList . SetItemText ( lCount , 2 , m_Copy_Data [ i ] . szNickName ) ;
m_wndList . SetItemText ( lCount , 3 , m_Copy_Data [ i ] . szMobile ) ;
m_wndList . SetItemText ( lCount , 4 , m_Copy_Data [ i ] . szTel ) ;
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 , 5 , str ) ;
}
else
{
m_wndList . SetItemText ( lCount , 5 , _T ( " " ) ) ;
}
m_wndList . SetItemText ( lCount , 6 , m_Copy_Data [ i ] . szLtd ) ;
m_wndList . SetItemText ( lCount , 7 , m_Copy_Data [ i ] . szJob ) ;
m_wndList . SetItemText ( lCount , 8 , m_Copy_Data [ i ] . szEmail ) ;
# ifdef SHOWBZ_VER
m_wndList . SetItemText ( lCount , 9 , m_Copy_Data [ i ] . szBZ ) ;
# endif
# ifdef MOBSET_VIPINT
str . Format ( _T ( " %d " ) , m_Copy_Data [ i ] . lVipInt ) ;
m_wndList . SetItemText ( lCount , 9 , str ) ;
# endif
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 ;
if ( m_Copy_Data )
{
delete m_Copy_Data ;
m_Copy_Data = NULL ;
}
}
}
void CFPAddress : : 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_PADDRESS_ADD , _T ( " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> " ) ) ;
menu . AppendMenu ( MF_STRING , MENU_PADDRESS_ADDGROUP , _T ( " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_PADDRESS_ADD , _T ( " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> " ) ) ;
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_PADDRESS_ADDGROUP , _T ( " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> " ) ) ;
}
menu . AppendMenu ( MF_SEPARATOR ) ;
BOOL bModify = true ;
# ifdef SHMZ_VER
if ( this - > m_pMainFrame - > GetUserPurview_HideNum ( ) )
{
bModify = false ;
}
# endif
//<2F> <EFBFBD>
if ( lItem > = 0 & & bModify )
{
menu . AppendMenu ( MF_STRING , MENU_PADDRESS_MODIFY , _T ( " <20> <> <20> <> " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_PADDRESS_MODIFY , _T ( " <20> <> <20> <> " ) ) ;
}
//ɾ<> <C9BE>
if ( lItem > = 0 )
{
menu . AppendMenu ( MF_STRING , MENU_PADDRESS_DEL , _T ( " ɾ <20> <> " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_PADDRESS_DEL , _T ( " ɾ <20> <> " ) ) ;
}
menu . AppendMenu ( MF_SEPARATOR ) ;
//<2F> <> <EFBFBD> Ͷ<EFBFBD> <CDB6> <EFBFBD>
if ( m_pMainFrame - > GetUserPurview ( PURVIEW_SENDP , false ) & & lItem > = 0 )
{
menu . AppendMenu ( MF_STRING , MENU_PADDRESS_ADDTOLIST , _T ( " <20> <> <EFBFBD> Ͷ<EFBFBD> <CDB6> <EFBFBD> " ) ) ;
# ifdef SUPPER_FUNC_FAX
menu . AppendMenu ( MF_STRING , MENU_PADDRESS_ADDTOLIST_FAX , _T ( " <20> <> <EFBFBD> ʹ <EFBFBD> <CDB4> <EFBFBD> " ) ) ;
# endif
# ifdef SUPPER_FUNC_MMS
menu . AppendMenu ( MF_STRING , MENU_PADDRESS_ADDTOLIST_MMS , _T ( " <20> <> <EFBFBD> Ͳ<EFBFBD> <CDB2> <EFBFBD> " ) ) ;
# endif
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_PADDRESS_ADDTOLIST , _T ( " <20> <> <EFBFBD> Ͷ<EFBFBD> <CDB6> <EFBFBD> " ) ) ;
# ifdef SUPPER_FUNC_FAX
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_PADDRESS_ADDTOLIST_FAX , _T ( " <20> <> <EFBFBD> ʹ <EFBFBD> <CDB4> <EFBFBD> " ) ) ;
# endif
# ifdef SUPPER_FUNC_MMS
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_PADDRESS_ADDTOLIST_MMS , _T ( " <20> <> <EFBFBD> Ͳ<EFBFBD> <CDB2> <EFBFBD> " ) ) ;
# endif
}
# ifdef SUPPER_UBOX
BOOL bUBox = m_pMainFrame - > m_Setup . bSDK & SDK_UBOX ? true : false ;
CMenu popMenuUBox ;
popMenuUBox . CreatePopupMenu ( ) ;
menu . AppendMenu ( MF_STRING | MF_POPUP , ( UINT ) popMenuUBox . GetSafeHmenu ( ) , _T ( " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 绰 " ) ) ;
PAddress address = { 0 } ;
m_lCurUserID = 0 ;
if ( lItem > = 0 )
m_lCurUserID = m_wndList . GetItemData ( lItem ) ;
if ( m_lCurUserID > 0 )
address = this - > GetUserData ( m_lCurUserID ) ;
m_strCurName = address . szName ;
m_strCurMobile = address . szMobile ;
m_strCurTel = address . szTel ;
CString str ;
str . Format ( _T ( " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ֻ<EFBFBD> :%s " ) , m_strCurMobile ) ;
if ( bUBox & & m_strCurMobile . GetLength ( ) > 0 )
{
popMenuUBox . AppendMenu ( MF_STRING , MENU_GADDRESS_UBOX_MOBILE , str ) ;
}
else
{
popMenuUBox . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_GADDRESS_UBOX_MOBILE , str ) ;
}
str . Format ( _T ( " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 绰:%s " ) , m_strCurTel ) ;
if ( bUBox & & m_strCurTel . GetLength ( ) > 0 )
{
popMenuUBox . AppendMenu ( MF_STRING , MENU_GADDRESS_UBOX_TEL , str ) ;
}
else
{
popMenuUBox . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_GADDRESS_UBOX_TEL , str ) ;
}
popMenuUBox . AppendMenu ( MF_SEPARATOR ) ;
if ( bUBox )
{
popMenuUBox . AppendMenu ( MF_STRING , MENU_GADDRESS_UBOX_LOG , _T ( " ͨ<> <CDA8> <EFBFBD> <EFBFBD> ־ " ) ) ;
}
else
{
popMenuUBox . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_GADDRESS_UBOX_LOG , _T ( " ͨ<> <CDA8> <EFBFBD> <EFBFBD> ־ " ) ) ;
}
# endif
menu . AppendMenu ( MF_SEPARATOR ) ;
if ( lItem > = 0 & & ! m_bFind2 )
{
menu . AppendMenu ( MF_STRING , MENU_PADDRESS_COPY , _T ( " <20> <> <20> <> " ) ) ;
menu . AppendMenu ( MF_STRING , MENU_PADDRESS_CUT , _T ( " <20> <> <20> <> " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_PADDRESS_COPY , _T ( " <20> <> <20> <> " ) ) ;
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_PADDRESS_CUT , _T ( " <20> <> <20> <> " ) ) ;
}
//if (!m_bFind2 && m_lUserID!=m_Copy_UserID&&m_Copy_Count>0)
if ( ! m_bFind2 & & m_Copy_Count > 0 & & ! ( m_lUserID = = m_Copy_UserID & & m_Copy_Type = = PADDRESS_COPYTYPE_CUT ) )
menu . AppendMenu ( MF_STRING , MENU_PADDRESS_PASTE , _T ( " ճ <20> <> " ) ) ;
else
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_PADDRESS_PASTE , _T ( " ճ <20> <> " ) ) ;
menu . AppendMenu ( MF_SEPARATOR ) ;
menu . AppendMenu ( MF_STRING , MENU_PADDRESS_FIND , _T ( " <20> <> <EFBFBD> <EFBFBD> ... " ) ) ;
if ( lItem > = 0 )
menu . AppendMenu ( MF_STRING , MENU_PADDRESS_LOG , _T ( " <20> շ<EFBFBD> <D5B7> <EFBFBD> ־... " ) ) ;
else
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_PADDRESS_LOG , _T ( " <20> շ<EFBFBD> <D5B7> <EFBFBD> ־... " ) ) ;
menu . AppendMenu ( MF_SEPARATOR ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD>
if ( ! m_bFind2 & & bModify )
{
menu . AppendMenu ( MF_STRING , MENU_PADDRESS_INPORT , _T ( " <20> <> <EFBFBD> <EFBFBD> ͨѶ¼ " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_PADDRESS_INPORT , _T ( " <20> <> <EFBFBD> <EFBFBD> ͨѶ¼ " ) ) ;
}
if ( bModify )
{
menu . AppendMenu ( MF_STRING , MENU_PADDRESS_EXPORT , _T ( " <20> <> <EFBFBD> <EFBFBD> ͨѶ¼ " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_PADDRESS_EXPORT , _T ( " <20> <> <EFBFBD> <EFBFBD> ͨѶ¼ " ) ) ;
}
menu . AppendMenu ( MF_SEPARATOR ) ;
//ˢ<> <CBA2>
menu . AppendMenu ( MF_STRING , MENU_PADDRESS_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 ( ) ;
}
PAddress CFPAddress : : GetUserData ( long lUserID )
{
PAddress Address = { 0 } ;
TCHAR szSelect [ 128 ] = { 0 } ;
_stprintf ( szSelect , _T ( " Select * from paddress 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 ( " NickName " ) , Address . szNickName ) ;
m_AdoRS . GetCollect ( _T ( " Sex " ) , Address . szSex ) ;
m_AdoRS . GetCollect ( _T ( " Birthday " ) , t ) ; t . GetAsSystemTime ( Address . tBirthday ) ;
m_AdoRS . GetCollect ( _T ( " Ltd " ) , Address . szLtd ) ;
m_AdoRS . GetCollect ( _T ( " Addr " ) , Address . szAddress ) ;
m_AdoRS . GetCollect ( _T ( " Job " ) , Address . szJob ) ;
m_AdoRS . GetCollect ( _T ( " Tel " ) , Address . szTel ) ;
m_AdoRS . GetCollect ( _T ( " Fax " ) , Address . szFax ) ;
m_AdoRS . GetCollect ( _T ( " Email " ) , Address . szEmail ) ;
m_AdoRS . GetCollect ( _T ( " Mobile " ) , Address . szMobile ) ;
m_AdoRS . GetCollect ( _T ( " QQ " ) , Address . szQQ ) ;
m_AdoRS . GetCollect ( _T ( " CreateTime " ) , t ) ; t . GetAsSystemTime ( Address . tCreateTime ) ;
m_AdoRS . GetCollect ( _T ( " BZ " ) , Address . szBZ ) ;
# ifdef MOBSET_VIPINT
m_AdoRS . GetCollect ( _T ( " VipInt " ) , Address . lVipInt ) ;
# endif
# ifdef GZTJJ_VER
m_AdoRS . GetCollect ( _T ( " Place " ) , Address . szPlace ) ;
# endif
}
return Address ;
}
BOOL CFPAddress : : AddUser ( PAddress user , BOOL bShow )
{
PAddress Address = user ;
long lCount = m_wndList . GetItemCount ( ) ;
if ( bShow )
{
TCHAR Buf [ 32 ] ;
CString str ;
//<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>
long lIcon = 2 ;
if ( _tcscmp ( Address . szSex , _T ( " <EFBFBD> <EFBFBD> " ) ) = = 0 )
lIcon = 0 ;
if ( _tcscmp ( Address . szSex , _T ( " Ů " ) ) = = 0 )
lIcon = 1 ;
m_wndList . SetIconIndex ( lCount , lIcon ) ;
m_wndList . SetItemText ( lCount , 1 , Address . szName ) ;
m_wndList . SetItemText ( lCount , 2 , Address . szNickName ) ;
m_wndList . SetItemText ( lCount , 3 , Address . szMobile ) ;
m_wndList . SetItemText ( lCount , 4 , Address . szTel ) ;
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 , 5 , str ) ;
}
else
{
m_wndList . SetItemText ( lCount , 5 , _T ( " " ) ) ;
}
m_wndList . SetItemText ( lCount , 6 , Address . szLtd ) ;
m_wndList . SetItemText ( lCount , 7 , Address . szJob ) ;
m_wndList . SetItemText ( lCount , 8 , Address . szEmail ) ;
# ifdef SHOWBZ_VER
m_wndList . SetItemText ( lCount , 9 , Address . szBZ ) ;
# endif
# ifdef MOBSET_VIPINT
str . Format ( _T ( " %d " ) , Address . lVipInt ) ;
m_wndList . SetItemText ( lCount , 9 , str ) ;
# endif
}
CString str ;
CString strTime ;
if ( COleDateTime ( Address . tBirthday ) . GetStatus ( ) = = COleDateTime : : valid )
{
strTime . Format ( _T ( " #%04d-%02d-%02d %02d:%02d:%02d# " ) , Address . tBirthday . wYear , Address . tBirthday . wMonth , Address . tBirthday . wDay , Address . tBirthday . wHour , Address . tBirthday . wMinute , Address . tBirthday . wSecond ) ;
}
else
{
strTime = _T ( " NULL " ) ;
}
//<2F> <> <EFBFBD> ӵ<EFBFBD> <D3B5> <EFBFBD> <EFBFBD> ݿ<EFBFBD> <DDBF> <EFBFBD>
if ( m_pMainFrame - > m_Setup . bSQLUse )
{
str . Format ( _T ( " insert into paddress (UserType,GroupID,Name,NickName,Sex,Birthday,Ltd,Job,Tel,Fax,Mobile,Email,QQ,BZ) Values ('%s','%s','%s','%s','%s',%s,'%s','%s','%s','%s','%s','%s','%s','%s') " ) ,
SqlStr ( Address . szUserType ) ,
Address . szGroupID ,
SqlStr ( Address . szName ) ,
SqlStr ( Address . szNickName ) ,
Address . szSex ,
strTime ,
SqlStr ( Address . szLtd ) ,
SqlStr ( Address . szJob ) ,
SqlStr ( Address . szTel ) ,
SqlStr ( Address . szFax ) ,
SqlStr ( Address . szMobile ) ,
SqlStr ( Address . szEmail ) ,
SqlStr ( Address . szQQ ) ,
SqlStr ( Address . szBZ ) ) ;
m_AdoRS . Open ( str ) ;
}
else
{
str . Format ( _T ( " insert into paddress (UserType,GroupID,Name,NickName,Sex,Birthday,Ltd,Addr,Job,Tel,Fax,Mobile,Email,QQ,BZ,CreateTime) Values ('%s','%s','%s','%s','%s',%s,'%s','%s','%s','%s','%s','%s','%s','%s','%s',now()) " ) ,
Address . szUserType ,
Address . szGroupID ,
SqlStr ( Address . szName ) ,
SqlStr ( Address . szNickName ) ,
Address . szSex ,
strTime ,
SqlStr ( Address . szLtd ) ,
SqlStr ( Address . szAddress ) ,
SqlStr ( Address . szJob ) ,
SqlStr ( Address . szTel ) ,
SqlStr ( Address . szFax ) ,
SqlStr ( Address . szMobile ) ,
SqlStr ( Address . szEmail ) ,
SqlStr ( Address . szQQ ) ,
SqlStr ( Address . szBZ ) ) ;
# ifdef MOBSET_VIPINT
str . Format ( _T ( " insert into paddress (UserType,GroupID,Name,NickName,Sex,Birthday,Ltd,Addr,Job,Tel,Fax,Mobile,Email,QQ,BZ,CreateTime,VipInt) Values ('%s','%s','%s','%s','%s',%s,'%s','%s','%s','%s','%s','%s','%s','%s','%s',now(),%d) " ) ,
Address . szUserType ,
Address . szGroupID ,
SqlStr ( Address . szName ) ,
SqlStr ( Address . szNickName ) ,
Address . szSex ,
strTime ,
SqlStr ( Address . szLtd ) ,
SqlStr ( Address . szAddress ) ,
SqlStr ( Address . szJob ) ,
SqlStr ( Address . szTel ) ,
SqlStr ( Address . szFax ) ,
SqlStr ( Address . szMobile ) ,
SqlStr ( Address . szEmail ) ,
SqlStr ( Address . szQQ ) ,
SqlStr ( Address . szBZ ) ,
Address . lVipInt ) ;
# endif
m_AdoRS . Open ( str ) ;
if ( bShow )
{
str . Format ( _T ( " select top 1 * from paddress where mobile='%s' order by CreateTime desc " ) , Address . szMobile ) ;
if ( m_AdoRS . Open ( str ) & & ! m_AdoRS . IsEOF ( ) )
{
m_AdoRS . GetCollect ( _T ( " UserID " ) , Address . lUserID ) ; //ȡ<> <C8A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ӵ<EFBFBD> UserID
m_wndList . SetItemData ( lCount , Address . lUserID ) ;
}
}
/*
BOOL b = m_AdoRS . Open ( _T ( " paddress " ) , 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 ( " NickName " ) , Address . szNickName ) ;
m_AdoRS . PutCollect ( _T ( " Sex " ) , Address . szSex ) ;
m_AdoRS . PutCollect ( _T ( " Birthday " ) , Address . tBirthday ) ;
m_AdoRS . PutCollect ( _T ( " Ltd " ) , Address . szLtd ) ;
m_AdoRS . PutCollect ( _T ( " Addr " ) , Address . szAddress ) ;
m_AdoRS . PutCollect ( _T ( " Job " ) , Address . szJob ) ;
m_AdoRS . PutCollect ( _T ( " Tel " ) , Address . szTel ) ;
m_AdoRS . PutCollect ( _T ( " Fax " ) , Address . szFax ) ;
m_AdoRS . PutCollect ( _T ( " Mobile " ) , Address . szMobile ) ;
m_AdoRS . PutCollect ( _T ( " Email " ) , Address . szEmail ) ;
m_AdoRS . PutCollect ( _T ( " QQ " ) , Address . szQQ ) ;
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 ;
}
void CFPAddress : : OnKeydownPaddressList ( 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 CFPAddress : : OnOK ( )
{
//CDialog::OnOK();
}
void CFPAddress : : OnCancel ( )
{
//CDialog::OnCancel();
}
void CFPAddress : : On_User_Find2 ( DLG_FindUser * pDlg )
{
CString str ;
CString strFind ;
if ( pDlg - > m_bFindAll ) //<2F> <> ѯ<EFBFBD> <D1AF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
m_bFind2 = true ; //<2F> <> <EFBFBD> ڲ<EFBFBD> ѯ<EFBFBD> <D1AF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> ,<2C> <> Щ<EFBFBD> <D0A9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ܽ<EFBFBD> <DCBD> <EFBFBD>
memset ( m_szGroupID , 0 , sizeof ( m_szGroupID ) ) ;
strFind = _T ( " select * from paddress where 1<>1 " ) ;
}
else
{
//<2F> <> ѯ<EFBFBD> <D1AF> <EFBFBD> <EFBFBD>
if ( _tcslen ( m_szGroupID ) > 0 )
strFind . Format ( _T ( " select * from paddress where GroupID='%s' and ( 1<>1 " ) , m_szGroupID ) ;
else
strFind . Format ( _T ( " select * from paddress where (GroupID='' or GroupID is null) and ( 1<>1 " ) , m_szGroupID ) ;
}
if ( pDlg - > m_bName ) //name
{
str . Format ( _T ( " or name like '%%%s%%' " ) , pDlg - > m_strMsg ) ;
strFind + = str ;
}
if ( pDlg - > m_bNickName ) //nickname
{
str . Format ( _T ( " or nickname like '%%%s%%' " ) , pDlg - > m_strMsg ) ;
strFind + = str ;
}
if ( pDlg - > m_bSex ) //sex
{
str . Format ( _T ( " or sex like '%%%s%%' " ) , pDlg - > m_strMsg ) ;
strFind + = str ;
}
if ( pDlg - > m_bLTD ) //LTD
{
str . Format ( _T ( " or LTD like '%%%s%%' " ) , pDlg - > m_strMsg ) ;
strFind + = str ;
}
if ( pDlg - > m_bJob ) //job
{
str . Format ( _T ( " or job like '%%%s%%' " ) , pDlg - > m_strMsg ) ;
strFind + = str ;
}
if ( pDlg - > m_bTel ) //Tel
{
str . Format ( _T ( " or tel like '%%%s%%' " ) , pDlg - > m_strMsg ) ;
strFind + = str ;
}
if ( pDlg - > m_bMobile ) //Mobile
{
str . Format ( _T ( " or mobile like '%%%s%%' " ) , pDlg - > m_strMsg ) ;
strFind + = str ;
}
if ( pDlg - > m_bEmail ) //Email
{
str . Format ( _T ( " or email like '%%%s%%' " ) , pDlg - > m_strMsg ) ;
strFind + = str ;
}
if ( pDlg - > m_bBZ ) //BZ
{
str . Format ( _T ( " or BZ like '%%%s%%' " ) , pDlg - > m_strMsg ) ;
strFind + = str ;
}
if ( ! pDlg - > m_bFindAll )
{
strFind + = _T ( " ) " ) ;
}
m_wndList . ShowWindow ( SW_HIDE ) ; //<2F> ӿ<EFBFBD> <D3BF> <EFBFBD> ʾ <EFBFBD> ٶ<EFBFBD>
m_wndList . DeleteAllItems ( ) ;
TCHAR szBuf [ 32 ] = { 0 } ;
BOOL b = m_AdoRS . Open ( strFind ) ;
long lCount = m_AdoRS . GetRecordCount ( ) ;
if ( b & & lCount > 0 )
{
COleDateTime t ;
m_AdoRS . MoveFirst ( ) ;
for ( int i = 0 ; i < lCount ; i + + )
{
PAddress user = { 0 } ;
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 ( " NickName " ) , user . szNickName ) ;
m_AdoRS . GetCollect ( _T ( " Sex " ) , user . szSex ) ;
m_AdoRS . GetCollect ( _T ( " Birthday " ) , t ) ; t . GetAsSystemTime ( user . tBirthday ) ;
m_AdoRS . GetCollect ( _T ( " Ltd " ) , user . szLtd ) ;
m_AdoRS . GetCollect ( _T ( " Job " ) , user . szJob ) ;
m_AdoRS . GetCollect ( _T ( " Tel " ) , user . szTel ) ;
m_AdoRS . GetCollect ( _T ( " Fax " ) , user . szFax ) ;
m_AdoRS . GetCollect ( _T ( " Email " ) , user . szEmail ) ;
m_AdoRS . GetCollect ( _T ( " Mobile " ) , user . szMobile ) ;
m_AdoRS . GetCollect ( _T ( " QQ " ) , user . szQQ ) ;
m_AdoRS . GetCollect ( _T ( " BZ " ) , user . szBZ ) ;
# ifdef MOBSET_VIPINT
m_AdoRS . GetCollect ( _T ( " VipInt " ) , user . lVipInt ) ;
# endif
m_AdoRS . MoveNext ( ) ;
# ifdef SHMZ_VER
if ( this - > m_pMainFrame - > GetUserPurview_HideNum ( ) )
{
user . szMobile [ 4 ] = ' * ' ;
user . szMobile [ 5 ] = ' * ' ;
user . szMobile [ 6 ] = ' * ' ;
user . szMobile [ 7 ] = ' * ' ;
//user.szMobile[8]='*';
}
# endif
//_T("<22> <> <EFBFBD> <EFBFBD> ,50; <20> <> <EFBFBD> <EFBFBD> ,80; <20> dz<EFBFBD> ,80;<3B> ֻ<EFBFBD> ,100;<3B> 绰,80; <20> <> <EFBFBD> <EFBFBD> ,90;ְ<> <D6B0> ,80;Email,80;")
m_wndList . InsertItem ( i , _itot ( i + 1 , szBuf , 10 ) ) ; //<2F> <> <EFBFBD> <EFBFBD>
m_wndList . SetItemData ( i , user . lUserID ) ;
m_wndList . SetItemText ( i , 1 , user . szName ) ;
m_wndList . SetItemText ( i , 2 , user . szNickName ) ;
m_wndList . SetItemText ( i , 3 , user . szMobile ) ;
m_wndList . SetItemText ( i , 4 , user . szTel ) ;
COleDateTime t ( user . tBirthday ) ;
if ( t . GetStatus ( ) = = COleDateTime : : valid )
{
str . Format ( _T ( " %04d.%02d.%02d " ) , t . GetYear ( ) , t . GetMonth ( ) , t . GetDay ( ) ) ;
m_wndList . SetItemText ( i , 5 , str ) ;
}
else
{
m_wndList . SetItemText ( i , 5 , _T ( " " ) ) ;
}
m_wndList . SetItemText ( i , 6 , user . szLtd ) ;
m_wndList . SetItemText ( i , 7 , user . szJob ) ;
m_wndList . SetItemText ( i , 8 , user . szEmail ) ;
# ifdef SHOWBZ_VER
m_wndList . SetItemText ( i , 9 , user . szBZ ) ;
# endif
# ifdef MOBSET_VIPINT
str . Format ( _T ( " %d " ) , user . lVipInt ) ;
m_wndList . SetItemText ( i , 9 , str ) ;
# endif
}
}
else
{
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 ) ;
}
m_wndList . ShowWindow ( SW_SHOW ) ; //Ϊ<> ˼ӿ<CBBC> <D3BF> <EFBFBD> ʾ <EFBFBD> ٶ<EFBFBD>
}
void CFPAddress : : OnDestroy ( )
{
if ( m_Copy_Data )
{
delete m_Copy_Data ;
m_Copy_Data = NULL ;
}
CDialog : : OnDestroy ( ) ;
}
void CFPAddress : : On_User_UBox_Mobile ( )
{
# ifdef SUPPER_UBOX
if ( m_lCurUserID < = 0 )
return ;
if ( m_strCurMobile . GetLength ( ) < = 0 )
return ;
m_pMainFrame - > m_DlgUBoxDial . SetDialNumber ( m_strCurMobile ) ;
# endif
}
void CFPAddress : : On_User_UBox_Tel ( )
{
# ifdef SUPPER_UBOX
if ( m_lCurUserID < = 0 )
return ;
if ( m_strCurTel . GetLength ( ) < = 0 )
return ;
m_pMainFrame - > m_DlgUBoxDial . SetDialNumber ( m_strCurTel ) ;
# endif
}
void CFPAddress : : On_User_UBox_Log ( )
{
if ( m_lCurUserID < = 0 )
return ;
REQ_UBox_GetLog2 * pGetLog = new REQ_UBox_GetLog2 ;
memset ( pGetLog , 0 , sizeof ( REQ_UBox_GetLog2 ) ) ;
pGetLog - > lCorpID = m_pMainFrame - > m_lCorpID ;
pGetLog - > lUserID = m_pMainFrame - > m_lUserID ;
_tcscpy ( pGetLog - > szKH_Name , m_strCurName ) ;
pGetLog - > lAddressType = 1 ; //˽<> <CBBD> ͨѶ¼
pGetLog - > lKH_UserID = m_lCurUserID ;
m_pMainFrame - > SendFrame ( SMSFUNC_UBOX_GETLOG2 , ( BYTE * ) pGetLog , sizeof ( REQ_UBox_GetLog2 ) ) ;
}
void CFPAddress : : On_User_ReadPlace ( void )
{
CString str ;
str . Format ( _T ( " select * from paddress where UserType='1' and len(mobile)>=7 " ) ) ;
//str.Format(_T("select * from paddress where UserType='1' and len(mobile)>=7 and (place is null or len(place)<2)"));
//str.Format(_T("select * from paddress where UserType='1'"));
BOOL b = m_AdoRS_Place . Open ( str ) ;
if ( ! b )
{
MessageBox ( _T ( " û<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫˢ<EFBFBD> º<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ص<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݣ<EFBFBD> " ) , _T ( " <EFBFBD> <EFBFBD> Ϣ" ) , MB_ICONINFORMATION ) ;
return ;
}
m_lPlace_Index = 0 ;
m_lPlace_Count = m_AdoRS_Place . GetRecordCount ( ) ;
m_DLGGetUser . SetProcessTitle ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> ڶ<EFBFBD> ȡ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,<2C> <> <EFBFBD> Ժ<EFBFBD> ..." ) ) ;
m_DLGGetUser . SetProcess ( m_lPlace_Count , m_lPlace_Index ) ;
Place_GetNext ( ) ;
m_DLGGetUser . DoModal ( ) ;
return ;
}
void CFPAddress : : Place_GetNext ( void )
{
ANS_GAddress_Place_Data * pData = new ANS_GAddress_Place_Data [ GADDRESS_PLACE_MAXCOUNT ] ;
memset ( pData , 0 , sizeof ( ANS_GAddress_Place_Data ) * GADDRESS_PLACE_MAXCOUNT ) ;
long lRecord = 0 ;
BOOL bEnd = false ;
for ( int i = 0 ; i < GADDRESS_PLACE_MAXCOUNT ; i + + )
{
if ( m_AdoRS_Place . IsEOF ( ) )
{
bEnd = true ;
break ;
}
else
{
m_AdoRS_Place . GetCollect ( _T ( " UserID " ) , pData [ lRecord ] . lUserID ) ;
m_AdoRS_Place . GetCollect ( _T ( " Mobile " ) , pData [ lRecord ] . szMobile ) ;
lRecord + + ;
}
m_AdoRS_Place . MoveNext ( ) ;
}
if ( bEnd )
m_lPlace_Index = m_lPlace_Count ;
else
m_lPlace_Index + = lRecord ;
long lSize = sizeof ( REQ_GAddress_Place ) + sizeof ( ANS_GAddress_Place_Data ) * lRecord ;
BYTE * pDataSend = new BYTE [ lSize ] ;
memset ( pDataSend , 0 , lSize ) ;
REQ_GAddress_Place * pPlace = ( REQ_GAddress_Place * ) pDataSend ;
ANS_GAddress_Place_Data * pPlaceData = ( ANS_GAddress_Place_Data * ) ( pDataSend + sizeof ( REQ_GAddress_Place ) ) ;
pPlace - > lCorpID = m_pMainFrame - > m_lCorpID ;
pPlace - > lUserID = m_pMainFrame - > m_lUserID ;
pPlace - > lPlaceIndex = m_lPlace_Index ;
pPlace - > lPlaceCount = m_lPlace_Count ;
pPlace - > lRecord = lRecord ;
memcpy ( pPlaceData , pData , sizeof ( ANS_GAddress_Place_Data ) * lRecord ) ;
m_pMainFrame - > SendFrame ( SMSFUNC_GADDRESS_PLACE , ( BYTE * ) pDataSend , lSize ) ;
delete pData ;
}
BOOL CFPAddress : : ProcessSocket ( Socket_Head_Add * pHead , BYTE * pFrame )
{
CString str ;
//<2F> Ĺ<DEB8> <C4B9> õ<EFBFBD> ַ<EFBFBD> <D6B7>
if ( pHead - > lFuncType = = SMSFUNC_GADDRESS_PLACE )
{
ANS_GAddress_Place * pPlace = ( ANS_GAddress_Place * ) pFrame ;
ANS_GAddress_Place_Data * pData = ( ANS_GAddress_Place_Data * ) ( pFrame + sizeof ( ANS_GAddress_Place ) ) ;
if ( pPlace - > bOK )
{
for ( int i = 0 ; i < pPlace - > lRecord ; i + + )
{
str . Format ( _T ( " update paddress set Place='%s' where userid=%d " ) , pData [ i ] . szPlace , pData [ i ] . lUserID , pData [ i ] . szPlace ) ;
m_AdoRS . Open ( str ) ;
}
m_DLGGetUser . SetProcess ( pPlace - > lPlaceCount , pPlace - > lPlaceIndex ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> й<EFBFBD> <D0B9> <EFBFBD>
if ( pPlace - > lPlaceIndex < pPlace - > lPlaceCount )
{
if ( m_DLGGetUser . IsWindowVisible ( ) )
Place_GetNext ( ) ;
}
else
{
str . Format ( _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> %d<> <64> <EFBFBD> <EFBFBD> <EFBFBD> ݡ<EFBFBD> \r \n <EFBFBD> <EFBFBD> ˢ<EFBFBD> º<EFBFBD> <EFBFBD> 鿴<EFBFBD> Ŷ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݡ<EFBFBD> " ) , pPlace - > lPlaceIndex ) ;
MessageBox ( str , _T ( " <EFBFBD> <EFBFBD> Ϣ" ) , MB_ICONINFORMATION ) ;
}
}
else
{
m_DLGGetUser . SetProcess ( 1 , 1 ) ; //ֹͣ<CDA3> <D6B9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ
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> 飡" ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , MB_ICONWARNING ) ;
}
return true ;
}
return false ;
}