コード例 #1
0
ファイル: PwdProtect.aspx.cs プロジェクト: uwitec/ds568
    private void Button1_Click(object sender, EventArgs e)
    {
        try
        {
            string passsafe_question = Request.Form["passsafe_question"].Trim();
            string otherQuestion     = Request.Form["otherQuestion"].Trim();
            string answer            = Request.Form["answer"].Trim();
            string answer2           = Request.Form["answer2"].Trim();
            if (string.IsNullOrEmpty(passsafe_question))
            {
                Common.MessageBox.Show(this, "请选择密保问题", Common.MessageBox.InfoType.warning, "history.back");
                return;
            }
            else if (passsafe_question.Equals("7"))
            {
                if (string.IsNullOrEmpty(otherQuestion))
                {
                    Common.MessageBox.Show(this, "请输入其他密保问题", Common.MessageBox.InfoType.warning, "history.back");
                    return;
                }
                else
                {
                    passsafe_question = otherQuestion;
                }
            }
            if (string.IsNullOrEmpty(answer))
            {
                Common.MessageBox.Show(this, "请输入问题答案", Common.MessageBox.InfoType.warning, "history.back");
                return;
            }
            if (string.IsNullOrEmpty(answer2))
            {
                Common.MessageBox.Show(this, "请输入确认问题答案", Common.MessageBox.InfoType.warning, "history.back");
                return;
            }

            var ud = Session["UserData"] as UserData;
            var bl = new DS_SafeQuestion_Br();
            var md = bl.CreateModel();
            md.MemberID  = ud.Member.ID;
            md.Question1 = passsafe_question;
            md.Answer1   = answer;
            bl.InsertOrUpdate(md);

            Common.MessageBox.Show(this, "保存成功", Common.MessageBox.InfoType.info, "function(){location='PwdProtect.aspx'}");
        }
        catch (Exception ex) {
            Common.WriteLog.SetErrLog(Request.Url.ToString(), "Button1_Click", ex.Message);
            Common.MessageBox.Show(this, "保存出错", Common.MessageBox.InfoType.error, "history.back");
        }
    }
コード例 #2
0
ファイル: PwdProtect.aspx.cs プロジェクト: uwitec/ds568
    private void Button1_Click(object sender, EventArgs e) {
        try
        {
            string passsafe_question = Request.Form["passsafe_question"].Trim();
            string otherQuestion = Request.Form["otherQuestion"].Trim();
            string answer = Request.Form["answer"].Trim();
            string answer2 = Request.Form["answer2"].Trim();
            if (string.IsNullOrEmpty(passsafe_question)) {
                Common.MessageBox.Show(this, "请选择密保问题", Common.MessageBox.InfoType.warning, "history.back");
                return;
            }
            else if (passsafe_question.Equals("7")) {
                if (string.IsNullOrEmpty(otherQuestion))
                {
                    Common.MessageBox.Show(this, "请输入其他密保问题", Common.MessageBox.InfoType.warning, "history.back");
                    return;
                }
                else
                    passsafe_question = otherQuestion;
            }
            if (string.IsNullOrEmpty(answer)) {
                Common.MessageBox.Show(this, "请输入问题答案", Common.MessageBox.InfoType.warning, "history.back");
                return;
            }
            if (string.IsNullOrEmpty(answer2))
            {
                Common.MessageBox.Show(this, "请输入确认问题答案", Common.MessageBox.InfoType.warning, "history.back");
                return;
            }

            var ud = Session["UserData"] as UserData;
            var bl = new DS_SafeQuestion_Br();
            var md = bl.CreateModel();
            md.MemberID = ud.Member.ID;
            md.Question1 = passsafe_question;
            md.Answer1 = answer;
            bl.InsertOrUpdate(md);

            Common.MessageBox.Show(this, "保存成功", Common.MessageBox.InfoType.info, "function(){location='PwdProtect.aspx'}");
            
        }
        catch (Exception ex) {
            Common.WriteLog.SetErrLog(Request.Url.ToString(), "Button1_Click", ex.Message);
            Common.MessageBox.Show(this, "保存出错", Common.MessageBox.InfoType.error, "history.back");
        }
    }