using System;
using System.Data;
using System.Data.SqlClient;
using Microsoft.ApplicationBlocks.Data;

namespace SK.MemberDAL
{
	/// <summary>
	/// Right 的摘要说明。
	/// </summary>
	public class Right
	{
		/// <summary>
		/// 权限管理
		/// </summary>
		public Right()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
		}
		/// <summary>
		/// 所有权限列表
		/// </summary>
		/// <returns></returns>
		public DataSet List()
		{
			return SqlHelper.ExecuteDataset(Data.ConnString,CommandType.Text,"select * from [Right]");
		}
		public DataSet List(object ProductTypeID)
		{
			SqlParameter[] oParms =new SqlParameter[1];
			oParms[0] = new SqlParameter("@ProductTypeID",ProductTypeID);

			return SqlHelper.ExecuteDataset(Data.ConnString,CommandType.Text,"select * from [Right] where ProductTypeID=@ProductTypeID",oParms);
		}
		/// <summary>
		/// 指定的权限信息
		/// </summary>
		/// <param name="RightID"></param>
		/// <returns></returns>
		public DataRow Info(object RightID)
		{
			SqlParameter[] oParms =new SqlParameter[1];
			oParms[0] = new SqlParameter("@RightID",RightID);

			return SqlHelper.ExecuteDataset(Data.ConnString,CommandType.Text,"select * from [Right] where RightID=@RightID",oParms).Tables[0].Rows[0];
		}
		
	}
}
