📄 usermrg.aspx.cs
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class Admin_Frameset_BasicMrg_UserMrg : System.Web.UI.Page
{
string strTemp = "";
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
strTemp = Request.QueryString["test"].ToString().Trim();
if (strTemp.Trim().Equals("add"))
{
this.Title = "用户信息添加";
this.lbltite.Text = "添加用户信息";
this.btnmgs.Text = "保 存";
}else
{
this.Title = "用户信息修改";
this.lbltite.Text = "修改用户信息";
this.btnmgs.Text = "修 改";
Users user = new Users();
user.Id = Convert.ToInt32(strTemp.ToString());
if (user.LoadData())
{
this.tbLoginid.Text = user.LoginId;
this.tbusername.Text = user.Username;
this.tbpassword.Text = user.Pwd;
this.tbemail.Text = user.Email;
this.tbtestpwd.Text = user.Pwd;
}
}
}
}
protected void btnmgs_Click(object sender, EventArgs e)
{
Users user = new Users();
strTemp = Request.QueryString["test"].ToString().Trim();
if (strTemp.Trim().Equals("add"))
{
user.LoginId =this.tbLoginid.Text.ToString();
user.Username = this.tbusername.Text.ToString();
user.Pwd = this.tbpassword.Text.ToString();
user.Email = this.tbemail.Text.ToString();
Boolean flag = user.AddUsers();
if (flag)
{
this.Label1.Text = "保存成功!";
this.btnmgs.Enabled = false;
}
else
{
this.Label1.Text = "出现异常错误";
this.btnmgs.Enabled = false;
}
}
else
{
user.Id = Convert.ToInt32(strTemp.ToString());
user.LoginId = this.tbLoginid.Text.ToString();
user.Username = this.tbusername.Text.ToString();
user.Pwd = this.tbpassword.Text.ToString();
user.Email = this.tbemail.Text.ToString();
Boolean flag = user.ModUsers();
if (flag)
{
this.Label1.Text = "修改成功!";
this.btnmgs.Enabled = false;
}
else
{
this.Label1.Text = "出现异常错误!";
this.btnmgs.Enabled = false;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -