username@email.com
2025-05-14 99ddfbcecf0fa2881eb3a91028257eef87dab6de
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CY.BLL;
using CY.Model;
using CY.Infrastructure.Query;
using CY.Infrastructure;
using CY.Infrastructure.DESEncrypt;
using CY.Infrastructure.Common;
using CY.BLL.Sys;
using CY.Config;
 
namespace CY.WebForm.Pages.member
{
    //吴辉
    //邮箱验证
    public partial class SetEmail : BasePage
    {
        EC_MemberBasicBLL bll_EC_MemberBasicBLL = null;
 
        //初始化
        public SetEmail()
        {
            bll_EC_MemberBasicBLL = new EC_MemberBasicBLL();
        }
 
        //页面加载
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                EC_SafeValidation m_EC_SafeValidation = bll_EC_MemberBasicBLL.GetSafeValidationByMemberId(CurrentUser.MemberId);
                if (m_EC_SafeValidation != null)
                {
                    if (m_EC_SafeValidation.MailValidated)
                        JavaScript.RefreshDIVOpener(this);
 
                    this.VerifyEmail.Value = m_EC_SafeValidation.Email;
                    this.VerifyEmail.Attributes.Add("editemail", m_EC_SafeValidation.Email);
                }
            }
        }
 
        //提交事件
        protected void btn_submit_form(object sender, EventArgs e)
        {
            try
            {
                EC_SafeValidation m_EC_SafeValidation = bll_EC_MemberBasicBLL.GetSafeValidationByMemberId(CurrentUser.MemberId);
                if (m_EC_SafeValidation != null)
                {
                    string VerifyCode = Session["VerifyCode"].ToString2();
                    string VerifyNumber = Session["VerifyNumber"].ToString2();
 
                    string TrueCode = Request["MobileValiNum"].ToString2();
                    string TrueNumeber = Request["VerifyMobileNum"].ToString2();
 
                    if (string.IsNullOrEmpty(TrueCode) || string.IsNullOrEmpty(TrueNumeber))
                        JavaScript.MessageBox("验证失败:0", this);
                    else if (VerifyCode != TrueCode || VerifyNumber != TrueNumeber)
                        JavaScript.MessageBox("验证失败:1", this);
                    else
                    {
                        m_EC_SafeValidation.Email = TrueNumeber;
                        m_EC_SafeValidation.MailValidated = true;
                        m_EC_SafeValidation.Operator = CurrentUser.ShortName;
                        m_EC_SafeValidation.LastUpdateTime = DateTime.Now;
                        if (bll_EC_MemberBasicBLL.UpdateModelEC_SafeValidation(m_EC_SafeValidation))
                            //JavaScript.MessageBox("验证成功", this);
                            JavaScript.RefreshDIVOpener(this);
                        else
                            JavaScript.MessageBox("验证失败:2", this);
                    }
                }else
                    JavaScript.MessageBox("验证失败:3", this);
            }
            catch (Exception ex)
            {
                PAGEHandleException(ex);
                JavaScript.MessageBox("验证失败:4", this);
            }
        }
    }
}