📄 checklogin.cs
字号:
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
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;
/// <summary>
/// CheckLogin 的摘要说明
/// </summary>
public class CheckLogin
{
public CheckLogin()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public int GiveID(string UserName, string PassWord)
{
SqlDataBase ThisB = new SqlDataBase();
string CheckSql = "select count(*) from UserList where UserName = '" + UserName + "' and PassWord = '" + PassWord + "'";
int ThisNum = Convert.ToInt32(ThisB.ReturnSQL(CheckSql));
if (ThisNum > 0)
{
string SqlType = "select * from UserList where UserName = '" + UserName + "' and PassWord = '" + PassWord + "'";
SqlDataReader ThRead = ThisB.GRead(SqlType);
while (ThRead.Read())
{
return Convert.ToInt32(ThRead["ID"]);
}
}
return 0;
}
public static bool CheckAdmin(int UserID)
{
SqlDataBase MyDb = new SqlDataBase();
string Log = Convert.ToString(MyDb.ReturnSQL("select UserType from UserList Where ID = '" + UserID + "'"));
if (Log == "1")
{
return true;
}
else
{
return false;
}
}
public static int GiveCheckAd(int UserID)
{
SqlDataBase MyDb = new SqlDataBase();
int Log = Convert.ToInt32(MyDb.ReturnSQL("select GoodsType from UserList Where ID = '" + UserID + "'"));
return Log;
}
public static DataTable GiveMsgGod(int UserID) //返回对应仓库的数量超限产品
{
SqlDataBase MyDb = new SqlDataBase();
int Log = Convert.ToInt32(MyDb.ReturnSQL("select Controls from UserList Where ID = '" + UserID + "'"));
string SqlString = "";
if (Log == 0)
{
SqlString = "select * from View_GoodMsg";
}
else
{
SqlString = "select * from View_GoodMsg where ID = '"+Log+"'";
}
return MyDb.DT(SqlString);
}
public static bool CheckKeepAdmin(int UserID)
{
SqlDataBase MyDb = new SqlDataBase();
string Log = Convert.ToString(MyDb.ReturnSQL("select GoodsType from UserList Where ID = '" + UserID + "'"));
if (Log == "0")
{
return true;
}
else
{
return false;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -