ASP.NET用户信息管理系统(6)

来源:xiaoniu168.com 作者:本站原创 添加时间:2012-03-05 点击数:17502

计算机毕业设计介绍:

protected void Button1_Click(object sender, EventArgs e)
    {
        int _id =Convert.ToInt32( Request.QueryString["id"].ToString());
        string _name = nametext.Text;
        string _pwd = pwdtext.Text;
        string _isadmin = admintext.Text;
        Info user = new Info(_id,_name,_pwd,_isadmin);
        Dal work = new Dal();
        int result = work.Update(user);
        if (result != 0)
        {
            string js = "2.aspx?id=" + Request.QueryString["id"];
            Jscript.AlertAndRedirect("修改成功!", js);
        }
        else
        {
            Jscript.Alert("修改失败");
        }
    }
5.3.4 用户信息查询界面的实现

protected void Page_Load(object sender, EventArgs e)
    {
       
        UserLogin.LoginNo();
        if (!Page.IsPostBack)
        {
        Getinfo();
        Panel2.Visible = false;
        if (Request.QueryString["ac"]=="edit")
        {
            Panel2.Visible = true;
        }
        }
       

    }
    protected void Getinfo()
    {
        string urlid = Request.QueryString["id"];
        string urlac=Request.QueryString["ac"];
        if (urlid != string.Empty)
        {
            Info info = new Info();
            info.ID = Convert.ToInt32(urlid);
            Dal dal = new Dal();
            DataTable Dt = dal.Getinfo(info);
            if (urlac != "edit")
            {
                Panel1.Visible = true;
                Panel2.Visible = false;
                name.Text = Dt.Rows[0]["I_UserName"].ToString();
                pwd.Text = Dt.Rows[0]["I_Userpwd"].ToString();
                isadmin.Text = Dt.Rows[0]["I_IsAdmin"].ToString();
            }
            else if (urlac == "edit")
            {
                Panel2.Visible = true;
                Panel1.Visible = false;
                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

第7页为计算机毕业论文部分......

【联系方式】

【本站信誉】

用心做计算机毕业设计论文网