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

📄 checkempright.cs

📁 专业的办公oa代码下载 c#语言编写 三层结构
💻 CS
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Reflection;
using System.Security.Cryptography;
using System.Text;

namespace qminoa.DA
{
	public class CheckEmpRight
	{
		public CheckEmpRight()
		{

		}
		public int GetEmpRight(int EmpID,string FuncName)
		{   
			SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"].ToString());
			SqlCommand myCommand = new SqlCommand("sysGetEmpRight", myConnection);
			myCommand.CommandType = CommandType.StoredProcedure;
			SqlParameter parameterEmpID = new SqlParameter("@empid", SqlDbType.Int, 4);
			parameterEmpID.Value = EmpID;
			myCommand.Parameters.Add(parameterEmpID);
			
			SqlParameter parameterFuncName = new SqlParameter("@funcname", SqlDbType.VarChar, 50);
			parameterFuncName.Value = FuncName;
			myCommand.Parameters.Add(parameterFuncName);
			SqlParameter parameterEmpRight = new SqlParameter("@userright", SqlDbType.Int, 4);
			parameterEmpRight.Direction = ParameterDirection.Output;
			myCommand.Parameters.Add(parameterEmpRight);

			myConnection.Open();
			myCommand.ExecuteNonQuery();
			myConnection.Close();
			if ((parameterEmpRight.Value != null) && (parameterEmpRight.Value != System.DBNull.Value)) 
			{
				return Convert.ToInt16(parameterEmpRight.Value);
			}
			else 
			{
				return -1;
			}
		}

	}
}

⌨️ 快捷键说明

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