使用soui开发的mbc,只支持windows版本
w1146869587
2022-01-24 0408576e9da10015ffa9da0079b8c985113ce4b3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
#include "StdAfx.h"
#include "MBUserNetDiskInfo.h"
 
 
CMBUserNetDiskInfo::CMBUserNetDiskInfo(void)
{
    RemoveAllCabinetObj();
}
 
 
CMBUserNetDiskInfo::~CMBUserNetDiskInfo(void)
{
    RemoveAllCabinetObj();
}
 
void  CMBUserNetDiskInfo::GetCabinetObjMap( CMBBaseCabinetObjMap  &mapCabinetInfo )
{
    mapCabinetInfo.clear();
    mapCabinetInfo = m_mapCabinetInfo;
}
 
void  CMBUserNetDiskInfo::GetCabinetObjVector( CMBBaseCabinetObjVector &vectorCabinetInfo )
{
    vectorCabinetInfo.clear();
    vectorCabinetInfo = m_vectorCabinetInfo;
}
 
 
bool CMBUserNetDiskInfo::AddCabinetObj(CMBBaseCabinetObj *pCabinetObj)
{
    if( NULL ==  pCabinetObj || pCabinetObj->m_strID.IsEmpty() )
        return false;
 
    CMBBaseCabinetObjMap::iterator    it;
    CString strID;
 
    strID = pCabinetObj->m_strID;
    it = m_mapCabinetInfo.find(strID);
 
    // Èç¹ûÕҵõ½ ·µ»Ø
    if( it != m_mapCabinetInfo.end() )
        return false;
 
    m_mapCabinetInfo[strID] = pCabinetObj; 
    m_vectorCabinetInfo.push_back(pCabinetObj);
    return true; 
}
 
CMBBaseCabinetObj* CMBUserNetDiskInfo::GetCabinetObj( CString strID )
{
    if( strID.IsEmpty() )
    {
        return NULL;
    }
 
    CMBBaseCabinetObjMap::iterator    it;
    CMBBaseCabinetObj *pCabinetObj = NULL;
 
    it = m_mapCabinetInfo.find(strID);
 
    if( it!= m_mapCabinetInfo.end() )
        pCabinetObj = it->second;
 
    return pCabinetObj; 
}
 
bool  CMBUserNetDiskInfo::RemoveAllCabinetObj()
{
    CMBBaseCabinetObjMap::iterator    it;
    CMBBaseCabinetObj *pCabinetObj = NULL;
 
    for( it = m_mapCabinetInfo.begin();it != m_mapCabinetInfo.end();it++ )
    {
        pCabinetObj = it->second;
        delete pCabinetObj;
        pCabinetObj = NULL;        
    }
    m_mapCabinetInfo.clear();
    m_vectorCabinetInfo.clear();
     
    return true;  
}
 
int    CMBUserNetDiskInfo::GetCount()
{
    return m_mapCabinetInfo.size();
}
 
// Óе¥Î»ÍøÅÌ
bool CMBUserNetDiskInfo::HasUnitWP()
{
    CMBBaseCabinetObjMap::iterator    it;
    CMBBaseCabinetObj *pCabinetObj = NULL;
 
    for( it = m_mapCabinetInfo.begin();it != m_mapCabinetInfo.end();it++ )
    {
        pCabinetObj = it->second;
 
        if( pCabinetObj->m_strIsUnit == _T("1") )
            return true;
    }
 
    return false;
}
 
// Óв¿ÃÅÍøÅÌ
bool  CMBUserNetDiskInfo::HasDepartWP()
{
    CMBBaseCabinetObjMap::iterator    it;
    CMBBaseCabinetObj *pCabinetObj = NULL;
 
    for( it = m_mapCabinetInfo.begin();it != m_mapCabinetInfo.end();it++ )
    {
        pCabinetObj = it->second;
 
        if( pCabinetObj->m_strIsUnit == _T("") )
            return true;
    }
 
    return false;
}
 
//
//bool CMBUserNetDiskInfo::ParseXml( CString &strXml,CString &strErrInfo )
//{
//    CString strSubCount;
//
//    if( strXml.IsEmpty() )
//    {
//        strErrInfo = _T("½âÎöµÄxmlΪ¿Õ£¡");
//        return true;
//    }
//    pugi::xml_document    xmlDoc;    
//    if (!xmlDoc.load(strXml))   
//    {  
//        return false;
//    }   
//    pugi::xml_node form = xmlDoc.child(_T("Body")).child(_T("ND"));
//    m_strNDState        = form.attribute(_T("State")).value();
//    m_strNDCapacity     = form.attribute(_T("Capacity")).value();
//    m_strNDUsed         = form.attribute(_T("Used")).value();
//    m_strNDFileCount    = form.attribute(_T("FileCount")).value();
//    m_strNDCanClean     = form.attribute(_T("CanClean")).value();
//
//    form                = xmlDoc.child(_T("Body"));
//    m_strHaveReqApply   = form.child_value(_T("HaveReqApply"));
//    m_strFuncData       = form.child_value(_T("FuncData"));
//    m_strHasFileTrans   = form.child_value(_T("HasFileTrans"));
//    m_strDisOriginFile  = form.child_value(_T("DisOriginFile"));
//
//    form                = xmlDoc.child(_T("Body")).child(_T("Cabinet")); 
//    for(pugi::xml_node node = form; node; node = node.next_sibling())
//    {
//        CMBBaseCabinetObj *pCabinetObj = new CMBBaseCabinetObj();
//        pCabinetObj->m_strID        = node.attribute(_T("ID")).value();
//        pCabinetObj->m_strStatus    = node.attribute(_T("Status")).value();
//        pCabinetObj->m_strOrder     = node.attribute(_T("Order")).value();
//        //pCabinetObj->m_strPType     = node.attribute(_T("PType")).value();
//        //pCabinetObj->m_strPID       = node.attribute(_T("PID")).value();
//        //pCabinetObj->m_strPName     = node.attribute(_T("PName")).value();
//        pCabinetObj->m_strCapacity  = node.attribute(_T("Capacity")).value();
//        //pCabinetObj->m_strUsed      = node.attribute(_T("Used")).value();
//        strSubCount                  = node.attribute(_T("SubCount")).value();
//        pCabinetObj->m_nSubCount    = _ttoi(strSubCount);
//        pCabinetObj->m_strBkColor   = node.attribute(_T("BkColor")).value();
//        pCabinetObj->m_strFileSFlag = node.attribute(_T("FileSFlag")).value();
//        //pCabinetObj->m_strDocState  = node.attribute(_T("DocState")).value();
//        pCabinetObj->m_strAdminLogin = node.attribute(_T("AdminLogin")).value();
//        pCabinetObj->m_strAdminName  = node.attribute(_T("AdminName")).value();
//        pCabinetObj->m_strArchiveAdmin = node.attribute(_T("ArchiveAdmin")).value();
//        pCabinetObj->m_strImgFontStyle = node.attribute(_T("ImgFontStyle")).value();
//        pCabinetObj->m_strHasAce       = node.attribute(_T("HasAce")).value();
//        pCabinetObj->m_strPermit       = node.attribute(_T("Permit")).value();
//        //pCabinetObj->m_strEnableDocMonitor = node.attribute(_T("EnableDocMonitor")).value();
//        //pCabinetObj->m_strFTR              = node.attribute(_T("FTR")).value(); 
//        pCabinetObj->m_strName             = node.child_value(_T("Name"));  
//        //pCabinetObj->m_strMemo             = node.child_value(_T("Memo")); 
//        pCabinetObj->m_strIsUnit           = node.attribute(_T("IsUnit")).value();
//        // Îĵµ¹ñÀàÐÍ
//        if( pCabinetObj->m_strIsUnit == _T("1") )
//        {
//            pCabinetObj->m_nType = CMBBaseCabinetObj::CABINET_UNIT;   // ±íʾµ¥Î»Îĵµ¹ñ
//        }else{
//            pCabinetObj->m_nType = CMBBaseCabinetObj::CABINET_DEPART; // ±íʾ²¿ÃÅÎĵµ¹ñ            
//        }
//
//        if( !AddCabinetObj(pCabinetObj) )
//        {
//            delete pCabinetObj;
//            pCabinetObj = NULL;
//        }
//    } 
//     
//    return true;
//}
 
bool CMBUserNetDiskInfo::ParseOOSXml( CString &strXml,CString &strErrInfo )
{
    /*    CString m_strOOSEnable;
    CString m_strOOSExtension;
    CString m_strOOSServer;
    CString m_strOOSRoot;*/
    if( strXml.IsEmpty() )
    { 
        return true;
    }
    pugi::xml_document    xmlDoc;    
    if (!xmlDoc.load(strXml))   
    {  
        return false;
    }   
    pugi::xml_node form = xmlDoc.child(_T("Body")).child(_T("oos"));
    m_strOOSEnable        = form.attribute(_T("Enable")).value();
    m_strOOSExtension     = form.attribute(_T("Extension")).value();
    m_strOOSServer        = form.attribute(_T("Server")).value();
    m_strOOSRoot          = form.attribute(_T("Root")).value();
     
 
    return true;
}