protected void Page_Load(object sender, EventArgs e) { MidWareManage midWare = new MidWareManage("UserInfo"); GridView1.DataSource = midWare.gettable(midWare); DataBind(); }
protected void ImgBtn_Click(object sender, ImageClickEventArgs e) { MidWareManage midWare = new MidWareManage("UserInfo", new List <string> { "user_id", "user_pwd" }, new List <string> { UserID.Text.Trim(), Password.Text.Trim() }, 1); if (UserID.Text != "" && Password.Text != "" && midWare.checkdele(midWare)) { if (midWare.getType(midWare)) { Response.Redirect("~/CtrlForm.aspx"); } else { Response.Write("<script>alert('当前用户权限不足!');</script>"); } } else { Response.Write("<script>alert('用户名或密码错误!');</script>"); } }
protected void ResignBtn_Click(object sender, System.Web.UI.ImageClickEventArgs e) { MidWareManage midWare = new MidWareManage("UserInfo", Idname.Text, Psw2.Text); if (Psw1 != null && _keys) { if (midWare.checkrepectuser(midWare)) { if (midWare.addfield(midWare)) { MessageBox.Show("注册成功!即将转至登录界面...."); Response.Redirect("~/LoginPage.aspx"); } else { Response.Write("<script>alert('注册失败.');</script>"); } } else { Response.Write("<script>alert('用户名已被占用.');</script>"); } } }