using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using xabaraCOM;

public partial class member_user_reg : System.Web.UI.Page
{
    admin a = new admin();
    webPublic wp = new webPublic();
    xabara x = new xabara();

    public string webName = "";

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            advertisement ad = new advertisement();
            ad950.Text = ad.read("", 950, 90, 1, false, true, "");

            webName = xml.read("xabara.config", "webName", 180);

            regExpression reg = new regExpression();
            uIDRegularExpressionValidator.ValidationExpression = reg.useridCN(2, 20);
            uIDRegularExpressionValidator.ErrorMessage = reg.useridCNError(2, 20);
            PWRegularExpressionValidator.ValidationExpression = reg.passWord(6, 20);
            PWRegularExpressionValidator.ErrorMessage = reg.passWordError(6, 20);
            textNameRegularExpressionValidator.ValidationExpression = reg.chinese;
            textNameRegularExpressionValidator.ErrorMessage = reg.chineseError;
            emailRegularExpressionValidator.ValidationExpression = reg.email;
            emailRegularExpressionValidator.ErrorMessage = reg.emailError;
            rndNumRegularExpressionValidator.ValidationExpression = reg.rndNums(6, 20);
            rndNumRegularExpressionValidator.ErrorMessage = reg.rndNumsError(6, 20);
            mobileRegularExpressionValidator.ValidationExpression = reg.mobile;
            mobileRegularExpressionValidator.ErrorMessage = reg.mobileError;
        }

        uPW.Attributes.Add("value", uPW.Text);
        uPWTwo.Attributes.Add("value", uPWTwo.Text);

        Page.Title = "新会员注册　" + webName + xml.read("xabara.config", "titleMeta", 180);
    }

    protected void regBottom_Click(object sender, ImageClickEventArgs e)
    {
        if (x.checkValidateCode(true, RndNum.Text.Trim()))
        {
            wp.regUser("user^" + uID.Text, email.Text, mobile.Text, uPW.Text, txtName.Text);
        }
    }
}