📄 checkempright.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 + -