#include "StdAfx.h"
|
#include "MBDownloadAsyncTask.h"
|
|
|
CMBDownloadAsyncTask::CMBDownloadAsyncTask(void)
|
{
|
m_nPort = 0;
|
m_pTransMgr = NULL;
|
}
|
|
|
CMBDownloadAsyncTask::~CMBDownloadAsyncTask(void)
|
{
|
}
|
|
void CMBDownloadAsyncTask::GetDocInfo(CMBDownFileInfo *pDownFileInfo)
|
{
|
CString strErrInfo;
|
CString strXmlList;
|
CMBNetDiskWebCMgr threadNetDiskWebCMgr;
|
|
threadNetDiskWebCMgr.SetServerInfo( m_strServerIP,m_nPort);
|
threadNetDiskWebCMgr.SetUserInfo( m_strUserLogin,m_strUserName);
|
threadNetDiskWebCMgr.SetUserSessionID(m_strUserSession);
|
|
if(pDownFileInfo == NULL )
|
return ;
|
if( pDownFileInfo->IsGetDocInfo() )
|
return ;
|
|
|
if( pDownFileInfo->m_nType == CMBDownFileInfo::DOWNFILE_UNITORDEPART )
|
{
|
if(!threadNetDiskWebCMgr.DMSGetDocInfo(pDownFileInfo->m_strID,strXmlList,strErrInfo))
|
{
|
pDownFileInfo->SetIsGetDocInfo();
|
return ;
|
}
|
}
|
else if( pDownFileInfo->m_nType == CMBDownFileInfo::DOWNFILE_PSN )
|
{
|
if(!threadNetDiskWebCMgr.NDGetDocInfo(pDownFileInfo->m_strID,strXmlList,strErrInfo))
|
{
|
pDownFileInfo->SetIsGetDocInfo();
|
return ;
|
}
|
}
|
|
|
if(!pDownFileInfo->ParseXML(strXmlList,strErrInfo))
|
{
|
pDownFileInfo->SetIsGetDocInfo();
|
return ;
|
}
|
pDownFileInfo->SetIsGetDocInfo();
|
}
|
|
void CMBDownloadAsyncTask::GetDocList( CMBDownDirInfo *pDownDirInfo )
|
{
|
CString strListXML;
|
CString strErrInfo;
|
CMBNetDiskWebCMgr threadNetDiskWebCMgr;
|
|
threadNetDiskWebCMgr.SetServerInfo( m_strServerIP,m_nPort);
|
threadNetDiskWebCMgr.SetUserInfo( m_strUserLogin,m_strUserName);
|
threadNetDiskWebCMgr.SetUserSessionID(m_strUserSession);
|
|
if( pDownDirInfo->m_nType == CMBDownDirInfo::DOWNDIR_UNITORDEPART )
|
{
|
if(!threadNetDiskWebCMgr.DMSGetDocList(pDownDirInfo->m_strCabinetID, pDownDirInfo->m_strID,strListXML,strErrInfo, true))
|
{
|
pDownDirInfo->SetIsGetDocList();
|
return ;
|
}
|
}
|
else if( pDownDirInfo->m_nType == CMBDownDirInfo::DOWNDIR_PSN )
|
{
|
if(!threadNetDiskWebCMgr.NDGetDocList( pDownDirInfo->m_strID,strListXML,strErrInfo, true))
|
{
|
pDownDirInfo->SetIsGetDocList();
|
return ;
|
}
|
}
|
|
pDownDirInfo->m_strGetDocListRetXml = strListXML;
|
pDownDirInfo->SetIsGetDocList();
|
}
|
|
void CMBDownloadAsyncTask::SetServerInfo( CString strServerIP,int nPort,CString strUserLogin,CString strUserName,CString strUserSession )
|
{
|
m_strServerIP = strServerIP;
|
m_nPort = nPort;
|
m_strUserLogin = strUserLogin;
|
m_strUserName = strUserName;
|
m_strUserSession = strUserSession;
|
}
|
|
void CMBDownloadAsyncTask::SetTransMgr( CMBTransMgr *pTransMgr )
|
{
|
m_pTransMgr = pTransMgr;
|
}
|