温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:Asp.net物资流通管理系统源码
当前文件:
WuZiLiuTongGuanLi/App_Code/CheckLogin.cs[2K,2009-6-12 11:58:46],打开代码结构图
WuZiLiuTongGuanLi/App_Code/CheckLogin.cs[2K,2009-6-12 11:58:46],打开代码结构图1using System; 2
using System.Data; 3
using System.Data.SqlClient; 4
using System.Configuration; 5
using System.Web; 6
using System.Web.Security; 7
using System.Web.UI; 8
using System.Web.UI.WebControls; 9
using System.Web.UI.WebControls.WebParts; 10
using System.Web.UI.HtmlControls; 11
12
/// <summary> 13
/// CheckLogin 的摘要说明 14
/// </summary> 15
public class CheckLogin 16
{ 17
public CheckLogin() 18
{ 19
// 20
// TODO: 在此处添加构造函数逻辑 21
// 22
} 23
public int GiveID(string UserName, string PassWord) 24
{ 25
SqlDataBase ThisB = new SqlDataBase(); 26
string CheckSql = "select count(*) from UserList where UserName = '" + UserName + "' and PassWord = '" + PassWord + "'"; 27
int ThisNum = Convert.ToInt32(ThisB.ReturnSQL(CheckSql)); 28
if (ThisNum > 0) 29
{ 30
string SqlType = "select * from UserList where UserName = '" + UserName + "' and PassWord = '" + PassWord + "'"; 31
SqlDataReader ThRead = ThisB.GRead(SqlType); 32
while (ThRead.Read()) 33
{ 34
return Convert.ToInt32(ThRead["ID"]); 35
} 36
} 37
return 0; 38
} 39
public static bool CheckAdmin(int UserID) 40
{ 41
SqlDataBase MyDb = new SqlDataBase(); 42
string Log = Convert.ToString(MyDb.ReturnSQL("select UserType from UserList Where ID = '" + UserID + "'")); 43
if (Log == "1") 44
{ 45
return true; 46
} 47
else 48
{ 49
return false; 50
} 51
} 52
public static int GiveCheckAd(int UserID) 53
{ 54
SqlDataBase MyDb = new SqlDataBase(); 55
int Log = Convert.ToInt32(MyDb.ReturnSQL("select GoodsType from UserList Where ID = '" + UserID + "'")); 56
return Log; 57
} 58
public static DataTable GiveMsgGod(int UserID) //返回对应仓库的数量超限产品 59
{ 60
SqlDataBase MyDb = new SqlDataBase(); 61
int Log = Convert.ToInt32(MyDb.ReturnSQL("select Controls from UserList Where ID = '" + UserID + "'")); 62
string SqlString = ""; 63
if (Log == 0) 64
{ 65
SqlString = "select * from View_GoodMsg"; 66
} 67
else 68
{ 69
SqlString = "select * from View_GoodMsg where ID = '"+Log+"'"; 70
} 71
return MyDb.DT(SqlString); 72
} 73
public static bool CheckKeepAdmin(int UserID) 74
{ 75
SqlDataBase MyDb = new SqlDataBase(); 76
string Log = Convert.ToString(MyDb.ReturnSQL("select GoodsType from UserList Where ID = '" + UserID + "'")); 77
if (Log == "0") 78
{ 79
return true; 80
} 81
else 82
{ 83
return false; 84
} 85
} 86
} 87









