温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:多功能在线考试系统改进版源码
当前文件:
OnLineExamUpdate/App_Code/BusinessLogicLayer/Role.cs,打开代码结构图
OnLineExamUpdate/App_Code/BusinessLogicLayer/Role.cs,打开代码结构图1using System; 2
using System.Data; 3
using System.Collections; 4
using System.Data.SqlClient; 5
using OnLineExam.DataAccessLayer; 6
using OnLineExam.DataAccessHelper; 7
8
namespace OnLineExam.BusinessLogicLayer 9
...{ 10
/**//// <summary> 11
/// Role 的摘要说明。 12
/// </summary> 13
public class Role 14
...{ 15
私有成员#region 私有成员 16
17
private int _roleId; //角色(职务)ID 18
private string _roleName; //角色(职务)名 19
private int _HasDuty_DepartmentManage; 20
private int _HasDuty_UserManage; 21
private int _HasDuty_RoleManage; 22
private int _HasDuty_Role; 23
private int _HasDuty_CourseManage; 24
private int _HasDuty_PaperSetup; 25
private int _HasDuty_PaperLists; 26
private int _HasDuty_UserPaperList; 27
private int _HasDuty_UserScore; 28
private int _HasDuty_SingleSelectManage; 29
private int _HasDuty_MultiSelectManage; 30
private int _HasDuty_FillBlankManage; 31
private int _HasDuty_JudgeManage; 32
private int _HasDuty_QuestionManage; 33
private bool _exist; //是否存在标志 34
35
#endregion 私有成员 36
37
属性#region 属性 38
39
public int RoleId 40
...{ 41
set 42
...{ 43
this._roleId = value; 44
} 45
get 46
...{ 47
return this._roleId; 48
} 49
} 50
public string RoleName 51
...{ 52
set 53
...{ 54
this._roleName = value; 55
} 56
get 57
...{ 58
return this._roleName; 59
} 60
} 61
public int HasDuty_DepartmentManage 62
...{ 63
set 64
...{ 65
this._HasDuty_DepartmentManage = value; 66
} 67
get 68
...{ 69
return this._HasDuty_DepartmentManage; 70
} 71
} 72
public int HasDuty_UserManage 73
...{ 74
set 75
...{ 76
this._HasDuty_UserManage = value; 77
} 78
get 79
...{ 80
return this._HasDuty_UserManage; 81
} 82
} 83
public int HasDuty_RoleManage 84
...{ 85
set 86
...{ 87
this._HasDuty_RoleManage = value; 88
} 89
get 90
...{ 91
return this._HasDuty_RoleManage; 92
} 93
} 94
public int HasDuty_Role 95
...{ 96
set 97
...{ 98
this._HasDuty_Role = value; 99
} 100
get 101
...{ 102
return this._HasDuty_Role; 103
} 104
} 105
public int HasDuty_UserScore 106
...{ 107
set 108
...{ 109
this._HasDuty_UserScore = value; 110
} 111
get 112
...{ 113
return this._HasDuty_UserScore; 114
} 115
} 116
public int HasDuty_CourseManage 117
...{ 118
set 119
...{ 120
this._HasDuty_CourseManage = value; 121
} 122
get 123
...{ 124
return this._HasDuty_CourseManage; 125
} 126
} 127
public int HasDuty_PaperSetup 128
...{ 129
set 130
...{ 131
this._HasDuty_PaperSetup = value; 132
} 133
get 134
...{ 135
return this._HasDuty_PaperSetup; 136
} 137
} 138
public int HasDuty_PaperLists 139
...{ 140
set 141
...{ 142
this._HasDuty_PaperLists = value; 143
} 144
get 145
...{ 146
return this._HasDuty_PaperLists; 147
} 148
} 149
public int HasDuty_UserPaperList 150
...{ 151
set 152
...{ 153
this._HasDuty_UserPaperList = value; 154
} 155
get 156
...{ 157
return this._HasDuty_UserPaperList; 158
} 159
} 160
public int HasDuty_SingleSelectManage 161
...{ 162
set 163
...{ 164
this._HasDuty_SingleSelectManage = value; 165
} 166
get 167
...{ 168
return this._HasDuty_SingleSelectManage; 169
} 170
} 171
public int HasDuty_MultiSelectManage 172
...{ 173
set 174
...{ 175
this._HasDuty_MultiSelectManage = value; 176
} 177
get 178
...{ 179
return this._HasDuty_MultiSelectManage; 180
} 181
} 182
public int HasDuty_FillBlankManage 183
...{ 184
set 185
...{ 186
this._HasDuty_FillBlankManage = value; 187
} 188
get 189
...{ 190
return this._HasDuty_FillBlankManage; 191
} 192
} 193
public int HasDuty_JudgeManage 194
...{ 195
set 196
...{ 197
this._HasDuty_JudgeManage = value; 198
} 199
get 200
...{ 201
return this._HasDuty_JudgeManage; 202
} 203
} 204
public int HasDuty_QuestionManage 205
...{ 206
set 207
...{ 208
this._HasDuty_QuestionManage = value; 209
} 210
get 211
...{ 212
return this._HasDuty_QuestionManage; 213
} 214
} 215
216
public bool Exist 217
...{ 218
get 219
...{ 220
return this._exist; 221
} 222
} 223
224
#endregion 属性 225
226
方法#region 方法 227
228
/**//// <summary> 229
/// 根据参数roleId,获取角色(职务)详细信息 230
/// </summary> 231
/// <param name="topicID">角色(职务)ID</param> 232
public void LoadData(int roleId) 233
...{ 234
DataBase db = new DataBase(); //实例化一个Database类 235
236
string sql = ""; 237
sql = "Select * from [Role] where RoleId = " + roleId; 238
239
DataRow dr = db.GetDataRow(sql); //利用Database类的GetDataRow方法查询数据 240
241
//根据查询得到的数据,对成员赋值 242
if (dr != null) 243
...{ 244
this._roleId = GetSafeData.ValidateDataRow_N(dr, "RoleId"); 245
this._roleName = GetSafeData.ValidateDataRow_S(dr, "RoleName"); 246
247
this._exist = true; 248
} 249
else 250
...{ 251
this._exist = false; 252
} 253
} 254
public bool CheckRole(string XRoleName) 255
...{ 256
SqlParameter[] Params = new SqlParameter[1]; 257
DataBase DB = new DataBase(); 258
259
Params[0] = DB.MakeInParam("@RoleName", SqlDbType.VarChar, 20, XRoleName); 260
261
SqlDataReader DR = DB.RunProcGetReader("Proc_RoleDetail", Params); 262
if (!DR.Read()) 263
...{ 264
return false; 265
} 266
else 267
...{ 268
return true; 269
} 270
}




