Files
g.hnyhua.cn/Mtxfw.shop/Member_editPhone.aspx.cs

70 lines
3.0 KiB
C#
Raw Permalink Normal View History

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("<script language='javascript'>alert('手机号码格式填写不正确只能输入11位数字')</script>");
}
else
{
if (model.IFEditPhone == 0 || model.IFEditPhone == 2)
{
if (daoUser.IsExistsmobile(Card, txtmobile2.Text.Trim()))
{
Response.Write("<script language='javascript'>alert('新手机号码已经被其他用户占用了,请换其它手机号码再试!')</script>");
}
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("不能提交空值!");
}
}
}