📄 login.aspx.cs
字号:
//文件名:Login.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class System_Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Login1_LoggedIn(object sender, EventArgs e)
{
Session["MyUserName"] = this.Login1.UserName;
System.Text.StringBuilder MyForbidString = new System.Text.StringBuilder();
MyForbidString.Append("禁止操作权限:A1A2A3B1B2B3C1C2D1D2D3D4D5D6D7D8D9D10E1E2");
string MyConnectionString = ConfigurationManager.ConnectionStrings["MyBooksDBConnectionString"].ConnectionString; ;
string MySQL = "Select * From 操作用户 Where 用户名称='" + this.Login1.UserName + "'";
SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnectionString);
DataTable MyTable = new DataTable();
MyAdapter.Fill(MyTable);
if (MyTable.Rows.Count > 0)
{
if ((int)MyTable.Rows[0]["图书管理之图书类别设置"] == 1)
{
MyForbidString.Replace("A1", "是");
}
if ((int)MyTable.Rows[0]["图书管理之出版公司设置"] == 1)
{
MyForbidString.Replace("A2", "是");
}
if ((int)MyTable.Rows[0]["图书管理之馆藏图书管理"] == 1)
{
MyForbidString.Replace("A3", "是");
}
if ((int)MyTable.Rows[0]["读者管理之会员级别设置"] == 1)
{
MyForbidString.Replace("B1", "是");
}
if ((int)MyTable.Rows[0]["读者管理之读者办证管理"] == 1)
{
MyForbidString.Replace("B2", "是");
}
if ((int)MyTable.Rows[0]["读者管理之读者挂失管理"] == 1)
{
MyForbidString.Replace("B3", "是");
}
if ((int)MyTable.Rows[0]["借阅管理之图书出借管理"] == 1)
{
MyForbidString.Replace("C1", "是");
}
if ((int)MyTable.Rows[0]["借阅管理之图书归还管理"] == 1)
{
MyForbidString.Replace("C2", "是");
}
if ((int)MyTable.Rows[0]["查询管理之查询馆藏图书"] == 1)
{
MyForbidString.Replace("D1", "是");
}
if ((int)MyTable.Rows[0]["查询管理之查询在借图书"] == 1)
{
MyForbidString.Replace("D2", "是");
}
if ((int)MyTable.Rows[0]["查询管理之查询在馆图书"] == 1)
{
MyForbidString.Replace("D3", "是");
}
if ((int)MyTable.Rows[0]["查询管理之查询挂失图书"] == 1)
{
MyForbidString.Replace("D4", "是");
}
if ((int)MyTable.Rows[0]["查询管理之查询办证读者"] == 1)
{
MyForbidString.Replace("D5", "是");
}
if ((int)MyTable.Rows[0]["查询管理之查询挂失读者"] == 1)
{
MyForbidString.Replace("D6", "是");
}
if ((int)MyTable.Rows[0]["查询管理之查询超期图书"] == 1)
{
MyForbidString.Replace("D7", "是");
}
if ((int)MyTable.Rows[0]["查询管理之查询超期读者"] == 1)
{
MyForbidString.Replace("D8", "是");
}
if ((int)MyTable.Rows[0]["查询管理之查询读者借史"] == 1)
{
MyForbidString.Replace("D9", "是");
}
if ((int)MyTable.Rows[0]["查询管理之查询图书借史"] == 1)
{
MyForbidString.Replace("D10", "是");
}
if ((int)MyTable.Rows[0]["系统管理之分配用户权限"] == 1)
{
MyForbidString.Replace("E1", "是");
}
if ((int)MyTable.Rows[0]["系统管理之公司信息设置"] == 1)
{
MyForbidString.Replace("E2", "是");
}
Session["MyForbid"] = MyForbidString;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -