?? 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 + -