2025-02-27 16:58:16 +08:00
// FGAddress2.cpp : implementation file
//
# include "stdafx.h"
# include "CorpSms.h"
# include "FGAddress2.h"
# ifdef _DEBUG
# define new DEBUG_NEW
# undef THIS_FILE
static char THIS_FILE [ ] = __FILE__ ;
# endif
/////////////////////////////////////////////////////////////////////////////
// CFGAddress2 dialog
# include "MainFrm.h"
# include "ProcessSocket.h"
# include "DLG_User_Modify.h"
# include "DLG_User_Modify2.h"
# include "DLG_Group_Modify.h"
# include "FuncView.h"
# include "DLG_User_Inport2.h"
# include "DLG_User_ModifyP.h"
# include "DLG_User_Log.h"
# include "DLG_User_InportP2.h"
# include "..\public\StringSort\StringSort.h"
CFGAddress2 : : CFGAddress2 ( CWnd * pParent /*=NULL*/ )
: CDialog ( CFGAddress2 : : IDD , pParent )
{
//{{AFX_DATA_INIT(CFGAddress2)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_bInit = false ;
m_bRefresh = false ;
m_pInUser = NULL ;
m_bInUser = false ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ڲ<EFBFBD> <DAB2> <EFBFBD> <EFBFBD> û<EFBFBD>
m_lUserID = 0 ;
m_bFind2 = false ;
memset ( m_szGroupID , 0 , sizeof ( m_szGroupID ) ) ;
memset ( m_szLocal , 0 , sizeof ( m_szLocal ) ) ;
//<2F> <> <EFBFBD> ƣ<EFBFBD> ճ<EFBFBD> <D5B3> <EFBFBD> <EFBFBD> <EFBFBD> õ<EFBFBD> <C3B5> ı <EFBFBD> <C4B1> <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 ;
m_bReBack = false ;
m_lReBackIndex = 0 ;
m_lReBackCount = 0 ;
m_bUpLoad = false ;
m_lReBackType = 0 ;
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 ;
}
void CFGAddress2 : : DoDataExchange ( CDataExchange * pDX )
{
CDialog : : DoDataExchange ( pDX ) ;
//{{AFX_DATA_MAP(CFGAddress2)
DDX_Control ( pDX , IDC_GADDRESS2_LIST , m_wndList ) ;
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP ( CFGAddress2 , CDialog )
//{{AFX_MSG_MAP(CFGAddress2)
ON_WM_SIZE ( )
ON_NOTIFY ( NM_DBLCLK , IDC_GADDRESS2_LIST , OnDblclkGaddressList )
ON_NOTIFY ( NM_RCLICK , IDC_GADDRESS2_LIST , OnRclickGaddressList )
ON_WM_TIMER ( )
ON_NOTIFY ( LVN_KEYDOWN , IDC_GADDRESS2_LIST , OnKeydownGaddressList )
ON_WM_DESTROY ( )
//}}AFX_MSG_MAP
ON_MESSAGE ( LIST_DROP_BEGIN , On_List_DropBegin )
ON_COMMAND ( MENU_GADDRESS2_ADDADDR , On_User_AddAddr )
ON_COMMAND ( MENU_GADDRESS2_ADDGROUP , On_User_AddGroup )
ON_COMMAND ( MENU_GADDRESS2_MODIFY , On_User_Modify )
ON_COMMAND ( MENU_GADDRESS2_DEL , On_User_Del )
ON_COMMAND ( MENU_GADDRESS2_FIND , On_User_Find )
ON_COMMAND ( MENU_GADDRESS2_ADDTOLIST , On_User_AddToList )
ON_COMMAND ( MENU_GADDRESS2_ADDTOLIST_FAX , On_User_AddToList_Fax )
ON_COMMAND ( MENU_GADDRESS2_ADDTOLIST_MMS , On_User_AddToList_Mms )
ON_COMMAND ( MENU_GADDRESS2_INPORT , On_User_Inport )
ON_COMMAND ( MENU_GADDRESS2_EXPORT , On_User_Export )
ON_COMMAND ( MENU_GADDRESS2_REFRESH , On_User_Refresh )
ON_COMMAND ( MENU_GADDRESS2_LOG , On_User_Log )
ON_COMMAND ( MENU_GADDRESS2_COPY , On_User_Copy )
ON_COMMAND ( MENU_GADDRESS2_CUT , On_User_Cut )
ON_COMMAND ( MENU_GADDRESS2_PASTE , On_User_Paste )
ON_COMMAND ( MENU_GADDRESS2_UBOX_MOBILE , On_User_UBox_Mobile )
ON_COMMAND ( MENU_GADDRESS2_UBOX_TEL , On_User_UBox_Tel )
ON_COMMAND ( MENU_GADDRESS2_UBOX_LOG , On_User_UBox_Log )
END_MESSAGE_MAP ( )
/////////////////////////////////////////////////////////////////////////////
// CFGAddress2 message handlers
BOOL CFGAddress2 : : 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_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
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
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
}
BOOL CFGAddress2 : : ReHide ( )
{
ShowWindow ( SW_HIDE ) ;
return true ;
}
BOOL CFGAddress2 : : ReShow ( BOOL bRefresh )
{
ShowWindow ( SW_SHOW ) ;
if ( bRefresh | | ! m_bRefresh )
{
RefreshInfo ( ) ;
}
return true ;
}
BOOL CFGAddress2 : : RefreshInfo ( )
{
return true ;
}
void CFGAddress2 : : OnSize ( UINT nType , int cx , int cy )
{
CDialog : : OnSize ( nType , cx , cy ) ;
if ( m_bInit )
{
m_wndList . MoveWindow ( 0 , 0 , cx , cy ) ;
}
}
long CFGAddress2 : : 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 ;
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 gaddress 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
_tcscpy ( szSelect , _T ( " select * from gaddress where GroupID is null or len(GroupID)=0 and UserType='1' order by UserID " ) ) ; //<2F> <> <EFBFBD> Ҵ<EFBFBD> <D2B4> <EFBFBD> <EFBFBD> µ<EFBFBD> <C2B5> û<EFBFBD>
else
_stprintf ( szSelect , _T ( " Select * from gaddress where GroupID='%s' AND UserType='1' order by UserID " ) , m_szGroupID ) ; //<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 + + )
{
ANS_GAddress22_SeeData 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 ( " Addr " ) , user . szAddr ) ;
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 ( " CreateTime " ) , t ) ; t . GetAsSystemTime ( user . tCreateTime ) ;
m_AdoRS . GetCollect ( _T ( " BZ " ) , user . szBZ ) ;
m_AdoRS . MoveNext ( ) ;
if ( this - > m_pMainFrame - > GetUserPurview_HideNum ( ) )
{
user . szMobile [ 4 ] = ' * ' ;
user . szMobile [ 5 ] = ' * ' ;
user . szMobile [ 6 ] = ' * ' ;
user . szMobile [ 7 ] = ' * ' ;
//user.szMobile[8]='*';
}
//m_wndList.SetHeadings(_T("<22> <> <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;"));
_stprintf ( szSelect , _T ( " %d " ) , i + 1 ) ;
m_wndList . InsertItem ( i , szSelect ) ; //<2F> <> <EFBFBD> <EFBFBD>
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_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 ) ;
# ifdef MOBSET_OEM_YTLE
m_wndList . SetItemText ( i , 5 , user . szFax ) ;
# else
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 ( " " ) ) ;
}
# endif
m_wndList . SetItemText ( i , 6 , user . szLTD ) ;
m_wndList . SetItemText ( i , 7 , user . szJob ) ;
m_wndList . SetItemText ( i , 8 , user . szEmail ) ;
# ifdef MOBSET_OEM_YTLE
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 , 9 , str ) ;
}
else
{
m_wndList . SetItemText ( i , 9 , _T ( " " ) ) ;
}
m_wndList . SetItemText ( i , 10 , user . szBZ ) ;
# endif
# ifdef SHOWBZ_VER
m_wndList . SetItemText ( i , 9 , user . szBZ ) ;
# endif
}
//return lCount;
}
m_wndList . ShowWindow ( SW_SHOW ) ; //Ϊ<> ˼ӿ<CBBC> <D3BF> <EFBFBD> ʾ <EFBFBD> ٶ<EFBFBD>
return 0 ;
}
void CFGAddress2 : : On_User_AddAddr ( )
{
if ( ! m_pMainFrame - > GetUserPurview ( PURVIEW_GADDRESS_ADD ) )
{
return ;
}
if ( m_bFind2 ) //<2F> <> <EFBFBD> ڲ<EFBFBD> ѯ<EFBFBD> <D1AF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> ˲<EFBFBD> <CBB2> <EFBFBD> <EFBFBD> <EFBFBD> Ч
return ;
if ( isAddressFull ( ) ) //ͨѶ¼<D1B6> <C2BC> <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 , 1 ) ;
dlg . DoModal ( ) ;
}
void CFGAddress2 : : On_User_AddGroup ( )
{
if ( ! m_pMainFrame - > GetUserPurview ( PURVIEW_GADDRESS_ADD ) )
{
return ;
}
if ( m_bFind2 ) //<2F> <> <EFBFBD> ڲ<EFBFBD> ѯ<EFBFBD> <D1AF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> ˲<EFBFBD> <CBB2> <EFBFBD> <EFBFBD> <EFBFBD> Ч
return ;
if ( isAddressFull ( ) ) //ͨѶ¼<D1B6> <C2BC> <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 gaddress 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
//<2F> µ<EFBFBD> <C2B5> <EFBFBD> IDӦ<44> ɷ<EFBFBD> <C9B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɣ <EFBFBD> <C9A3> <EFBFBD> ȥ<EFBFBD> <C8A5> <EFBFBD> <EFBFBD> ĸID,<2C> <> <EFBFBD> ص<EFBFBD> <D8B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ID
//_tcscpy( GAdd.szGroupID , szGroupID );
_tcscpy ( GAdd . szGroupID , m_szGroupID ) ;
_tcscpy ( GAdd . szCreateUser , m_pMainFrame - > m_pCurUser - > szUser ) ;
DLG_Group_Modify dlg ( this ) ;
dlg . SetParam ( GAdd , m_szLocal , _T ( " gaddress " ) ) ;
if ( dlg . DoModal ( ) = = IDOK )
{
long lSize = sizeof ( REQ_GAddress2_Group_Add ) + sizeof ( ANS_GAddress2_Group_AddData ) ;
BYTE * pAddData = new BYTE [ lSize ] ; memset ( pAddData , 0 , lSize ) ;
REQ_GAddress2_Group_Add * pAdd = ( REQ_GAddress2_Group_Add * ) pAddData ; //ͷ
ANS_GAddress2_Group_AddData * pGAdd = ( ANS_GAddress2_Group_AddData * ) ( pAddData + sizeof ( REQ_GAddress2_Group_Add ) ) ;
GAdd = dlg . GetParam ( ) ;
pGAdd - > lUserID = GAdd . lUserID ;
_tcscpy ( pGAdd - > szBZ , GAdd . szBZ ) ;
_tcscpy ( pGAdd - > szCreateUser , GAdd . szCreateUser ) ;
_tcscpy ( pGAdd - > szGroupID , GAdd . szGroupID ) ;
_tcscpy ( pGAdd - > szGroupName , GAdd . szGroupName ) ;
: : GetLocalTime ( & pGAdd - > tCreateTime ) ;
pAdd - > lCorpID = m_pMainFrame - > m_lCorpID ;
pAdd - > lCount = 1 ;
m_pMainFrame - > SendFrame ( SMSFUNC_GADDRESS2_GROUP_ADD , pAddData , lSize ) ;
}
}
void CFGAddress2 : : On_User_Modify ( )
{
if ( ! m_pMainFrame - > GetUserPurview ( PURVIEW_GADDRESS_SEE ) )
{
return ;
}
long lItem = GetCurrentSelected ( ) ;
if ( lItem < 0 )
return ;
if ( isLockItem ( lItem ) )
{
return ;
}
long lUserID = m_wndList . GetItemData ( lItem ) ;
PAddress Address = GetUserData ( lUserID ) ;
if ( _tcslen ( Address . szName ) > 0 )
{
if ( m_pMainFrame - > GetUserPurview ( PURVIEW_GADDRESS_MODIFY , false ) )
{
DLG_User_ModifyP dlg ( this ) ;
TCHAR szLocal [ 128 ] = { 0 } ;
GetLocal ( szLocal , Address . szGroupID ) ; //ȡ<> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λ<EFBFBD> <CEBB>
dlg . SetParam ( Address , szLocal , false , 1 ) ;
if ( dlg . DoModal ( ) = = IDOK )
{
SetLockItem ( lItem , true ) ;
long lSize = sizeof ( REQ_GAddress22_Modify ) + sizeof ( ANS_GAddress22_SeeData ) ;
BYTE * pModifyData = new BYTE [ lSize ] ; memset ( pModifyData , 0 , lSize ) ;
REQ_GAddress22_Modify * pModify = ( REQ_GAddress22_Modify * ) pModifyData ; //ͷ
ANS_GAddress22_SeeData * pAddress = ( ANS_GAddress22_SeeData * ) ( pModifyData + sizeof ( REQ_GAddress22_Modify ) ) ;
Address = dlg . GetParam ( ) ;
pAddress - > lUserID = Address . lUserID ;
_tcscpy ( pAddress - > szBZ , Address . szBZ ) ;
_tcscpy ( pAddress - > szEmail , Address . szEmail ) ;
_tcscpy ( pAddress - > szFax , Address . szFax ) ;
_tcscpy ( pAddress - > szGroupID , Address . szGroupID ) ;
_tcscpy ( pAddress - > szJob , Address . szJob ) ;
_tcscpy ( pAddress - > szAddr , Address . szAddress ) ;
_tcscpy ( pAddress - > szLTD , Address . szLtd ) ;
_tcscpy ( pAddress - > szMobile , Address . szMobile ) ;
_tcscpy ( pAddress - > szName , Address . szName ) ;
_tcscpy ( pAddress - > szNickName , Address . szNickName ) ;
_tcscpy ( pAddress - > szQQ , Address . szQQ ) ;
_tcscpy ( pAddress - > szSex , Address . szSex ) ;
_tcscpy ( pAddress - > szTel , Address . szTel ) ;
_tcscpy ( pAddress - > szUserType , Address . szUserType ) ;
pAddress - > tBirthday = Address . tBirthday ;
pAddress - > tCreateTime = Address . tCreateTime ;
pModify - > lCorpID = m_pMainFrame - > m_lCorpID ;
pModify - > lItem = lItem ;
pModify - > lCount = 1 ;
m_pMainFrame - > SendFrame ( SMSFUNC_GADDRESS22_MODIFY , pModifyData , lSize ) ;
}
}
}
}
void CFGAddress2 : : On_User_Del ( )
{
if ( ! m_pMainFrame - > GetUserPurview ( PURVIEW_GADDRESS_DEL ) )
{
return ;
}
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 lSize = sizeof ( REQ_GAddress2_Del ) + sizeof ( ANS_GAddress2_DelData ) * lCount ;
BYTE * pDelSend = new BYTE [ lSize ] ; memset ( pDelSend , 0 , lSize ) ;
REQ_GAddress2_Del * pDel = ( REQ_GAddress2_Del * ) pDelSend ; //ͷ
ANS_GAddress2_DelData * pDelData = ( ANS_GAddress2_DelData * ) ( pDelSend + sizeof ( REQ_GAddress2_Del ) ) ;
pDel - > lCount = lCount ;
POSITION pos = m_wndList . GetFirstSelectedItemPosition ( ) ;
while ( pos )
{
long lItem = m_wndList . GetNextSelectedItem ( pos ) ;
long lUserID = m_wndList . GetItemData ( lItem ) ;
CString strLogin = m_wndList . GetItemText ( lItem , 1 ) ;
/*
if ( lUserID = = m_pMainFrame - > m_lUserID )
{
long lRet = 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> <EFBFBD> \r \n <EFBFBD> Ƿ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɾ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʺţ<EFBFBD> " ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2 ) ;
if ( lRet ! = IDYES )
continue ;
}
if ( strLogin = = _T ( " Admin " ) )
{
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> ʾ " ) , MB_ICONINFORMATION ) ;
continue ;
}
*/
pDelData - > lItem = lItem ;
pDelData - > lUserID = lUserID ;
this - > SetLockItem ( lItem , true ) ; //<2F> <> <EFBFBD> <EFBFBD>
pDelData + + ;
}
m_pMainFrame - > SendFrame ( SMSFUNC_GADDRESS2_DEL , pDelSend , lSize ) ;
}
void CFGAddress2 : : 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 , 3 , szMsg , sizeof ( szMsg ) ) ;
bFind = FoundChar ( szMsg , szFind , _tcslen ( szMsg ) ) ;
}
if ( ! bFind & & dlg . m_bNickName ) //nickname
{
memset ( szMsg , 0 , sizeof ( szMsg ) ) ;
m_wndList . GetItemText ( i , 4 , szMsg , sizeof ( szMsg ) ) ;
bFind = FoundChar ( szMsg , szFind , _tcslen ( szMsg ) ) ;
}
if ( ! bFind & & dlg . m_bSex ) //sex
{
memset ( szMsg , 0 , sizeof ( szMsg ) ) ;
m_wndList . GetItemText ( i , 4 , szMsg , sizeof ( szMsg ) ) ;
bFind = FoundChar ( szMsg , szFind , _tcslen ( szMsg ) ) ;
}
if ( ! bFind & & dlg . m_bJob ) //job
{
memset ( szMsg , 0 , sizeof ( szMsg ) ) ;
m_wndList . GetItemText ( i , 8 , szMsg , sizeof ( szMsg ) ) ;
bFind = FoundChar ( szMsg , szFind , _tcslen ( szMsg ) ) ;
}
if ( ! bFind & & dlg . m_bTel ) //Tel
{
memset ( szMsg , 0 , sizeof ( szMsg ) ) ;
m_wndList . GetItemText ( i , 6 , szMsg , sizeof ( szMsg ) ) ;
bFind = FoundChar ( szMsg , szFind , _tcslen ( szMsg ) ) ;
}
if ( ! bFind & & dlg . m_bMobile ) //Mobile
{
memset ( szMsg , 0 , sizeof ( szMsg ) ) ;
m_wndList . GetItemText ( i , 5 , szMsg , sizeof ( szMsg ) ) ;
bFind = FoundChar ( szMsg , szFind , _tcslen ( szMsg ) ) ;
}
if ( ! bFind & & dlg . m_bEmail ) //Email
{
memset ( szMsg , 0 , sizeof ( szMsg ) ) ;
m_wndList . GetItemText ( i , 9 , 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 CFGAddress2 : : On_User_AddToList ( )
{
On_User_AddToList_Public ( 0 ) ;
}
void CFGAddress2 : : On_User_AddToList_Fax ( )
{
On_User_AddToList_Public ( 1 ) ;
}
void CFGAddress2 : : On_User_AddToList_Mms ( )
{
On_User_AddToList_Public ( 2 ) ;
}
void CFGAddress2 : : On_User_AddToList_Public ( long lSendType )
{
if ( ! m_pMainFrame - > GetUserPurview ( PURVIEW_SENDG ) )
{
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 gaddress 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 ) ;
if ( lSendType = = 1 ) //<2F> <> <EFBFBD> <EFBFBD>
m_AdoRS . GetCollect ( _T ( " Fax " ) , pUser - > szMobile ) ;
else
m_AdoRS . GetCollect ( _T ( " Mobile " ) , pUser - > szMobile ) ;
m_AdoRS . GetCollect ( _T ( " BZ " ) , pUser - > szBZ ) ;
}
}
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 CFGAddress2 : : 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 ) , 5 ) ;
//DLG_User_Inport dlg(this);
//dlg.SetInport(NULL,&m_wndList,true,false);
if ( dlg . DoModal ( ) = = IDOK )
{
if ( m_pInUser )
{ delete m_pInUser ; m_pInUser = NULL ; } ;
m_lInUserCount = dlg . m_User . GetCount ( ) ;
m_lInUserIndex = 0 ;
if ( m_lInUserCount > 0 )
{
//ȡ<> <C8A1> Ϣ
m_pInUser = new ANS_GAddress22_SeeData [ m_lInUserCount ] ;
memset ( m_pInUser , 0 , sizeof ( ANS_GAddress22_SeeData ) * m_lInUserCount ) ;
POSITION pos = dlg . m_User . GetHeadPosition ( ) ;
long i = 0 ;
while ( pos )
{
PAddress pAddress = * dlg . m_User . GetNext ( pos ) ;
_tcscpy ( m_pInUser [ i ] . szName , pAddress . szName ) ;
_tcscpy ( m_pInUser [ i ] . szSex , pAddress . szSex ) ;
_tcscpy ( m_pInUser [ i ] . szNickName , pAddress . szNickName ) ;
_tcscpy ( m_pInUser [ i ] . szMobile , pAddress . szMobile ) ;
_tcscpy ( m_pInUser [ i ] . szTel , pAddress . szTel ) ;
_tcscpy ( m_pInUser [ i ] . szFax , pAddress . szFax ) ;
m_pInUser [ i ] . tBirthday = pAddress . tBirthday ;
_tcscpy ( m_pInUser [ i ] . szLTD , pAddress . szLtd ) ;
_tcscpy ( m_pInUser [ i ] . szJob , pAddress . szJob ) ;
_tcscpy ( m_pInUser [ i ] . szAddr , pAddress . szAddress ) ;
_tcscpy ( m_pInUser [ i ] . szEmail , pAddress . szEmail ) ;
_tcscpy ( m_pInUser [ i ] . szQQ , pAddress . szQQ ) ;
_tcscpy ( m_pInUser [ i ] . szBZ , pAddress . szBZ ) ;
i + + ;
}
m_bInUser = true ; //<2F> <> <EFBFBD> ڵ<EFBFBD> <DAB5> <EFBFBD> <EFBFBD> <EFBFBD> ַ<EFBFBD> <D6B7>
m_DLGGetUser . SetProcessTitle ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> ڵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ַ<EFBFBD> <EFBFBD> ,<2C> <> <EFBFBD> Ժ<EFBFBD> ..." ) ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ӵ<EFBFBD> ַ<EFBFBD> <D6B7> <EFBFBD> <EFBFBD> Ϣ
Inport_Next ( ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_DLGGetUser . DoModal ( ) ;
delete m_pInUser ;
m_pInUser = NULL ;
m_bInUser = false ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ڵ<EFBFBD> <DAB5> <EFBFBD> <EFBFBD> <EFBFBD> ַ<EFBFBD> <D6B7>
}
TCHAR Buf [ 64 ] = { 0 } ;
_stprintf ( Buf , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ַ<EFBFBD> <EFBFBD> <EFBFBD> ɹ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> %d<> <64> <EFBFBD> <EFBFBD> Ч<EFBFBD> û<EFBFBD> !" ) , m_lInUserIndex ) ;
MessageBox ( Buf , _T ( " <EFBFBD> <EFBFBD> Ϣ" ) , MB_ICONASTERISK ) ;
}
dlg . Close ( ) ; //<2F> ر<EFBFBD> <D8B1> <EFBFBD> <EFBFBD> <EFBFBD>
}
void CFGAddress2 : : On_User_ReBack ( )
{
USES_CONVERSION ;
int iRet = MessageBox ( _T ( " <EFBFBD> ָ<EFBFBD> ͨѶ¼<EFBFBD> <EFBFBD> <EFBFBD> Ḳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> е <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͨѶ¼<EFBFBD> <EFBFBD> <EFBFBD> ݣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> أ<EFBFBD> \r \n <EFBFBD> Ƿ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , _T ( " ȷ<EFBFBD> <EFBFBD> " ) , MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2 ) ;
if ( iRet ! = IDYES )
return ;
# define FILE_FILTER_TEXT \
TEXT ( " bak<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> (*.bak) \0 *.bak \0 " ) \
TEXT ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> (*.*)\0 *.*; \0 \0 " )
CString strFileName ;
TCHAR szFile [ 256 ] ;
TCHAR szFileB [ 256 ] ;
* szFileB = NULL ;
_stprintf ( szFile , _T ( " Address.bak " ) ) ;
OPENFILENAME sOpen ;
sOpen . lStructSize = sizeof ( sOpen ) ;
sOpen . hwndOwner = this - > m_hWnd ;
sOpen . Flags = OFN_EXPLORER | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY ;
sOpen . lpstrFilter = FILE_FILTER_TEXT ;
sOpen . lpstrDefExt = _T ( " bak " ) ;
sOpen . lpstrCustomFilter = NULL ;
sOpen . nMaxCustFilter = 0 ;
sOpen . lpstrFile = szFile ;
sOpen . nMaxFile = sizeof ( szFile ) ;
sOpen . lpstrFileTitle = szFileB ;
sOpen . nMaxFileTitle = sizeof ( szFileB ) ;
sOpen . lpstrInitialDir = NULL ;
sOpen . lpstrTitle = _T ( " ѡ <EFBFBD> <EFBFBD> ͨѶ¼<EFBFBD> <EFBFBD> <EFBFBD> ݵ<EFBFBD> <EFBFBD> ļ<EFBFBD> " ) ;
if ( ! : : GetOpenFileName ( & sOpen ) )
{
return ;
}
strFileName = sOpen . lpstrFile ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
char szPasswd [ 64 ] = { 0 } ; strcpy ( szPasswd , ACCESS_PASSWD ) ;
char szKey [ 64 ] = { 0 } ; strcpy ( szKey , ACCESS_KEY ) ;
char szNew2 [ 64 ] = { 0 } ; long lOut = sizeof ( szNew2 ) ;
TCHAR szNew [ 64 ] = { 0 } ;
CDes des ;
des . Decrypt ( szPasswd , strlen ( szPasswd ) , szNew2 , lOut , szKey , 8 ) ;
# ifdef UNICODE
_tcscpy ( szNew , A2W ( szNew2 ) ) ;
# else
strcpy ( szNew , szNew2 ) ;
# endif
if ( ! m_BadoConnection . ConnectAccess ( strFileName , szNew ) ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݿ<EFBFBD> <DDBF> <EFBFBD> <EFBFBD> <EFBFBD> ,<2C> <> Ҫ<EFBFBD> <D2AA> <EFBFBD> ´ <EFBFBD> <C2B4> <EFBFBD>
{
MessageBox ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͨѶ¼<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 飡" ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , MB_ICONWARNING ) ;
return ;
}
m_BAdoRS . SetAdoConnection ( & m_BadoConnection ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
long lCount = 0 ;
m_BAdoRS . Open ( _T ( " select * from paddress order by GroupID,usertype " ) ) ;
m_lReBackCount = m_BAdoRS . GetRecordCount ( ) ;
m_lReBackIndex = 0 ;
if ( m_lReBackCount < = 0 )
{
MessageBox ( _T ( " <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 ;
}
strFileName . Format ( _T ( " <EFBFBD> <EFBFBD> Ҫ<EFBFBD> ָ<EFBFBD> <EFBFBD> <EFBFBD> ͨѸ¼<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> %d<> <64> <EFBFBD> <EFBFBD> ¼<EFBFBD> <C2BC> <EFBFBD> Ƿ<EFBFBD> <C7B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , m_lReBackCount ) ;
iRet = MessageBox ( strFileName , _T ( " ȷ<EFBFBD> <EFBFBD> " ) , MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2 ) ;
if ( iRet ! = IDYES )
return ;
m_lReBackType = 0 ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ID<49> <44> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͨѸ¼
long lSize = sizeof ( REQ_GAddress2_Del ) + sizeof ( ANS_GAddress2_DelData ) ;
BYTE * pDelSend = new BYTE [ lSize ] ; memset ( pDelSend , 0 , lSize ) ;
REQ_GAddress2_Del * pDel = ( REQ_GAddress2_Del * ) pDelSend ; //ͷ
ANS_GAddress2_DelData * pDelData = ( ANS_GAddress2_DelData * ) ( pDelSend + sizeof ( REQ_GAddress2_Del ) ) ;
pDel - > lCount = 1 ;
pDelData - > lItem = - 100 ;
pDelData - > lUserID = - 100 ;
_tcscpy ( pDelData - > szGroupID , m_pMainFrame - > m_strMainGroupID ) ;
m_pMainFrame - > SendFrame ( SMSFUNC_GADDRESS2_DEL , pDelSend , lSize ) ;
/*
m_AdoRS . Open ( _T ( " delete from paddress " ) ) ; //<2F> <> ɾ<EFBFBD> <C9BE> <EFBFBD> <EFBFBD> <EFBFBD> м<EFBFBD> ¼
m_AdoRS . Open ( _T ( " paddress " ) , adCmdTable ) ;
AdoRS . MoveFirst ( ) ;
while ( ! AdoRS . IsEOF ( ) )
{
PAddress Address = { 0 } ;
COleDateTime t ;
AdoRS . GetCollect ( _T ( " UserID " ) , Address . lUserID ) ;
AdoRS . GetCollect ( _T ( " UserType " ) , Address . szUserType ) ;
AdoRS . GetCollect ( _T ( " GroupID " ) , Address . szGroupID ) ;
AdoRS . GetCollect ( _T ( " Name " ) , Address . szName ) ;
AdoRS . GetCollect ( _T ( " NickName " ) , Address . szNickName ) ;
AdoRS . GetCollect ( _T ( " Sex " ) , Address . szSex ) ;
AdoRS . GetCollect ( _T ( " Birthday " ) , t ) ; t . GetAsSystemTime ( Address . tBirthday ) ;
AdoRS . GetCollect ( _T ( " Ltd " ) , Address . szLtd ) ;
AdoRS . GetCollect ( _T ( " Addr " ) , Address . szAddress ) ;
AdoRS . GetCollect ( _T ( " Job " ) , Address . szJob ) ;
AdoRS . GetCollect ( _T ( " Tel " ) , Address . szTel ) ;
AdoRS . GetCollect ( _T ( " Fax " ) , Address . szFax ) ;
AdoRS . GetCollect ( _T ( " Email " ) , Address . szEmail ) ;
AdoRS . GetCollect ( _T ( " Mobile " ) , Address . szMobile ) ;
AdoRS . GetCollect ( _T ( " QQ " ) , Address . szQQ ) ;
AdoRS . GetCollect ( _T ( " CreateTime " ) , t ) ; t . GetAsSystemTime ( Address . tCreateTime ) ;
AdoRS . GetCollect ( _T ( " BZ " ) , Address . szBZ ) ;
m_AdoRS . AddNew ( ) ;
//m_AdoRS.PutCollect( _T("UserID") , Address.lUserID);
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 ( " Email " ) , Address . szEmail ) ;
m_AdoRS . PutCollect ( _T ( " Mobile " ) , Address . szMobile ) ;
m_AdoRS . PutCollect ( _T ( " QQ " ) , Address . szQQ ) ;
m_AdoRS . PutCollect ( _T ( " CreateTime " ) , Address . tCreateTime ) ;
m_AdoRS . PutCollect ( _T ( " BZ " ) , Address . szBZ ) ;
m_AdoRS . Update ( ) ;
AdoRS . MoveNext ( ) ;
lCount + + ;
}
m_AdoRS . Close ( ) ;
AdoRS . Close ( ) ;
adoConnection . Close ( ) ;
CString strTemp ;
strTemp . Format ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͨѶ¼<EFBFBD> ɹ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> :\r \n <EFBFBD> ļ<EFBFBD> <EFBFBD> <EFBFBD> :%s\r \n <EFBFBD> <EFBFBD> ¼<EFBFBD> <EFBFBD> :%d" ) , strFileName , lCount ) ;
MessageBox ( strTemp , _T ( " <EFBFBD> <EFBFBD> Ϣ" ) , MB_ICONINFORMATION ) ;
On_User2_Refresh ( ) ;
*/
}
void CFGAddress2 : : On_User_Export ( )
{
DLG_User_Inport2 dlg ( this ) ;
dlg . SetInport ( & m_AdoRS , m_szGroupID , 2 , false ) ;
dlg . SetOutportName ( m_strGroupName ) ;
dlg . DoModal ( ) ;
}
void CFGAddress2 : : On_User_Refresh ( )
{
ShowUser ( m_lUserID ) ; //ˢ<> <CBA2>
}
void CFGAddress2 : : 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 ;
}
if ( m_Copy_Data )
{
delete m_Copy_Data ; m_Copy_Data = NULL ;
}
m_Copy_Data = new ANS_GAddress22_SeeData [ lCount ] ;
memset ( m_Copy_Data , 0 , sizeof ( ANS_GAddress22_SeeData ) * 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 ] = GetUserData2 ( lUserID ) ;
i + + ;
}
m_Copy_Count = i ;
m_Copy_Type = GADDRESS2_COPYTYPE_COPY ;
}
void CFGAddress2 : : On_User_Cut ( )
{
On_User_Copy ( ) ;
m_Copy_Type = GADDRESS2_COPYTYPE_CUT ;
}
void CFGAddress2 : : 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 = = GADDRESS2_COPYTYPE_CUT ) ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
return ;
CString str ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֪<EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> ƶ<EFBFBD>
long lSize = sizeof ( REQ_GAddress2_User_Move ) + sizeof ( REQ_GAddress2_User_Move_Data ) * m_Copy_Count ;
BYTE * pData = new BYTE [ lSize ] ;
memset ( pData , 0 , lSize ) ;
REQ_GAddress2_User_Move * pMove = ( REQ_GAddress2_User_Move * ) pData ;
REQ_GAddress2_User_Move_Data * pMoveData = ( REQ_GAddress2_User_Move_Data * ) ( pData + sizeof ( REQ_GAddress2_User_Move ) ) ;
pMove - > lCount = m_Copy_Count ;
pMove - > lMoveType = 0 ; //<2F> ƶ<EFBFBD>
if ( m_Copy_Type = = GADDRESS2_COPYTYPE_COPY )
pMove - > lMoveType = 1 ; //<2F> <> <EFBFBD> <EFBFBD>
_tcscpy ( pMove - > szTagGroup , m_szGroupID ) ;
for ( int i = 0 ; i < m_Copy_Count ; i + + )
{
pMoveData - > lUserID = m_Copy_Data [ i ] . lUserID ;
pMoveData + + ;
}
this - > m_pMainFrame - > SendFrame ( SMSFUNC_GADDRESS2_USER_MOVE , pData , lSize ) ;
}
void CFGAddress2 : : On_User_Log ( )
{
if ( ! m_pMainFrame - > GetUserPurview ( PURVIEW_GADDRESS_SEE ) )
{
return ;
}
long lItem = GetCurrentSelected ( ) ;
if ( lItem < 0 )
return ;
long lUserID = m_wndList . GetItemData ( lItem ) ;
PAddress Address = GetUserData ( lUserID ) ;
//CString strMobile = m_wndList.GetItemText(lItem,3);
CString strMobile = Address . szMobile ;
DLG_User_Log dlg ( this ) ;
dlg . SetHideNum ( m_pMainFrame - > GetUserPurview_HideNum ( ) ) ;
dlg . SetParam ( & m_AdoRS , strMobile ) ;
dlg . DoModal ( ) ;
}
long CFGAddress2 : : GetCurrentSelected ( )
{
POSITION pos = m_wndList . GetFirstSelectedItemPosition ( ) ;
if ( pos )
{
return m_wndList . GetNextSelectedItem ( pos ) ;
}
return - 1 ;
}
BOOL CFGAddress2 : : isLockItem ( long lItem , BOOL bShowWarning )
{
BOOL b = ( m_wndList . GetIconIndex ( lItem ) = = 3 ) ;
if ( b & & bShowWarning )
{
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> !" ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , MB_ICONINFORMATION ) ;
}
return b ;
}
void CFGAddress2 : : SetLockItem ( long lItem , BOOL bLock )
{
if ( bLock )
m_wndList . SetIconIndex ( lItem , 3 ) ;
else
{
m_wndList . SetIconIndex ( lItem , 2 ) ; //<2F> <> δ֪<CEB4> Ա<EFBFBD>
}
}
void CFGAddress2 : : ShowRMenu ( )
{
if ( ! m_pMainFrame - > GetUserPurview ( PURVIEW_GADDRESS_SEE , false ) ) //û<> в鿴Ȩ<E9BFB4> <C8A8>
return ;
CMenu menu ;
menu . CreatePopupMenu ( ) ;
BOOL bLock = false ;
long lItem = this - > GetCurrentSelected ( ) ;
if ( lItem > = 0 )
bLock = isLockItem ( lItem , false ) ; //ȡ<> <C8A1> <EFBFBD> Ƿ<EFBFBD> <C7B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//<2F> <> <EFBFBD> <EFBFBD>
if ( m_pMainFrame - > GetUserPurview ( PURVIEW_GADDRESS_ADD , false ) & & ! m_bFind2 )
{
menu . AppendMenu ( MF_STRING , MENU_GADDRESS2_ADDADDR , _T ( " <20> <> <EFBFBD> <EFBFBD> ͨѶ¼ " ) ) ;
menu . AppendMenu ( MF_STRING , MENU_GADDRESS2_ADDGROUP , _T ( " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_GADDRESS2_ADDADDR , _T ( " <20> <> <EFBFBD> <EFBFBD> ͨѶ¼ " ) ) ;
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_GADDRESS2_ADDGROUP , _T ( " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> " ) ) ;
}
menu . AppendMenu ( MF_SEPARATOR ) ;
//<2F> <EFBFBD>
if ( m_pMainFrame - > GetUserPurview ( PURVIEW_GADDRESS_MODIFY , false ) & & lItem > = 0 & & ! bLock )
{
menu . AppendMenu ( MF_STRING , MENU_GADDRESS2_MODIFY , _T ( " <20> <> <20> <> " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_GADDRESS2_MODIFY , _T ( " <20> <> <20> <> " ) ) ;
}
//ɾ<> <C9BE>
if ( m_pMainFrame - > GetUserPurview ( PURVIEW_GADDRESS_DEL , false ) & & lItem > = 0 & & ! bLock )
{
menu . AppendMenu ( MF_STRING , MENU_GADDRESS2_DEL , _T ( " ɾ <20> <> " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_GADDRESS2_DEL , _T ( " ɾ <20> <> " ) ) ;
}
menu . AppendMenu ( MF_SEPARATOR ) ;
//<2F> <> <EFBFBD> Ͷ<EFBFBD> <CDB6> <EFBFBD>
if ( m_pMainFrame - > GetUserPurview ( PURVIEW_SENDG , false ) & & lItem > = 0 & & ! bLock )
{
menu . AppendMenu ( MF_STRING , MENU_GADDRESS2_ADDTOLIST , _T ( " <20> <> <EFBFBD> Ͷ<EFBFBD> <CDB6> <EFBFBD> " ) ) ;
# ifdef SUPPER_FUNC_FAX
menu . AppendMenu ( MF_STRING , MENU_GADDRESS2_ADDTOLIST_FAX , _T ( " <20> <> <EFBFBD> ʹ <EFBFBD> <CDB4> <EFBFBD> " ) ) ;
# endif
# ifdef SUPPER_FUNC_MMS
menu . AppendMenu ( MF_STRING , MENU_GADDRESS2_ADDTOLIST_MMS , _T ( " <20> <> <EFBFBD> Ͳ<EFBFBD> <CDB2> <EFBFBD> " ) ) ;
# endif
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_GADDRESS2_ADDTOLIST , _T ( " <20> <> <EFBFBD> Ͷ<EFBFBD> <CDB6> <EFBFBD> " ) ) ;
# ifdef SUPPER_FUNC_FAX
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_GADDRESS2_ADDTOLIST_FAX , _T ( " <20> <> <EFBFBD> ʹ <EFBFBD> <CDB4> <EFBFBD> " ) ) ;
# endif
# ifdef SUPPER_FUNC_MMS
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_GADDRESS2_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_GADDRESS2_UBOX_MOBILE , str ) ;
}
else
{
popMenuUBox . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_GADDRESS2_UBOX_MOBILE , str ) ;
}
str . Format ( _T ( " <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 绰:%s " ) , m_strCurTel ) ;
if ( bUBox & & m_strCurTel . GetLength ( ) > 0 )
{
popMenuUBox . AppendMenu ( MF_STRING , MENU_GADDRESS2_UBOX_TEL , str ) ;
}
else
{
popMenuUBox . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_GADDRESS2_UBOX_TEL , str ) ;
}
popMenuUBox . AppendMenu ( MF_SEPARATOR ) ;
if ( bUBox )
{
popMenuUBox . AppendMenu ( MF_STRING , MENU_GADDRESS2_UBOX_LOG , _T ( " ͨ<> <CDA8> <EFBFBD> <EFBFBD> ־ " ) ) ;
}
else
{
popMenuUBox . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_GADDRESS2_UBOX_LOG , _T ( " ͨ<> <CDA8> <EFBFBD> <EFBFBD> ־ " ) ) ;
}
# endif
menu . AppendMenu ( MF_SEPARATOR ) ;
//if ( !m_bFind2 )
menu . AppendMenu ( MF_STRING , MENU_GADDRESS2_FIND , _T ( " <20> <> <EFBFBD> <EFBFBD> ... " ) ) ;
//else
// menu.AppendMenu(MF_STRING|MF_DISABLED|MF_GRAYED , MENU_GADDRESS2_FIND, _T(" <20> <> <EFBFBD> <EFBFBD> ... ") );
if ( lItem > = 0 )
menu . AppendMenu ( MF_STRING , MENU_GADDRESS2_LOG , _T ( " <20> շ<EFBFBD> <D5B7> <EFBFBD> ־... " ) ) ;
else
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_GADDRESS2_LOG , _T ( " <20> շ<EFBFBD> <D5B7> <EFBFBD> ־... " ) ) ;
menu . AppendMenu ( MF_SEPARATOR ) ;
if ( lItem > = 0 & & ! m_bFind2 )
{
menu . AppendMenu ( MF_STRING , MENU_GADDRESS2_COPY , _T ( " <20> <> <20> <> " ) ) ;
menu . AppendMenu ( MF_STRING , MENU_GADDRESS2_CUT , _T ( " <20> <> <20> <> " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_GADDRESS2_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 = = GADDRESS2_COPYTYPE_CUT ) )
menu . AppendMenu ( MF_STRING , MENU_GADDRESS2_PASTE , _T ( " ճ <20> <> " ) ) ;
else
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_GADDRESS2_PASTE , _T ( " ճ <20> <> " ) ) ;
menu . AppendMenu ( MF_SEPARATOR ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD>
if ( m_pMainFrame - > GetUserPurview ( PURVIEW_GADDRESS_ADD , false ) & & ! m_bFind2 )
{
menu . AppendMenu ( MF_STRING , MENU_GADDRESS2_INPORT , _T ( " <20> <> <EFBFBD> <EFBFBD> ͨѶ¼ " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_GADDRESS2_INPORT , _T ( " <20> <> <EFBFBD> <EFBFBD> ͨѶ¼ " ) ) ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD>
if ( m_pMainFrame - > GetUserPurview ( PURVIEW_GADDRESS_MODIFY , false ) )
{
menu . AppendMenu ( MF_STRING , MENU_GADDRESS2_EXPORT , _T ( " <20> <> <EFBFBD> <EFBFBD> ͨѶ¼ " ) ) ;
}
else
{
menu . AppendMenu ( MF_STRING | MF_DISABLED | MF_GRAYED , MENU_GADDRESS2_EXPORT , _T ( " <20> <> <EFBFBD> <EFBFBD> ͨѶ¼ " ) ) ;
}
menu . AppendMenu ( MF_SEPARATOR ) ;
//ˢ<> <CBA2>
menu . AppendMenu ( MF_STRING , MENU_GADDRESS2_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 CFGAddress2 : : GetUserData ( long lUserID )
{
PAddress Address = { 0 } ;
TCHAR szSelect [ 128 ] = { 0 } ;
_stprintf ( szSelect , _T ( " Select * from gaddress 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 ( " Job " ) , Address . szJob ) ;
m_AdoRS . GetCollect ( _T ( " Addr " ) , Address . szAddress ) ;
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 ) ;
}
return Address ;
}
void CFGAddress2 : : OnDblclkGaddressList ( NMHDR * pNMHDR , LRESULT * pResult )
{
On_User_Modify ( ) ;
* pResult = 0 ;
}
BOOL CFGAddress2 : : ProcessSocket ( Socket_Head * pHead )
{
CString str ;
//<2F> Ĺ<DEB8> <C4B9> õ<EFBFBD> ַ<EFBFBD> <D6B7>
if ( pHead - > lFuncType = = SMSFUNC_GADDRESS22_MODIFY )
{
ANS_GAddress22_Modify * pModify = ( ANS_GAddress22_Modify * ) pHead - > pFrame ;
ANS_GAddress22_SeeData * pData = ( ANS_GAddress22_SeeData * ) ( pHead - > pFrame + sizeof ( ANS_GAddress22_Modify ) ) ;
SetLockItem ( pModify - > lItem , false ) ; //<2F> <> <EFBFBD> <EFBFBD>
if ( pModify - > lCount = = 1 ) //<2F> <> <EFBFBD> <EFBFBD> 1ʱ<31> <CAB1> ʾ <EFBFBD> ijɹ<C4B3>
{
long lUserID = m_wndList . GetItemData ( pModify - > lItem ) ;
if ( lUserID = = pData - > lUserID )
{
long lIcon = 2 ;
if ( _tcscmp ( pData - > szSex , _T ( " <EFBFBD> <EFBFBD> " ) ) = = 0 )
lIcon = 0 ;
if ( _tcscmp ( pData - > szSex , _T ( " Ů " ) ) = = 0 )
lIcon = 1 ;
m_wndList . SetIconIndex ( pModify - > lItem , lIcon ) ;
m_wndList . SetItemText ( pModify - > lItem , 1 , pData - > szName ) ;
m_wndList . SetItemText ( pModify - > lItem , 2 , pData - > szNickName ) ;
m_wndList . SetItemText ( pModify - > lItem , 3 , pData - > szMobile ) ;
m_wndList . SetItemText ( pModify - > lItem , 4 , pData - > szTel ) ;
# ifdef MOBSET_OEM_YTLE
m_wndList . SetItemText ( pModify - > lItem , 5 , pData - > szFax ) ;
# else
COleDateTime t ( pData - > tBirthday ) ;
if ( t . GetStatus ( ) = = COleDateTime : : valid )
{
str . Format ( _T ( " %04d.%02d.%02d " ) , t . GetYear ( ) , t . GetMonth ( ) , t . GetDay ( ) ) ;
m_wndList . SetItemText ( pModify - > lItem , 5 , str ) ;
}
else
{
m_wndList . SetItemText ( pModify - > lItem , 5 , _T ( " " ) ) ;
}
# endif
m_wndList . SetItemText ( pModify - > lItem , 6 , pData - > szLTD ) ;
m_wndList . SetItemText ( pModify - > lItem , 7 , pData - > szJob ) ;
m_wndList . SetItemText ( pModify - > lItem , 8 , pData - > szEmail ) ;
# ifdef MOBSET_OEM_YTLE
COleDateTime t ( pData - > tBirthday ) ;
if ( t . GetStatus ( ) = = COleDateTime : : valid )
{
str . Format ( _T ( " %04d.%02d.%02d " ) , t . GetYear ( ) , t . GetMonth ( ) , t . GetDay ( ) ) ;
m_wndList . SetItemText ( pModify - > lItem , 9 , str ) ;
}
else
{
m_wndList . SetItemText ( pModify - > lItem , 9 , _T ( " " ) ) ;
}
m_wndList . SetItemText ( pModify - > lItem , 10 , pData - > szBZ ) ;
# endif
# ifdef SHOWBZ_VER
m_wndList . SetItemText ( pModify - > lItem , 9 , pData - > szBZ ) ;
# endif
}
//<2F> <> <EFBFBD> µ<EFBFBD> <C2B5> <EFBFBD> <EFBFBD> <EFBFBD> д<EFBFBD> 뱾<EFBFBD> <EBB1BE> <EFBFBD> <EFBFBD> <EFBFBD> ݿ<EFBFBD>
TCHAR szSelect [ 128 ] = { 0 } ;
_stprintf ( szSelect , _T ( " select * from gaddress where UserID=%d " ) , pData - > lUserID ) ;
BOOL b = m_AdoRS . Open ( szSelect ) ;
if ( b & & ! m_AdoRS . IsEOF ( ) )
{
m_AdoRS . PutCollect ( _T ( " GroupID " ) , pData - > szGroupID ) ;
m_AdoRS . PutCollect ( _T ( " Name " ) , pData - > szName ) ;
m_AdoRS . PutCollect ( _T ( " NickName " ) , pData - > szNickName ) ;
m_AdoRS . PutCollect ( _T ( " Sex " ) , pData - > szSex ) ;
m_AdoRS . PutCollect ( _T ( " Birthday " ) , pData - > tBirthday ) ;
m_AdoRS . PutCollect ( _T ( " LTD " ) , pData - > szLTD ) ;
m_AdoRS . PutCollect ( _T ( " Job " ) , pData - > szJob ) ;
m_AdoRS . PutCollect ( _T ( " Addr " ) , pData - > szAddr ) ;
m_AdoRS . PutCollect ( _T ( " Tel " ) , pData - > szTel ) ;
m_AdoRS . PutCollect ( _T ( " Fax " ) , pData - > szFax ) ;
m_AdoRS . PutCollect ( _T ( " Mobile " ) , pData - > szMobile ) ;
m_AdoRS . PutCollect ( _T ( " Email " ) , pData - > szEmail ) ;
m_AdoRS . PutCollect ( _T ( " QQ " ) , pData - > szQQ ) ;
m_AdoRS . PutCollect ( _T ( " BZ " ) , pData - > szBZ ) ;
m_AdoRS . Update ( ) ;
m_AdoRS . Close ( ) ;
}
}
return true ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD>
if ( pHead - > lFuncType = = SMSFUNC_GADDRESS22_ADD )
{
ANS_GAddress22_Add * pAdd = ( ANS_GAddress22_Add * ) pHead - > pFrame ;
ANS_GAddress22_SeeData * pData = ( ANS_GAddress22_SeeData * ) ( pHead - > pFrame + sizeof ( ANS_GAddress22_Add ) ) ;
if ( pAdd - > lCount = = 1 & & pData - > lUserID > 0 ) //<2F> <> <EFBFBD> <EFBFBD> 1ʱ<31> <CAB1> ʾ <EFBFBD> ijɹ<C4B3>
{
if ( ! m_bReBack )
{
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;<3B> ֻ<EFBFBD> ,100;<3B> 绰,80; <20> <> <EFBFBD> <EFBFBD> ,90;ְ<> <D6B0> ,80;Email,80;"));
m_wndList . InsertItem ( lCount , _itot ( lCount + 1 , Buf , 10 ) ) ; //<2F> <> <EFBFBD> <EFBFBD>
long lIcon = 2 ;
if ( _tcscmp ( pData - > szSex , _T ( " <EFBFBD> <EFBFBD> " ) ) = = 0 )
lIcon = 0 ;
if ( _tcscmp ( pData - > szSex , _T ( " Ů " ) ) = = 0 )
lIcon = 1 ;
m_wndList . SetIconIndex ( lCount , lIcon ) ;
m_wndList . SetItemData ( lCount , pData - > lUserID ) ;
m_wndList . SetItemText ( lCount , 1 , pData - > szName ) ;
m_wndList . SetItemText ( lCount , 2 , pData - > szNickName ) ;
m_wndList . SetItemText ( lCount , 3 , pData - > szMobile ) ;
m_wndList . SetItemText ( lCount , 4 , pData - > szTel ) ;
COleDateTime t ( pData - > 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 , pData - > szLTD ) ;
m_wndList . SetItemText ( lCount , 7 , pData - > szJob ) ;
m_wndList . SetItemText ( lCount , 8 , pData - > szEmail ) ;
# ifdef SHOWBZ_VER
m_wndList . SetItemText ( lCount , 9 , pData - > szBZ ) ;
# endif
}
//<2F> <> <EFBFBD> ӵ<EFBFBD> <D3B5> <EFBFBD> <EFBFBD> ݿ<EFBFBD> <DDBF> <EFBFBD>
BOOL b = m_AdoRS . Open ( _T ( " gaddress " ) , adCmdTable ) ;
if ( b )
{
m_AdoRS . AddNew ( ) ;
m_AdoRS . PutCollect ( _T ( " UserID " ) , pData - > lUserID ) ;
m_AdoRS . PutCollect ( _T ( " UserType " ) , pData - > szUserType ) ;
m_AdoRS . PutCollect ( _T ( " GroupID " ) , pData - > szGroupID ) ;
m_AdoRS . PutCollect ( _T ( " Name " ) , pData - > szName ) ;
m_AdoRS . PutCollect ( _T ( " NickName " ) , pData - > szNickName ) ;
m_AdoRS . PutCollect ( _T ( " Sex " ) , pData - > szSex ) ;
m_AdoRS . PutCollect ( _T ( " Birthday " ) , pData - > tBirthday ) ;
m_AdoRS . PutCollect ( _T ( " LTD " ) , pData - > szLTD ) ;
m_AdoRS . PutCollect ( _T ( " Job " ) , pData - > szJob ) ;
m_AdoRS . PutCollect ( _T ( " Addr " ) , pData - > szAddr ) ;
m_AdoRS . PutCollect ( _T ( " Tel " ) , pData - > szTel ) ;
m_AdoRS . PutCollect ( _T ( " Fax " ) , pData - > szFax ) ;
m_AdoRS . PutCollect ( _T ( " Mobile " ) , pData - > szMobile ) ;
m_AdoRS . PutCollect ( _T ( " Email " ) , pData - > szEmail ) ;
m_AdoRS . PutCollect ( _T ( " QQ " ) , pData - > szQQ ) ;
m_AdoRS . PutCollect ( _T ( " CreateTime " ) , pData - > tCreateTime ) ;
m_AdoRS . PutCollect ( _T ( " BZ " ) , pData - > szBZ ) ;
m_AdoRS . Update ( ) ;
}
m_AdoRS . Close ( ) ;
}
if ( m_bReBack )
{
m_lReBackIndex + + ;
m_DLGGetUser . SetProcess ( m_lReBackCount , m_lReBackIndex ) ;
ReBack_Next ( ) ;
}
if ( m_bInUser ) //<2F> ǵ<EFBFBD> <C7B5> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <D2AA> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,<2C> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB>
{
m_lInUserIndex + + ;
m_DLGGetUser . SetProcess ( m_lInUserCount , m_lInUserIndex ) ;
Inport_Next ( ) ;
}
return true ;
}
//ɾ<> <C9BE> <EFBFBD> û<EFBFBD>
if ( pHead - > lFuncType = = SMSFUNC_GADDRESS2_DEL )
{
ANS_GAddress2_Del * pDel = ( ANS_GAddress2_Del * ) pHead - > pFrame ;
ANS_GAddress2_DelData * pDelData = ( ANS_GAddress2_DelData * ) ( pHead - > pFrame + sizeof ( ANS_GAddress2_Del ) ) ;
if ( pDel - > lCount = = - 100 ) //ɾ<> <C9BE> ͨѸ¼
{
m_AdoRS . Open ( _T ( " delete from gaddress " ) ) ; //<2F> <> <EFBFBD> ձ<EFBFBD> <D5B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_AdoRS . Close ( ) ;
m_bReBack = true ;
m_DLGGetUser . SetProcessTitle ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϴ<EFBFBD> <EFBFBD> <EFBFBD> ַ<EFBFBD> <EFBFBD> ,<2C> <> <EFBFBD> Ժ<EFBFBD> ..." ) ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ӵ<EFBFBD> ַ<EFBFBD> <D6B7> <EFBFBD> <EFBFBD> Ϣ
m_BAdoRS . MoveFirst ( ) ;
ReBack_Next ( ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_DLGGetUser . DoModal ( ) ;
m_bReBack = false ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ڵ<EFBFBD> <DAB5> <EFBFBD> <EFBFBD> <EFBFBD> ַ<EFBFBD> <D6B7>
m_pMainFrame - > ReadGAddress2 ( true ) ;
return true ;
}
m_wndList . ShowWindow ( SW_HIDE ) ; //Ϊ<> ˼ӿ<CBBC> <D3BF> <EFBFBD> ʾ <EFBFBD> ٶ<EFBFBD>
for ( int i = pDel - > lCount - 1 ; i > = 0 ; i - - )
{
if ( pDelData [ i ] . lItem > = 0 )
{
long lUserID = m_wndList . GetItemData ( pDelData [ i ] . lItem ) ;
if ( pDelData [ i ] . lUserID & & lUserID = = pDelData [ i ] . lUserID ) //ɾ<> <C9BE> <EFBFBD> ɹ<EFBFBD>
{
m_wndList . DeleteItem ( pDelData [ i ] . lItem ) ; //<2F> <> ListCtrl<72> <6C> ɾ<EFBFBD> <C9BE>
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ݿ<EFBFBD> <DDBF> <EFBFBD> ɾ<EFBFBD> <C9BE>
TCHAR szSelect [ 128 ] = { 0 } ;
_stprintf ( szSelect , _T ( " delete from gaddress where UserID=%d " ) , pDelData [ i ] . lUserID ) ;
m_AdoRS . Open ( szSelect ) ;
m_AdoRS . Close ( ) ;
}
else
{
this - > SetLockItem ( pDelData [ i ] . lItem , false ) ; //<2F> <> <EFBFBD> <EFBFBD>
}
}
}
m_wndList . ShowWindow ( SW_SHOW ) ; //Ϊ<> ˼ӿ<CBBC> <D3BF> <EFBFBD> ʾ <EFBFBD> ٶ<EFBFBD>
return true ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD>
if ( pHead - > lFuncType = = SMSFUNC_GADDRESS2_GROUP_ADD )
{
ANS_GAddress2_Group_Add * pAdd = ( ANS_GAddress2_Group_Add * ) pHead - > pFrame ;
ANS_GAddress2_Group_AddData * pData = ( ANS_GAddress2_Group_AddData * ) ( pHead - > pFrame + sizeof ( ANS_GAddress2_Group_Add ) ) ;
if ( pAdd - > lCount = = 1 & & pData - > lUserID > 0 ) //<2F> <> <EFBFBD> <EFBFBD> 1ʱ<31> <CAB1> ʾ <EFBFBD> <CABE> <EFBFBD> ӳɹ<D3B3>
{
//<2F> <> <EFBFBD> ӵ<EFBFBD> <D3B5> <EFBFBD>
if ( ! m_bReBack )
{
m_pFuncView - > AddGGroup2 ( pData - > szGroupName , m_lUserID , pData - > lUserID ) ;
}
if ( m_bUpLoad )
{
m_bUpLoad = false ;
m_bReBack = true ;
m_strTagGroupID = pData - > szGroupID ;
m_DLGGetUser . SetProcessTitle ( _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϴ<EFBFBD> <EFBFBD> <EFBFBD> ַ<EFBFBD> <EFBFBD> ,<2C> <> <EFBFBD> Ժ<EFBFBD> ..." ) ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ӵ<EFBFBD> ַ<EFBFBD> <D6B7> <EFBFBD> <EFBFBD> Ϣ
if ( m_lReBackCount > 1 & & ! isAddressFull ( ) )
{
m_BAdoRS . MoveFirst ( ) ;
ReBack_Next ( ) ;
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
m_DLGGetUser . DoModal ( ) ;
}
m_bReBack = false ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ڵ<EFBFBD> <DAB5> <EFBFBD> <EFBFBD> <EFBFBD> ַ<EFBFBD> <D6B7>
m_pMainFrame - > ReadGAddress2 ( true ) ;
return true ;
}
//<2F> <> <EFBFBD> ӵ<EFBFBD> <D3B5> <EFBFBD> <EFBFBD> ݿ<EFBFBD> <DDBF> <EFBFBD>
BOOL b = m_AdoRS . Open ( _T ( " gaddress " ) , adCmdTable ) ;
if ( b )
{
m_AdoRS . AddNew ( ) ;
m_AdoRS . PutCollect ( _T ( " UserID " ) , pData - > lUserID ) ;
m_AdoRS . PutCollect ( _T ( " UserType " ) , _T ( " 0 " ) ) ; //<2F> û<EFBFBD> <C3BB> <EFBFBD>
m_AdoRS . PutCollect ( _T ( " GroupID " ) , pData - > szGroupID ) ;
m_AdoRS . PutCollect ( _T ( " Name " ) , pData - > szGroupName ) ;
m_AdoRS . PutCollect ( _T ( " CreateTime " ) , pData - > tCreateTime ) ;
m_AdoRS . PutCollect ( _T ( " BZ " ) , pData - > szBZ ) ;
m_AdoRS . Update ( ) ;
}
}
if ( m_bReBack )
{
m_lReBackIndex + + ;
m_DLGGetUser . SetProcess ( m_lReBackCount , m_lReBackIndex ) ;
ReBack_Next ( ) ;
}
return true ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD>
if ( pHead - > lFuncType = = SMSFUNC_GADDRESS2_USER_MOVE )
{
ANS_GAddress2_User_Move * pMove = ( ANS_GAddress2_User_Move * ) pHead - > pFrame ;
REQ_GAddress2_User_Move_Data * pMoveData = ( REQ_GAddress2_User_Move_Data * ) ( pHead - > pFrame + sizeof ( ANS_GAddress2_User_Move ) ) ;
if ( pMove - > lCount > 0 & & pMove - > lCount = = m_Copy_Count ) //<2F> <> <EFBFBD> <EFBFBD> 1ʱ<31> <CAB1> ʾ <EFBFBD> <CABE> <EFBFBD> ӳɹ<D3B3>
{
if ( pMove - > lMoveType = = 0 ) //<2F> <> <EFBFBD> <EFBFBD> ,ֱ<> Ӹ<EFBFBD> <D3B8> <EFBFBD> <EFBFBD> <EFBFBD> ID<49> <44> <EFBFBD> <EFBFBD>
{
for ( int i = 0 ; i < pMove - > lCount ; i + + )
{
str . Format ( _T ( " Update gaddress set GroupID='%s' where UserID=%d " ) , pMove - > szTagGroup , pMoveData [ i ] . lUserID ) ;
m_AdoRS . Open ( str ) ;
m_AdoRS . Close ( ) ;
}
}
if ( pMove - > lMoveType = = 1 ) //<2F> <> <EFBFBD> ƣ<EFBFBD>
{
//<2F> <> <EFBFBD> ӵ<EFBFBD> <D3B5> <EFBFBD> <EFBFBD> ݿ<EFBFBD> <DDBF> <EFBFBD>
BOOL b = m_AdoRS . Open ( _T ( " gaddress " ) , adCmdTable ) ;
if ( b )
{
for ( int i = 0 ; i < pMove - > lCount ; i + + )
{
m_AdoRS . AddNew ( ) ;
m_AdoRS . PutCollect ( _T ( " UserID " ) , pMoveData [ i ] . lUserID ) ;
m_AdoRS . PutCollect ( _T ( " UserType " ) , m_Copy_Data [ i ] . szUserType ) ;
m_AdoRS . PutCollect ( _T ( " GroupID " ) , pMove - > szTagGroup ) ;
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 ( " Job " ) , m_Copy_Data [ i ] . szJob ) ;
m_AdoRS . PutCollect ( _T ( " Addr " ) , m_Copy_Data [ i ] . szAddr ) ;
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 ( " CreateTime " ) , m_Copy_Data [ i ] . tCreateTime ) ;
m_AdoRS . PutCollect ( _T ( " BZ " ) , m_Copy_Data [ i ] . szBZ ) ;
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>
if ( CString ( pMove - > szTagGroup ) = = CString ( this - > m_szGroupID ) )
{
for ( int i = 0 ; i < m_Copy_Count ; i + + )
{
TCHAR szBuf [ 32 ] = { 0 } ;
long lCount = m_wndList . GetItemCount ( ) ;
m_wndList . InsertItem ( lCount , _itot ( lCount + 1 , szBuf , 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 . SetItemData ( lCount , m_Copy_Data [ i ] . lUserID ) ;
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
}
}
if ( m_Copy_Type = = GADDRESS2_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 ;
}
}
}
return true ;
}
return false ;
}
BOOL CFGAddress2 : : ProcessSocket ( Socket_Head_Add * pHead , BYTE * pFrame )
{
CString str ;
//<2F> Ĺ<DEB8> <C4B9> õ<EFBFBD> ַ<EFBFBD> <D6B7>
if ( pHead - > lFuncType = = SMSFUNC_GADDRESS22_MODIFY )
{
ANS_GAddress22_Modify * pModify = ( ANS_GAddress22_Modify * ) pFrame ;
ANS_GAddress22_SeeData * pData = ( ANS_GAddress22_SeeData * ) ( pFrame + sizeof ( ANS_GAddress22_Modify ) ) ;
SetLockItem ( pModify - > lItem , false ) ; //<2F> <> <EFBFBD> <EFBFBD>
if ( pModify - > lCount = = 1 ) //<2F> <> <EFBFBD> <EFBFBD> 1ʱ<31> <CAB1> ʾ <EFBFBD> ijɹ<C4B3>
{
long lUserID = m_wndList . GetItemData ( pModify - > lItem ) ;
if ( lUserID = = pData - > lUserID )
{
long lIcon = 2 ;
if ( _tcscmp ( pData - > szSex , _T ( " <EFBFBD> <EFBFBD> " ) ) = = 0 )
lIcon = 0 ;
if ( _tcscmp ( pData - > szSex , _T ( " Ů " ) ) = = 0 )
lIcon = 1 ;
m_wndList . SetIconIndex ( pModify - > lItem , lIcon ) ;
m_wndList . SetItemText ( pModify - > lItem , 1 , pData - > szName ) ;
m_wndList . SetItemText ( pModify - > lItem , 2 , pData - > szNickName ) ;
m_wndList . SetItemText ( pModify - > lItem , 3 , pData - > szMobile ) ;
m_wndList . SetItemText ( pModify - > lItem , 4 , pData - > szTel ) ;
# ifdef MOBSET_OEM_YTLE
m_wndList . SetItemText ( pModify - > lItem , 5 , pData - > szFax ) ;
# else
COleDateTime t ( pData - > tBirthday ) ;
if ( t . GetStatus ( ) = = COleDateTime : : valid )
{
str . Format ( _T ( " %04d.%02d.%02d " ) , t . GetYear ( ) , t . GetMonth ( ) , t . GetDay ( ) ) ;
m_wndList . SetItemText ( pModify - > lItem , 5 , str ) ;
}
else
{
m_wndList . SetItemText ( pModify - > lItem , 5 , _T ( " " ) ) ;
}
# endif
m_wndList . SetItemText ( pModify - > lItem , 6 , pData - > szLTD ) ;
m_wndList . SetItemText ( pModify - > lItem , 7 , pData - > szJob ) ;
m_wndList . SetItemText ( pModify - > lItem , 8 , pData - > szEmail ) ;
# ifdef MOBSET_OEM_YTLE
COleDateTime t ( pData - > tBirthday ) ;
if ( t . GetStatus ( ) = = COleDateTime : : valid )
{
str . Format ( _T ( " %04d.%02d.%02d " ) , t . GetYear ( ) , t . GetMonth ( ) , t . GetDay ( ) ) ;
m_wndList . SetItemText ( pModify - > lItem , 9 , str ) ;
}
else
{
m_wndList . SetItemText ( pModify - > lItem , 9 , _T ( " " ) ) ;
}
m_wndList . SetItemText ( pModify - > lItem , 10 , pData - > szBZ ) ;
# endif
# ifdef SHOWBZ_VER
m_wndList . SetItemText ( pModify - > lItem , 9 , pData - > szBZ ) ;
# endif
}
//<2F> <> <EFBFBD> µ<EFBFBD> <C2B5> <EFBFBD> <EFBFBD> <EFBFBD> д<EFBFBD> 뱾<EFBFBD> <EBB1BE> <EFBFBD> <EFBFBD> <EFBFBD> ݿ<EFBFBD>
TCHAR szSelect [ 128 ] = { 0 } ;
_stprintf ( szSelect , _T ( " select * from gaddress where UserID=%d " ) , pData - > lUserID ) ;
BOOL b = m_AdoRS . Open ( szSelect ) ;
if ( b & & ! m_AdoRS . IsEOF ( ) )
{
m_AdoRS . PutCollect ( _T ( " GroupID " ) , pData - > szGroupID ) ;
m_AdoRS . PutCollect ( _T ( " Name " ) , pData - > szName ) ;
m_AdoRS . PutCollect ( _T ( " NickName " ) , pData - > szNickName ) ;
m_AdoRS . PutCollect ( _T ( " Sex " ) , pData - > szSex ) ;
m_AdoRS . PutCollect ( _T ( " Birthday " ) , pData - > tBirthday ) ;
m_AdoRS . PutCollect ( _T ( " LTD " ) , pData - > szLTD ) ;
m_AdoRS . PutCollect ( _T ( " Job " ) , pData - > szJob ) ;
m_AdoRS . PutCollect ( _T ( " Addr " ) , pData - > szAddr ) ;
m_AdoRS . PutCollect ( _T ( " Tel " ) , pData - > szTel ) ;
m_AdoRS . PutCollect ( _T ( " Fax " ) , pData - > szFax ) ;
m_AdoRS . PutCollect ( _T ( " Mobile " ) , pData - > szMobile ) ;
m_AdoRS . PutCollect ( _T ( " Email " ) , pData - > szEmail ) ;
m_AdoRS . PutCollect ( _T ( " QQ " ) , pData - > szQQ ) ;
m_AdoRS . PutCollect ( _T ( " BZ " ) , pData - > szBZ ) ;
m_AdoRS . Update ( ) ;
m_AdoRS . Close ( ) ;
}
}
return true ;
}
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD>
if ( pHead - > lFuncType = = SMSFUNC_GADDRESS22_ADD )
{
ANS_GAddress22_Add * pAdd = ( ANS_GAddress22_Add * ) pFrame ;
ANS_GAddress22_SeeData * pData = ( ANS_GAddress22_SeeData * ) ( pFrame + sizeof ( ANS_GAddress22_Add ) ) ;
if ( pAdd - > lCount = = 1 & & pData - > lUserID > 0 ) //<2F> <> <EFBFBD> <EFBFBD> 1ʱ<31> <CAB1> ʾ <EFBFBD> ijɹ<C4B3>
{
if ( ! m_bReBack )
{
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;<3B> ֻ<EFBFBD> ,100;<3B> 绰,80; <20> <> <EFBFBD> <EFBFBD> ,90;ְ<> <D6B0> ,80;Email,80;"));
m_wndList . InsertItem ( lCount , _itot ( lCount + 1 , Buf , 10 ) ) ; //<2F> <> <EFBFBD> <EFBFBD>
long lIcon = 2 ;
if ( _tcscmp ( pData - > szSex , _T ( " <EFBFBD> <EFBFBD> " ) ) = = 0 )
lIcon = 0 ;
if ( _tcscmp ( pData - > szSex , _T ( " Ů " ) ) = = 0 )
lIcon = 1 ;
m_wndList . SetIconIndex ( lCount , lIcon ) ;
m_wndList . SetItemData ( lCount , pData - > lUserID ) ;
m_wndList . SetItemText ( lCount , 1 , pData - > szName ) ;
m_wndList . SetItemText ( lCount , 2 , pData - > szNickName ) ;
m_wndList . SetItemText ( lCount , 3 , pData - > szMobile ) ;
m_wndList . SetItemText ( lCount , 4 , pData - > szTel ) ;
COleDateTime t ( pData - > 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 , pData - > szLTD ) ;
m_wndList . SetItemText ( lCount , 7 , pData - > szJob ) ;
m_wndList . SetItemText ( lCount , 8 , pData - > szEmail ) ;
# ifdef SHOWBZ_VER
m_wndList . SetItemText ( lCount , 9 , pData - > szBZ ) ;
# endif
}
//<2F> <> <EFBFBD> ӵ<EFBFBD> <D3B5> <EFBFBD> <EFBFBD> ݿ<EFBFBD> <DDBF> <EFBFBD>
BOOL b = m_AdoRS . Open ( _T ( " gaddress " ) , adCmdTable ) ;
if ( b )
{
m_AdoRS . AddNew ( ) ;
m_AdoRS . PutCollect ( _T ( " UserID " ) , pData - > lUserID ) ;
m_AdoRS . PutCollect ( _T ( " UserType " ) , pData - > szUserType ) ;
m_AdoRS . PutCollect ( _T ( " GroupID " ) , pData - > szGroupID ) ;
m_AdoRS . PutCollect ( _T ( " Name " ) , pData - > szName ) ;
m_AdoRS . PutCollect ( _T ( " NickName " ) , pData - > szNickName ) ;
m_AdoRS . PutCollect ( _T ( " Sex " ) , pData - > szSex ) ;
m_AdoRS . PutCollect ( _T ( " Birthday " ) , pData - > tBirthday ) ;
m_AdoRS . PutCollect ( _T ( " LTD " ) , pData - > szLTD ) ;
m_AdoRS . PutCollect ( _T ( " Job " ) , pData - > szJob ) ;
m_AdoRS . PutCollect ( _T ( " Addr " ) , pData - > szAddr ) ;
m_AdoRS . PutCollect ( _T ( " Tel " ) , pData - > szTel ) ;
m_AdoRS . PutCollect ( _T ( " Fax " ) , pData - > szFax ) ;
m_AdoRS . PutCollect ( _T ( " Mobile " ) , pData - > szMobile ) ;
m_AdoRS . PutCollect ( _T ( " Email " ) , pData - > szEmail ) ;
m_AdoRS . PutCollect ( _T ( " QQ " ) , pData - > szQQ ) ;
m_AdoRS . PutCollect ( _T ( " CreateTime " ) , pData - > tCreateTime ) ;
m_AdoRS . PutCollect ( _T ( " BZ " ) , pData - > szBZ ) ;
m_AdoRS . Update ( ) ;
}
m_AdoRS . Close ( ) ;
}
if ( m_bReBack )
{
m_lReBackIndex + + ;
m_DLGGetUser . SetProcess ( m_lReBackCount , m_lReBackIndex ) ;
ReBack_Next ( ) ;
}
if ( m_bInUser ) //<2F> ǵ<EFBFBD> <C7B5> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <D2AA> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,<2C> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB>
{
m_lInUserIndex + + ;
m_DLGGetUser . SetProcess ( m_lInUserCount , m_lInUserIndex ) ;
Inport_Next ( ) ;
}
return true ;
}
return false ;
}
void CFGAddress2 : : OnRclickGaddressList ( NMHDR * pNMHDR , LRESULT * pResult )
{
ShowRMenu ( ) ;
* pResult = 0 ;
}
2025-04-11 17:19:25 +08:00
void CFGAddress2 : : 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 ;
}
}
LRESULT CFGAddress2 : : On_List_DropBegin ( WPARAM wParam , LPARAM lParam )
{
//<2F> <> <EFBFBD> <EFBFBD> û<EFBFBD> з<EFBFBD> <D0B7> <EFBFBD> <CDB9> õ<EFBFBD> ַ<EFBFBD> <D6B7> <EFBFBD> <EFBFBD> Ȩ<EFBFBD> <C8A8>
if ( ! m_pMainFrame - > GetUserPurview ( PURVIEW_SENDG , 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 gaddress 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 ) ;
CUserDropTarget : : m_shWndTreeCtrl = NULL ;
CUserDropTarget : : m_lAddressType = - 1 ;
// Begin Drag operation
DROPEFFECT dropeffect = data . DoDragDrop ( ) ;
GlobalFree ( hData ) ;
return true ;
}
void CFGAddress2 : : Inport_Next ( )
{
USES_CONVERSION ;
if ( m_lInUserIndex > = m_lInUserCount ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
return ;
if ( isAddressFull ( ) ) //ͨѶ¼<D1B6> <C2BC> <EFBFBD> <EFBFBD>
{
m_DLGGetUser . SetProcess ( 1 , 1 ) ; //ֹͣ<CDA3> <D6B9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ
return ;
}
long lSize = sizeof ( REQ_GAddress22_Add ) + sizeof ( ANS_GAddress22_SeeData ) ;
BYTE * pAddSent = new BYTE [ lSize ] ; memset ( pAddSent , 0 , lSize ) ;
REQ_GAddress22_Add * pAdd = ( REQ_GAddress22_Add * ) pAddSent ; //ͷ
ANS_GAddress22_SeeData * pAddData = ( ANS_GAddress22_SeeData * ) ( pAddSent + sizeof ( REQ_GAddress22_Add ) ) ;
* pAddData = m_pInUser [ m_lInUserIndex ] ; //ȡ<> <C8A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
: : GetLocalTime ( & pAddData - > tCreateTime ) ;
_tcscpy ( pAddData - > szGroupID , m_szGroupID ) ;
pAddData - > lCorpID = m_pMainFrame - > m_lCorpID ;
pAddData - > szUserType [ 0 ] = ' 1 ' ; //<2F> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD>
pAdd - > lCount = 1 ;
m_pMainFrame - > SendFrame ( SMSFUNC_GADDRESS22_ADD , pAddSent , lSize ) ;
}
void CFGAddress2 : : 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> <EFBFBD> <EFBFBD> ͨѶ¼" ) ) ;
m_strGroupName = pLocal ;
for ( int i = 1 ; i < = lLen ; i + + )
{
_tcsncpy ( szGroup , pGroupID , i ) ;
_stprintf ( szSelect , _T ( " select Name from gaddress 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 ;
}
}
}
BOOL CFGAddress2 : : AddUser ( PAddress user )
{
if ( isAddressFull ( ) ) //ͨѶ¼<D1B6> <C2BC> <EFBFBD> <EFBFBD>
return false ;
long lSize = sizeof ( REQ_GAddress22_Add ) + sizeof ( ANS_GAddress22_SeeData ) ;
BYTE * pAddSent = new BYTE [ lSize ] ; memset ( pAddSent , 0 , lSize ) ;
REQ_GAddress22_Add * pAdd = ( REQ_GAddress22_Add * ) pAddSent ; //ͷ
ANS_GAddress22_SeeData * pAddData = ( ANS_GAddress22_SeeData * ) ( pAddSent + sizeof ( REQ_GAddress22_Add ) ) ;
pAddData - > lUserID = user . lUserID ;
_tcscpy ( pAddData - > szBZ , user . szBZ ) ;
_tcscpy ( pAddData - > szEmail , user . szEmail ) ;
_tcscpy ( pAddData - > szFax , user . szFax ) ;
_tcscpy ( pAddData - > szGroupID , user . szGroupID ) ;
_tcscpy ( pAddData - > szJob , user . szJob ) ;
_tcscpy ( pAddData - > szAddr , user . szAddress ) ;
_tcscpy ( pAddData - > szLTD , user . szLtd ) ;
_tcscpy ( pAddData - > szMobile , user . szMobile ) ;
_tcscpy ( pAddData - > szName , user . szName ) ;
_tcscpy ( pAddData - > szNickName , user . szNickName ) ;
_tcscpy ( pAddData - > szQQ , user . szQQ ) ;
_tcscpy ( pAddData - > szSex , user . szSex ) ;
_tcscpy ( pAddData - > szTel , user . szTel ) ;
_tcscpy ( pAddData - > szUserType , user . szUserType ) ;
pAddData - > tBirthday = user . tBirthday ;
: : GetLocalTime ( & pAddData - > tCreateTime ) ;
pAdd - > lCount = 1 ;
m_pMainFrame - > SendFrame ( SMSFUNC_GADDRESS22_ADD , pAddSent , lSize ) ;
return true ;
}
void CFGAddress2 : : OnKeydownGaddressList ( 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_AddAddr ( ) ;
}
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 = = ' L ' | | pLVKeyDow - > wVKey = = ' l ' )
{
On_User_Log ( ) ;
}
if ( pLVKeyDow - > wVKey = = ' A ' | | pLVKeyDow - > wVKey = = ' a ' )
{
m_wndList . SelectAllItems ( ) ;
}
//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 ( ) ;
}
}
void CFGAddress2 : : OnOK ( )
{
//CDialog::OnOK();
}
void CFGAddress2 : : OnCancel ( )
{
//CDialog::OnCancel();
}
void CFGAddress2 : : 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 gaddress where 1<>1 " ) ;
}
else
{
//<2F> <> ѯ<EFBFBD> <D1AF> <EFBFBD> <EFBFBD>
if ( _tcslen ( m_szGroupID ) > 0 )
strFind . Format ( _T ( " select * from gaddress where GroupID='%s' and ( 1<>1 " ) , m_szGroupID ) ;
else
strFind . Format ( _T ( " select * from gaddress 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 )
{
COleDateTime t ;
m_AdoRS . MoveFirst ( ) ;
for ( int i = 0 ; i < lCount ; i + + )
{
ANS_GAddress22_SeeData 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 ( " Addr " ) , user . szAddr ) ;
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 ( " CreateTime " ) , t ) ; t . GetAsSystemTime ( user . tCreateTime ) ;
m_AdoRS . GetCollect ( _T ( " BZ " ) , user . szBZ ) ;
m_AdoRS . MoveNext ( ) ;
if ( this - > m_pMainFrame - > GetUserPurview_HideNum ( ) )
{
user . szMobile [ 4 ] = ' * ' ;
user . szMobile [ 5 ] = ' * ' ;
user . szMobile [ 6 ] = ' * ' ;
user . szMobile [ 7 ] = ' * ' ;
//user.szMobile[8]='*';
}
//m_wndList.SetHeadings(_T("<22> <> <EFBFBD> <EFBFBD> ,50;<3B> <> ¼<EFBFBD> <C2BC> ,80; <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>
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_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
}
}
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 CFGAddress2 : : OnDestroy ( )
{
CDialog : : OnDestroy ( ) ;
if ( m_Copy_Data )
{
delete m_Copy_Data ;
m_Copy_Data = NULL ;
}
if ( m_pInUser )
{ delete m_pInUser ; m_pInUser = NULL ; } ;
}
BOOL CFGAddress2 : : isAddressFull ( BOOL bTip )
{
long lCount = 0 ;
CString str = _T ( " select count(*) as abc from gaddress " ) ;
if ( m_AdoRS . Open ( str ) & & m_AdoRS . GetRecordCount ( ) > 0 )
{
m_AdoRS . MoveFirst ( ) ;
m_AdoRS . GetCollect ( _T ( " abc " ) , lCount ) ;
m_AdoRS . Close ( ) ;
}
if ( lCount < m_pMainFrame - > GetMaxAddressCount ( ) )
return false ;
if ( bTip )
{
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> <EFBFBD> ṩ<EFBFBD> ̣<EFBFBD> " ) , _T ( " <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , MB_ICONWARNING ) ;
}
return true ;
}
ANS_GAddress22_SeeData CFGAddress2 : : GetUserData2 ( long lUserID )
{
ANS_GAddress22_SeeData Address = { 0 } ;
TCHAR szSelect [ 128 ] = { 0 } ;
_stprintf ( szSelect , _T ( " Select * from gaddress 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 ( " Job " ) , Address . szJob ) ;
m_AdoRS . GetCollect ( _T ( " Addr " ) , Address . szAddr ) ;
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 ) ;
}
return Address ;
}
void CFGAddress2 : : ReBack_Next ( )
{
USES_CONVERSION ;
if ( m_lReBackIndex > = m_lReBackCount ) //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
{
return ;
}
if ( m_BAdoRS . IsEOF ( ) )
{
return ;
}
if ( isAddressFull ( ) ) //ͨѶ¼<D1B6> <C2BC> <EFBFBD> <EFBFBD>
{
if ( m_DLGGetUser . IsWindowVisible ( ) )
m_DLGGetUser . SetProcess ( 1 , 1 ) ; //ֹͣ<CDA3> <D6B9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ
return ;
}
//ȡͨѸ¼<D1B8> <C2BC> <EFBFBD> <EFBFBD>
COleDateTime t ;
ANS_GAddress22_SeeData Address = { 0 } ;
m_BAdoRS . GetCollect ( _T ( " UserID " ) , Address . lUserID ) ;
m_BAdoRS . GetCollect ( _T ( " UserType " ) , Address . szUserType ) ;
m_BAdoRS . GetCollect ( _T ( " GroupID " ) , Address . szGroupID ) ;
m_BAdoRS . GetCollect ( _T ( " Name " ) , Address . szName ) ;
m_BAdoRS . GetCollect ( _T ( " NickName " ) , Address . szNickName ) ;
m_BAdoRS . GetCollect ( _T ( " Sex " ) , Address . szSex ) ;
m_BAdoRS . GetCollect ( _T ( " Birthday " ) , t ) ; t . GetAsSystemTime ( Address . tBirthday ) ;
m_BAdoRS . GetCollect ( _T ( " LTD " ) , Address . szLTD ) ;
m_BAdoRS . GetCollect ( _T ( " Job " ) , Address . szJob ) ;
m_BAdoRS . GetCollect ( _T ( " Addr " ) , Address . szAddr ) ;
m_BAdoRS . GetCollect ( _T ( " Tel " ) , Address . szTel ) ;
m_BAdoRS . GetCollect ( _T ( " Fax " ) , Address . szFax ) ;
m_BAdoRS . GetCollect ( _T ( " Email " ) , Address . szEmail ) ;
m_BAdoRS . GetCollect ( _T ( " Mobile " ) , Address . szMobile ) ;
m_BAdoRS . GetCollect ( _T ( " QQ " ) , Address . szQQ ) ;
m_BAdoRS . GetCollect ( _T ( " CreateTime " ) , t ) ; t . GetAsSystemTime ( Address . tCreateTime ) ;
m_BAdoRS . GetCollect ( _T ( " BZ " ) , Address . szBZ ) ;
if ( m_lReBackType = = 0 ) //<2F> ָ<EFBFBD> ͨѸ¼
{
if ( m_pMainFrame - > m_lMainGroupID > 0 & & m_pMainFrame - > m_strMainGroupID . GetLength ( ) > 0 )
{
TCHAR szTemp [ 32 ] = { 0 } ;
_stprintf ( szTemp , _T ( " %s%s " ) , m_pMainFrame - > m_strMainGroupID , Address . szGroupID ) ;
_tcscpy ( Address . szGroupID , szTemp ) ;
}
}
else
{
//<2F> ϴ<EFBFBD> ͨѸ¼
if ( Address . lUserID = = m_lSrcGroupID )
{
m_lReBackIndex + + ;
m_BAdoRS . MoveNext ( ) ;
ReBack_Next ( ) ;
return ;
}
//<2F> ı <EFBFBD> <C4B1> û<EFBFBD> <C3BB> <EFBFBD>
CString strTemp = Address . szGroupID ;
strTemp . Replace ( m_strSrcGroupID , m_strTagGroupID ) ;
_tcscpy ( Address . szGroupID , strTemp ) ;
}
if ( Address . szUserType [ 0 ] = = ' 0 ' )
{ //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD>
long lSize = sizeof ( REQ_GAddress2_Group_Add ) + sizeof ( ANS_GAddress2_Group_AddData ) ;
BYTE * pAddData = new BYTE [ lSize ] ; memset ( pAddData , 0 , lSize ) ;
REQ_GAddress2_Group_Add * pAdd = ( REQ_GAddress2_Group_Add * ) pAddData ; //ͷ
ANS_GAddress2_Group_AddData * pGAdd = ( ANS_GAddress2_Group_AddData * ) ( pAddData + sizeof ( REQ_GAddress2_Group_Add ) ) ;
pAdd - > bReBack = true ;
pAdd - > lCorpID = m_pMainFrame - > m_lCorpID ;
pAdd - > lCount = 1 ;
pGAdd - > lUserID = Address . lUserID ;
_tcscpy ( pGAdd - > szBZ , Address . szBZ ) ;
_tcscpy ( pGAdd - > szCreateUser , Address . szCreateUser ) ;
_tcscpy ( pGAdd - > szGroupID , Address . szGroupID ) ;
_tcscpy ( pGAdd - > szGroupName , Address . szName ) ;
pGAdd - > tCreateTime = Address . tCreateTime ;
pAdd - > lCorpID = m_pMainFrame - > m_lCorpID ;
pAdd - > lCount = 1 ;
m_pMainFrame - > SendFrame ( SMSFUNC_GADDRESS2_GROUP_ADD , pAddData , lSize ) ;
}
else
{
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD>
long lSize = sizeof ( REQ_GAddress22_Add ) + sizeof ( ANS_GAddress22_SeeData ) ;
BYTE * pAddSent = new BYTE [ lSize ] ; memset ( pAddSent , 0 , lSize ) ;
REQ_GAddress22_Add * pAdd = ( REQ_GAddress22_Add * ) pAddSent ; //ͷ
ANS_GAddress22_SeeData * pAddData = ( ANS_GAddress22_SeeData * ) ( pAddSent + sizeof ( REQ_GAddress22_Add ) ) ;
* pAddData = Address ; //ȡ<> <C8A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
pAdd - > lCount = 1 ;
pAdd - > bReBack = true ;
pAddData - > lCorpID = m_pMainFrame - > m_lCorpID ;
pAddData - > szUserType [ 0 ] = ' 1 ' ; //<2F> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD>
pAdd - > lCount = 1 ;
m_pMainFrame - > SendFrame ( SMSFUNC_GADDRESS22_ADD , pAddSent , lSize ) ;
}
m_BAdoRS . MoveNext ( ) ;
}
void CFGAddress2 : : On_User_UpLoad ( ANS_GAddress_Group_AddData GAdd )
{
if ( isAddressFull ( ) ) //ͨѶ¼<D1B6> <C2BC> <EFBFBD> <EFBFBD>
{
return ;
}
m_lSrcGroupID = GAdd . lUserID ;
m_strSrcGroupID = GAdd . szGroupID ;
m_bUpLoad = true ;
m_lReBackType = 1 ;
CString str ;
m_BAdoRS . SetAdoConnection ( & m_pMainFrame - > m_adoConnection ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
//<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͬ<EFBFBD> <CDAC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ,<2C> <> ʼ <EFBFBD> <CABC> <EFBFBD> ±<EFBFBD> <C2B1> <EFBFBD>
CString strName [ 100 ] ;
long lNameCount = 0 ;
str . Format ( _T ( " select * from gaddress where GroupID like '_' and UserType='0' and name like '%s%%' " ) , GAdd . szGroupName ) ;
if ( m_BAdoRS . Open ( str ) & & ! m_BAdoRS . IsEOF ( ) )
{
while ( ! m_BAdoRS . IsEOF ( ) )
{
m_BAdoRS . GetCollect ( _T ( " Name " ) , strName [ lNameCount ] ) ;
m_BAdoRS . MoveNext ( ) ;
lNameCount + + ;
}
}
if ( lNameCount > 0 ) //<2F> <> ͬ<EFBFBD> <CDAC> <EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> <C4BC> <EFBFBD> <EFBFBD> <EFBFBD> ʼ <EFBFBD> <CABC> <EFBFBD> ±<EFBFBD> <C2B1> <EFBFBD>
{
CString strTempName = GAdd . szGroupName ;
for ( int i = 1 ; i < 100 ; i + + )
{
_stprintf ( GAdd . szGroupName , _T ( " %s%d " ) , strTempName , i ) ;
for ( int j = 0 ; j < lNameCount ; j + + )
{
if ( CString ( GAdd . szGroupName ) = = strName [ j ] )
break ;
}
if ( j > = lNameCount )
break ;
}
}
long lCount = 0 ;
str . Format ( _T ( " select * from paddress where GroupID like '%s%%' order by GroupID,usertype " ) , m_strSrcGroupID ) ;
m_BAdoRS . Open ( str ) ;
m_lReBackCount = m_BAdoRS . GetRecordCount ( ) ;
m_lReBackIndex = 0 ;
str . Format ( _T ( " <EFBFBD> <EFBFBD> Ҫ<EFBFBD> ϴ<EFBFBD> <EFBFBD> <EFBFBD> ͨѸ¼<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> %d<> <64> <EFBFBD> <EFBFBD> ¼<EFBFBD> <C2BC> <EFBFBD> Ƿ<EFBFBD> <C7B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> " ) , m_lReBackCount - 1 ) ;
int iRet = MessageBox ( str , _T ( " ȷ<EFBFBD> <EFBFBD> " ) , MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2 ) ;
if ( iRet ! = IDYES )
return ;
m_pFuncView - > SelectMainGAddress2 ( ) ;
long lSize = sizeof ( REQ_GAddress2_Group_Add ) + sizeof ( ANS_GAddress2_Group_AddData ) ;
BYTE * pAddData = new BYTE [ lSize ] ; memset ( pAddData , 0 , lSize ) ;
REQ_GAddress2_Group_Add * pAdd = ( REQ_GAddress2_Group_Add * ) pAddData ; //ͷ
ANS_GAddress2_Group_AddData * pGAdd = ( ANS_GAddress2_Group_AddData * ) ( pAddData + sizeof ( REQ_GAddress2_Group_Add ) ) ;
_tcscpy ( pGAdd - > szBZ , GAdd . szBZ ) ;
_tcscpy ( pGAdd - > szGroupID , m_pMainFrame - > m_strMainGroupID ) ; //ֻ<> <D6BB> <EFBFBD> ϴ<EFBFBD> <CFB4> <EFBFBD> <EFBFBD> <EFBFBD> Ŀ¼
_tcscpy ( pGAdd - > szGroupName , GAdd . szGroupName ) ;
: : GetLocalTime ( & pGAdd - > tCreateTime ) ;
pAdd - > lCorpID = m_pMainFrame - > m_lCorpID ;
pAdd - > lCount = 1 ;
m_pMainFrame - > SendFrame ( SMSFUNC_GADDRESS2_GROUP_ADD , pAddData , lSize ) ;
return ;
}
void CFGAddress2 : : 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 CFGAddress2 : : 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 CFGAddress2 : : 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 = 0 ; //<2F> <> <EFBFBD> <EFBFBD> ͨѶ¼
pGetLog - > lKH_UserID = m_lCurUserID ;
m_pMainFrame - > SendFrame ( SMSFUNC_UBOX_GETLOG2 , ( BYTE * ) pGetLog , sizeof ( REQ_UBox_GetLog2 ) ) ;
}