CheckLogin.cs

using System;
2using System.Data;
3using System.Data.SqlClient;
4using System.Configuration;
5using System.Web;
6using System.Web.Security;
7using System.Web.UI;
8using System.Web.UI.WebControls;
9using System.Web.UI.WebControls.WebParts;
10using System.Web.UI.HtmlControls;
11
12/// <summary>
13/// CheckLogin 的摘要说明
14/// </summary>

15public 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}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值