protected void Button1_Click(object sender, EventArgs e)
    {
        YF.Mode.User user = new YF.Mode.User();
        user.Name     = this.name.Text;
        user.Rename   = this.rename.Text;
        user.Sex      = int.Parse(this.sex.Text);//转整型
        user.Email    = this.email.Text;
        user.Phone    = this.phone.Text;
        user.Address  = this.address.Text;
        user.Password = this.password.Text;

        if (YF.BLL.User.Search(this.name.Text) == false)
        {
            YF.JsHelper.AlertAndRedirect("该用户名已存在!", "wind.aspx");
        }
        else
        {
            if (YF.BLL.User.add(user) == true)//注册成功
            {
                YF.JsHelper.AlertAndRedirect("注册成功!", "login.aspx");
            }
            else//注册失败
            {
                YF.JsHelper.AlertAndRedirect("注册失败!", "wind.aspx");
            }
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string user_name = this.username.Text;
        string pass_word = this.password.Text;
        string str       = "index.aspx?id=";



        if (YF.BLL.User.Login(user_name, pass_word))
        {
            YF.Mode.User user = YF.BLL.User.getUserName(user_name);
            string       str2 = user.Id.ToString();
            str = str.Insert(14, str2);

            YF.JsHelper.AlertAndRedirect("登陆成功!", str);
        }
        else if (YF.BLL.User.LoginEmail(user_name, pass_word))
        {
            YF.Mode.User user = YF.BLL.User.getUserEmail(user_name);
            string       str2 = user.Id.ToString();
            str = str.Insert(14, str2);

            YF.JsHelper.AlertAndRedirect("登陆成功!", str);
        }
        else
        {
            YF.JsHelper.AlertAndRedirect("用户名不存在或密码错误,请重新输入", "login.aspx");
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string user_name = this.name.Text;
        string str       = "Upnumber.aspx?name=";

        YF.Mode.User user = YF.BLL.User.getUserName(user_name);
        string       str2 = user.Name;

        str = str.Insert(19, str2);

        YF.JsHelper.Redirect(str);
    }
Ejemplo n.º 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string       name = Request.QueryString["name"];
         YF.Mode.User user = YF.BLL.User.getUserName(name);
         this.name.Text = user.Name;
         string sex = "女";
         if (user.Sex == 1)
         {
             sex = "男";
         }
         this.sex.Text = sex;
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string       id   = Request.QueryString["id"];
         YF.Mode.User user = YF.BLL.User.getUser(int.Parse(id));
         this.name.Text     = user.Name;
         this.rename.Text   = user.Rename;
         this.sex.Text      = user.Sex.ToString();
         this.email.Text    = user.Email;
         this.phone.Text    = user.Phone;
         this.address.Text  = user.Address;
         this.password.Text = user.Password;
         this.HF.Value      = user.Id.ToString();
     }
 }
    protected void Button1_Click(object sender, EventArgs e)
    {
        YF.Mode.User user = new YF.Mode.User();
        user.Id       = int.Parse(this.HF.Value);
        user.Name     = this.name.Text;
        user.Rename   = this.rename.Text;
        user.Sex      = int.Parse(this.sex.Text);//转整型
        user.Email    = this.email.Text;
        user.Phone    = this.phone.Text;
        user.Address  = this.address.Text;
        user.Password = this.password.Text;

        if (YF.BLL.User.Update(user) == true)//修改成功
        {
            YF.JsHelper.AlertAndRedirect("修改成功!", "outUser.aspx");
        }
        else//注册失败
        {
            YF.JsHelper.AlertAndRedirect("修改失败!", "upUser.aspx");
        }
    }