Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     WebData.CurrentMenu = "修改密码";
     if (!IsPostBack)
     {
         string s_yhzh = Session[WebData.登录用户].AsString();
         if (!string.IsNullOrEmpty(s_yhzh))
         {
             DataTable table = new bll.LoginBLL().GetYhxxByYhzh(s_yhzh);
             if (table.Count() > 0)
             {
                 yhzh.Text = table.Rows[0]["yhzh"].AsString();
                 yhxm.Text = table.Rows[0]["yhxm"].AsString();
                 yhjs.Text = table.Rows[0]["yhjs"].AsString();
             }
             else
             {
                 Response.Write("<script>alert('用户信息不存在!');window.location.href='Yhxx.aspx';</script>");
             }
         }
     }
 }
Ejemplo n.º 2
0
        protected void login_Click(object sender, EventArgs e)
        {
            if (!Page.IsValid)
            {
                return;
            }

            string s_yhzh = name.Text;
            string s_pwd  = pwd.Text;

            DataTable table = new bll.LoginBLL().LoginSys(s_yhzh, s_pwd);

            if (table.Count() > 0)
            {
                Session[WebData.登录用户]   = s_yhzh;
                Session[WebData.登录用户名]  = table.Rows[0]["yhxm"].AsString();
                Session[WebData.登录用户类别] = table.Rows[0]["yhjs"].AsString();
                Response.Write("<script>alert('登录成功!');window.location.href='Default.aspx';</script>");
            }
            else
            {
                Response.Write("<script>alert('用户密码失败!');</script>");
            }
        }