protected void ChkCanAuditNews()
{
//-------------------------------------------------------------------------------------------------------------------------------------------
//-----------------------------------------------------Should be true here, but i dont know why if does not work-----------------------------
//-------------------------------------------------------------------------------------------------------------------------------------------
NewsCatPermission Dic = new NewsCatPermission();
if (Dic.Dic[news.Category].ToString().Substring(0, 2).Equals("02") && CurrentUser.Permissions.Contains(LnWDynamic.Audit))
{
canAuditNews = true;
}
else if (!Dic.Dic[news.Category].ToString().Substring(0, 2).Equals("02") && CurrentUser.Permissions.Contains(ABM.Lib.Common.Permissions.NewsPublish.Audit))
{
canAuditNews = true;
}
}
ok, this is the classes,
1
using System;
2
using System.Collections;
3
using System.Collections.Generic;
4
using System.Text;
5![]()
6
namespace ABM.Lib.Common
7
{
8
public class AbmArrayList : ArrayList
9
{
10
public override bool Contains(object item)
11
{
12
return base.Contains(item);
13
}
14
public ArrayList GetKeys()
15
{
16
try
17
{
18
ArrayList list = new ArrayList();
19
foreach (AbmObject o in this)
20
{
21
if (!list.Contains(o.GetKey()))
22
{
23
list.Add(o.GetKey());
24
}
25
}
26
return list;
27
}
28
catch (Exception e)
29
{
30
return null;
31
}
32
}
33
public ArrayList GetValues()
34
{
35
try
36
{
37
ArrayList list = new ArrayList();
38
foreach (AbmObject o in this)
39
{
40
if (!list.Contains(o.GetValue()))
41
{
42
list.Add(o.GetValue());
43
}
44
}
45
return list;
46
}
47
catch (Exception e)
48
{
49
return null;
50
}
51
}
52![]()
53
public ArrayList GetKeysIn(ArrayList keys)
54
{
55
try
56
{
57
ArrayList list = new ArrayList();
58
ArrayList allKeys = GetKeys();
59
foreach (object o in keys)
60
{
61
if (!allKeys.Contains(o))
62
{
63
list.Add(o);
64
}
65
}
66
return list;
67
}
68
catch (Exception e)
69
{
70
return null;
71
}
72
}
73![]()
74
public ArrayList GetValuesIn(ArrayList values)
75
{
76
try
77
{
78
ArrayList list = new ArrayList();
79
ArrayList allValues = GetValues();
80
foreach (object o in allValues)
81
{
82
if (!allValues.Contains(o))
83
{
84
list.Add(o);
85
}
86
}
87![]()
88
return list;
89
}
90
catch (Exception d)
91
{
92
return null;
93
}
94
}
95![]()
96
public ArrayList GetItemsIn(ArrayList m_list)
97
{
98
try
99
{
100
ArrayList list = new ArrayList();
101
foreach (AbmObject o in m_list)
102
{
103
if (this.Contains(o))
104
{
105
list.Add(o);
106
}
107
}
108
return list;
109
}
110
catch (Exception e)
111
{
112
return null;
113
}
114
}
115
public ArrayList GetKeysByValue(object vl)
116
{
117
try
118
{
119
ArrayList list = new ArrayList();
120
foreach (AbmObject o in this)
121
{
122
if (o.GetValue().ToString().Equals(vl))
123
{
124
list.Add(o.GetKey());
125
}
126
}
127
return list;
128
}
129
catch (Exception e)
130
{
131
return null;
132
}
133![]()
134
}
135
public ArrayList GetValuesByKey(object key)
136
{
137
try
138
{
139
ArrayList list = new ArrayList();
140
foreach (AbmObject o in this)
141
{
142
if (o.GetKey().Equals(key))
143
{
144
list.Add(o.GetValue());
145
}
146
}
147
return list;
148
}
149
catch (Exception e)
150
{
151
return null;
152
}
153
}
154
}
155
156![]()
157
public class AbmObject
158
{
159
private object m_o1;
160
private object m_o2;
161![]()
162
public object GetValue()
163
{
164
return m_o2;
165
}
166
public object GetKey()
167
{
168
return m_o1;
169
}
170
public AbmObject(object o1, object o2)
171
{
172
m_o1 = o1;
173
m_o2 = o2;
174
}
175
}
176
}
177![]()
using System;2
using System.Collections;3
using System.Collections.Generic;4
using System.Text;5

6
namespace ABM.Lib.Common7
{8
public class AbmArrayList : ArrayList9
{10
public override bool Contains(object item)11
{12
return base.Contains(item);13
}14
public ArrayList GetKeys()15
{16
try17
{18
ArrayList list = new ArrayList();19
foreach (AbmObject o in this)20
{21
if (!list.Contains(o.GetKey()))22
{23
list.Add(o.GetKey());24
}25
}26
return list;27
}28
catch (Exception e)29
{30
return null;31
}32
}33
public ArrayList GetValues()34
{35
try36
{37
ArrayList list = new ArrayList();38
foreach (AbmObject o in this)39
{40
if (!list.Contains(o.GetValue()))41
{42
list.Add(o.GetValue());43
}44
}45
return list;46
}47
catch (Exception e)48
{ 49
return null;50
}51
}52

53
public ArrayList GetKeysIn(ArrayList keys)54
{55
try56
{57
ArrayList list = new ArrayList();58
ArrayList allKeys = GetKeys();59
foreach (object o in keys)60
{61
if (!allKeys.Contains(o))62
{63
list.Add(o);64
}65
}66
return list;67
}68
catch (Exception e)69
{70
return null;71
}72
}73

74
public ArrayList GetValuesIn(ArrayList values)75
{76
try77
{78
ArrayList list = new ArrayList();79
ArrayList allValues = GetValues();80
foreach (object o in allValues)81
{82
if (!allValues.Contains(o))83
{84
list.Add(o);85
}86
}87

88
return list;89
}90
catch (Exception d)91
{92
return null;93
}94
}95

96
public ArrayList GetItemsIn(ArrayList m_list)97
{98
try99
{100
ArrayList list = new ArrayList();101
foreach (AbmObject o in m_list)102
{103
if (this.Contains(o))104
{105
list.Add(o);106
}107
}108
return list;109
}110
catch (Exception e)111
{112
return null;113
}114
}115
public ArrayList GetKeysByValue(object vl)116
{117
try118
{119
ArrayList list = new ArrayList();120
foreach (AbmObject o in this)121
{122
if (o.GetValue().ToString().Equals(vl))123
{124
list.Add(o.GetKey());125
}126
}127
return list;128
}129
catch (Exception e)130
{131
return null;132
}133

134
}135
public ArrayList GetValuesByKey(object key)136
{137
try138
{139
ArrayList list = new ArrayList();140
foreach (AbmObject o in this)141
{142
if (o.GetKey().Equals(key)) 143
{144
list.Add(o.GetValue());145
}146
}147
return list;148
}149
catch (Exception e)150
{151
return null;152
}153
}154
}155
156

157
public class AbmObject158
{159
private object m_o1;160
private object m_o2;161

162
public object GetValue()163
{164
return m_o2;165
}166
public object GetKey()167
{168
return m_o1;169
}170
public AbmObject(object o1, object o2)171
{172
m_o1 = o1;173
m_o2 = o2;174
}175
}176
}177

and the method has errors.

浙公网安备 33010602011771号