⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 roles.cs

📁 Time Tracker Starter Kit 使您能轻松创建这样一个应用程序
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using ASPNET.StarterKit.TimeTracker.DataAccessLayer;

namespace ASPNET.StarterKit.TimeTracker.BusinessLogicLayer
{
	//****************************************************************************
	//
	// Roles Class
	//
	// The Roles class represents a list of custom Time Tracker roles.
	//
	//****************************************************************************

	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[Web.Global.CfgKeyConnString], "TT_ListAllRoles");
			RolesCollection roleArray = new RolesCollection();

			// Separate Data into a collection of Roles
			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;
		}

	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -