Roles.cs
上传用户:autodoor
上传日期:2022-08-04
资源大小:9973k
文件大小:1k
- using System;
- using System.Data;
- using System.Configuration;
- using qminoa.DA;
- namespace qminoa.BLL.PM
- {
- public class Roles
- {
- private string _name;
- private int _roleID;
- public string Name
- {
- get {return _name;}
- set {_name = value;}
- }
- public int RoleID
- {
- get {return _roleID;}
- set {_roleID = value;}
- }
- public static RolesCollection GetRoles()
- {
- DataSet ds = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings["ConnectionString"], "PM_ListAllRoles");
- RolesCollection roleArray = new RolesCollection();
- foreach(DataRow r in ds.Tables[0].Rows)
- {
- Roles role = new Roles();
- role.RoleID = Convert.ToInt32(r["RoleID"]);
- role.Name = r["Name"].ToString();
-
- roleArray.Add(role);
- }
- return roleArray;
- }
- }
- }