using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace Mtxfw.shop { public partial class Member_editPhone : Mtxfw.Utility.MemberBase { public Mtxfw.DAL.user_info daoUser = new Mtxfw.DAL.user_info(); public Mtxfw.Utility.Config config = new Mtxfw.Utility.Config(); protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!IsPostBack) { Page.Title = "修改手机号码 - " + config.webName; Mtxfw.Model.user_info model = daoUser.GetModel(Card); if (model != null) { txtmobile.Text = model.Phone; } } Btn_Update.Click += Update_Password; } protected void Update_Password(object s, EventArgs ex) { Mtxfw.Model.user_info model = daoUser.GetModel(Card); if (!String.IsNullOrEmpty(txtmobile2.Text)) { if (txtmobile2.Text != model.Phone) { if (!System.Text.RegularExpressions.Regex.IsMatch(txtmobile2.Text.Trim(), @"^[1]+[3,4,5,8]+\d{9}")) { Response.Write(""); } else { if (model.IFEditPhone == 0 || model.IFEditPhone == 2) { if (daoUser.IsExistsmobile(Card, txtmobile2.Text.Trim())) { Response.Write(""); } else { /* daoUser.UpdateuLevel("IFPhone",1,Card); daoUser.UpdateuLevel("PhoneCount", 0, Card); daoUser.UpdatePassword("Phone", txtmobile2.Text.Trim(), Card); Mtxfw.Utility.Tools.Message("提交修改成功,请继续验证您的手机号码!", "/Member_Phonevalidation.aspx");*/ daoUser.UpdatePassword("EditPhone", txtmobile2.Text.Trim(), Card); daoUser.UpdateuLevel("IFEditPhone", 1, Card); Mtxfw.Utility.Tools.Message("提交修改成功,请等待管理员验证!", "/Member_editPhone.aspx"); } } else Mtxfw.Utility.Tools.Message("请不要重复提交!"); } } else Mtxfw.Utility.Tools.Message("新手机号码不能跟旧手机号码相同哦!"); } else Mtxfw.Utility.Tools.Message("不能提交空值!"); } } }