Web/reg.aspx.cs

(完整代码) 1KB

using PR.Common;
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class reg : System.Web.UI.Page
{
    PR.BLL.users bll = new PR.BLL.users();
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    /// <summary>
    /// 添加按钮事件
    /// </summary>
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        //验证代码
        try
        {
            if (bll.Exists(txt_lname.Text))
            {
                Msg.Show("该用户名已存在!");
                return;
            }

            PR.Model.users model = new PR.Model.users();
            model.email = txt_email.Text;
            model.lname = txt_lname.Text;
            model.power = radLst_power.SelectedValue;
            model.pwd = txt_pwd.Text;
            model.qq = txt_qq.Text;
            model.sex = radLst_sex.SelectedValue;
            model.tel = txt_tel.Text;
            model.uname = txt_uname.Text;
            if (bll.Insert(model))
            {
                Msg.ShowAndRedirect("注册成功!", "login.aspx");
            }
            else
            {
                Msg.Show("注册失败!");
            }
        }
        catch (Exception exp)
        {
            Msg.Show("注册失败!原因:" + exp.Message);
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。