SystemManage/UserAdd.aspx.cs
(完整代码) 1KBusing System;
using System.Web.UI;
public partial class SystemManage_UserAdd : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Request.Cookies["roleid"] != null)
{
Authority myauthority = new Authority();
int RoleID = Convert.ToInt16(Server.HtmlEncode(Request.Cookies["roleid"].Value));
int ModuleID = 3;
if (myauthority.QXExists(RoleID, ModuleID))
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(SystemManage_UserAdd));
if (!IsPostBack)
{
this.txtusername.Text = "";
this.txtpassword.Text = "";
this.txtName.Text = "";
this.txtphone.Text = "";
}
}
else
{
MessageBox.ShowAndRedirect(this.Page, "对不起!您无权操作此版块。", "../Main.aspx");
}
}
else
{
MessageBox.ShowAndRedirect(this.Page, "对不起!您还没有登录系统。", "../Logout.aspx");
}
}
[AjaxPro.AjaxMethod]
public int Verify(string UserName)
{
User myuser = new User();
if (UserName == "")
return 1;
else if (myuser.Exists(UserName))
return 0;
else
return -1;
}
protected void butAdd_Click(object sender, ImageClickEventArgs e)
{
User myuser = new User();
myuser.UserName = this.txtusername.Text;
myuser.Password = this.txtpassword.Text;
myuser.Name = this.txtName.Text;
myuser.Telephone = this.txtphone.Text;
myuser.RoleID = Convert.ToInt16(this.droplist_role.SelectedValue);
myuser.ClassID = Convert.ToInt16(this.droplist_class.SelectedValue);
myuser.Add();
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "a", "window.onload=function(){close();W.AA();}", true);
}
}
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读 AI
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
