asp.net index

using NavigationPlatformWeb.util;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace runzemall.BackManagement
{
public partial class index : System.Web.UI.Page
{
Maticsoft.BLL.UserInfo user_bll = new Maticsoft.BLL.UserInfo();
protected void Page_Load(object sender, EventArgs e)
{

    }

    protected void RadButton1_Click(object sender, EventArgs e)
    {
        Label1.Text = "";
        Label2.Text = "";
        Label3.Text = "";
        if (RadTextBox1.Text == "")
        {
            Label1.Text = "请输入账户";
            return;
        }
        if (RadTextBox2.Text == "")
        {
            Label2.Text = "请输入密码";
            return;
        }
        if (RadTextBox3.Text == "")
        {
            Label3.Text = "请输入验证码 ";
            return;
        }
        if (user_bll.GetRecordCount(" UserName= '" + RadTextBox1.Text + "' ") == 0)
        {
            Label1.Text = "账号不存在";
            return;
        }
        if (user_bll.GetRecordCount(" UserName= '" + RadTextBox1.Text + "' and Password='" + RadTextBox2.Text + "' ") == 0)
        {
            Label2.Text = "密码不存在";
            return;
        }
        if (Session["CheckCode"].ToString().ToLower() != RadTextBox3.Text.ToLower())
        {
            Label3.Text = "验证码不存在";
            return;
        }

        DataSet ds = user_bll.GetList(" UserName='" + RadTextBox1.Text + "' ");
        if (ds.Tables[0].Rows[0]["UserIdentity"].ToString() != "管理员")
        {
            Label1.Text = "您没有权限";
            return;
        }
        UsersInfo.UserID = ds.Tables[0].Rows[0]["UserID"].ToString();
        UsersInfo.UserName = ds.Tables[0].Rows[0]["UserName"].ToString();
        UsersInfo.UserRole = ds.Tables[0].Rows[0]["UserId"].ToString();
        Response.Redirect("/BackManagement/first.aspx");
    

    }

    protected void RadTextBox3_TextChanged(object sender, EventArgs e)
    {

    }

    
}

}

猜你喜欢

转载自blog.csdn.net/qq_39593196/article/details/86443595