保健品销售网站 三层架构/WebUI/reg.aspx.cs

(完整代码) 1KB

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;
using Entity;
using Business;
using System.Globalization;
public partial class reg : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.txtUsername.Text = "";
            this.txtPassword.Text = "";
            this.txtRealname.Text = "";

            this.txtBirthday.Text = "";
            this.txtContact.Text = "";
            this.txtAddress.Text = "";

        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        UsersEntity users = new UsersEntity();
        users.Id = System.Guid.NewGuid().ToString();
        users.Username = this.txtUsername.Text;
        users.Password = this.txtPassword.Text;
        users.Realname = this.txtRealname.Text;
        if (RadioButton1.Checked)
        {
            users.Sex = RadioButton1.Text;

        }
        if (RadioButton2.Checked)
        {
            users.Sex = RadioButton2.Text;

        }
        users.Birthday = this.txtBirthday.Text;
        users.Contact = this.txtContact.Text;
        users.Address = this.txtAddress.Text;
        users.Regdate = DateTime.Now.ToString("yyyy-MM-dd", DateTimeFormatInfo.InvariantInfo);
        UsersBusiness usersBusiness = new UsersBusiness();
        usersBusiness.InsertUsers(users);

        Response.Write("<script>alert('注册成功');location.href='reg.aspx';</script>");

    }
}

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

AI 解读 AI

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

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