计算机毕业设计介绍:
5.3.2 用户添加界面的实现
protected void Button1_Click(object sender, EventArgs e)
{
string _name= username.Text;
string _pwd = userpwd.Text;
string _isadmin = isadmin.Text;
if ((_name == string.Empty) || (_pwd == string.Empty) || (_isadmin == string.Empty))
{
Jscript.Alert("请确定不为空!");
}
else
{
Info info = new Info(username.Text,userpwd.Text,isadmin.Text);
Dal dal = new Dal();
int result= dal.Insert(info);
if (result > 0)
{
Jscript.AlertAndRedirect("添加成功!","View.aspx");
}
else
{
Jscript.Alert("失败;");
}
}
}
5.3.3 用户信息修改界面的实现
protected void Page_Load(object sender, EventArgs e)
{
if(!Page.IsPostBack)
{
Get();
}
}
protected void Get()
{
string urlid = Request.QueryString["id"];
if(urlid!=string.Empty)
{
Info info = new Info();
info.ID = Convert.ToInt32(urlid);
Dal dal = new Dal();
DataTable Dt = dal.Getinfo(info);
nametext.Text = Dt.Rows[0]["I_UserName"].ToString();
pwdtext.Text = Dt.Rows[0]["I_Userpwd"].ToString();
admintext.Text = Dt.Rows[0]["I_IsAdmin"].ToString();
}
}
〖资料来源:计算机毕业论文 www.xiaoniu168.com〗
第6页为计算机毕业论文部分......