Example #1
0
        public string AccountReport()
        {
            Message       msg       = new Message();
            AjaxJsonValid ajaxJson  = new AjaxJsonValid();
            int           inputItem = 0;                                              //输入项数

            string reportEmail   = GameRequest.GetFormString("reportEmail");          //申诉邮箱
            string account       = GameRequest.GetFormString("txtUser");              //申诉帐号
            string regDate       = GameRequest.GetFormString("regDate");              //注册日期
            string realName      = GameRequest.GetFormString("realName");             //真实姓名
            string idCard        = GameRequest.GetFormString("idCard");               //身份证号
            string mobile        = GameRequest.GetFormString("mobile");               //手机号码
            string nicknameOne   = GameRequest.GetFormString("nicknameOne");          //历史昵称1
            string nicknameTwo   = GameRequest.GetFormString("nicknameTwo");          //历史昵称2
            string nicknameThree = GameRequest.GetFormString("nicknameThree");        //历史昵称3
            string passwordOne   = GameRequest.GetFormString("passwordOne");          //历史密码1
            string passwordTwo   = GameRequest.GetFormString("passwordTwo");          //历史密码2
            string passwordThree = GameRequest.GetFormString("passwordThree");        //历史密码3
            string questionOne   = GameRequest.GetFormString("questionOne");          //密保问题1
            string answerOne     = GameRequest.GetFormString("answerOne");            //密保答案1
            string questionTwo   = GameRequest.GetFormString("questionTwo");          //密保问题2
            string answerTwo     = GameRequest.GetFormString("answerTwo");            //密保答案2
            string questionThree = GameRequest.GetFormString("questionThree");        //密保问题3
            string answerThree   = GameRequest.GetFormString("answerThree");          //密保答案3
            string suppInfo      = GameRequest.GetFormString("suppInfo");             //补充资料

            #region 参数验证
            //验证申诉邮箱
            msg = InputDataValidate.CheckingEmail(reportEmail);
            if (!msg.Success)
            {
                ajaxJson.msg = "申诉结果接受邮箱输入有误";
                return(ajaxJson.SerializeToJson());
            }

            //验证申诉帐号
            msg = InputDataValidate.CheckingUserNameFormat(account);
            if (!msg.Success)
            {
                ajaxJson.msg = "申诉帐号输入有误";
                return(ajaxJson.SerializeToJson());
            }

            //验证注册日期
            if (!string.IsNullOrEmpty(regDate))
            {
                if (!Utils.Validate.IsShortDate(regDate))
                {
                    ajaxJson.msg = "注册日期输入有误";
                    return(ajaxJson.SerializeToJson());
                }
                inputItem++;
            }

            //验证真实姓名
            if (!string.IsNullOrEmpty(realName))
            {
                msg = InputDataValidate.CheckingRealNameFormat(realName, true);
                if (!msg.Success)
                {
                    ajaxJson.msg = "真实姓名输入有误";
                    return(ajaxJson.SerializeToJson());
                }
                inputItem++;
            }

            //验证身份证号
            if (!string.IsNullOrEmpty(idCard))
            {
                msg = InputDataValidate.CheckingIDCardFormat(idCard, true);
                if (!msg.Success)
                {
                    ajaxJson.msg = "身份证号输入有误";
                    return(ajaxJson.SerializeToJson());
                }
                inputItem++;
            }

            //验证移动电话
            if (!string.IsNullOrEmpty(mobile))
            {
                msg = InputDataValidate.CheckingMobilePhoneNumFormat(mobile, true);
                if (!msg.Success)
                {
                    ajaxJson.msg = "移动电话输入有误";
                    return(ajaxJson.SerializeToJson());
                }
                inputItem++;
            }

            //验证历史昵称
            if (!string.IsNullOrEmpty(nicknameOne))
            {
                msg = InputDataValidate.CheckingNickNameFormat(nicknameOne);
                if (!msg.Success)
                {
                    ajaxJson.msg = "历史昵称1输入有误";
                    return(ajaxJson.SerializeToJson());
                }
                inputItem++;
            }
            if (!string.IsNullOrEmpty(nicknameTwo))
            {
                msg = InputDataValidate.CheckingNickNameFormat(nicknameTwo);
                if (!msg.Success)
                {
                    ajaxJson.msg = "历史昵称2输入有误";
                    return(ajaxJson.SerializeToJson());
                }
                if (nicknameTwo == nicknameOne)
                {
                    ajaxJson.msg = "历史昵称不能相同";
                    return(ajaxJson.SerializeToJson());
                }
                inputItem++;
            }
            if (!string.IsNullOrEmpty(nicknameThree))
            {
                msg = InputDataValidate.CheckingNickNameFormat(nicknameThree);
                if (!msg.Success)
                {
                    ajaxJson.msg = "历史昵称3输入有误";
                    return(ajaxJson.SerializeToJson());
                }
                if (nicknameThree == nicknameOne || nicknameThree == nicknameTwo)
                {
                    ajaxJson.msg = "历史昵称不能相同";
                    return(ajaxJson.SerializeToJson());
                }
                inputItem++;
            }

            //验证密码
            if (!string.IsNullOrEmpty(passwordOne))
            {
                inputItem++;
            }
            if (!string.IsNullOrEmpty(passwordTwo))
            {
                if (passwordTwo == passwordOne)
                {
                    ajaxJson.msg = "历史密码不能相同";
                    return(ajaxJson.SerializeToJson());
                }
                inputItem++;
            }
            if (!string.IsNullOrEmpty(passwordThree))
            {
                if (passwordThree == passwordTwo || passwordThree == passwordOne)
                {
                    ajaxJson.msg = "历史密码不能相同";
                    return(ajaxJson.SerializeToJson());
                }
                inputItem++;
            }

            //验证密保
            if (questionOne != "0")
            {
                msg = InputDataValidate.CheckingProtectAnswer(answerOne, 1, false);
                if (!msg.Success)
                {
                    ajaxJson.msg = msg.Content;
                    return(ajaxJson.SerializeToJson());
                }
                inputItem++;
            }
            if (questionTwo != "0")
            {
                if (questionOne == questionTwo)
                {
                    ajaxJson.msg = "密保问题不能相同";
                    return(ajaxJson.SerializeToJson());
                }
                msg = InputDataValidate.CheckingProtectAnswer(answerOne, 2, false);
                if (!msg.Success)
                {
                    ajaxJson.msg = msg.Content;
                    return(ajaxJson.SerializeToJson());
                }
                inputItem++;
            }
            if (questionThree != "0")
            {
                if (questionThree == questionOne || questionThree == questionTwo)
                {
                    ajaxJson.msg = "密保问题不能相同";
                    return(ajaxJson.SerializeToJson());
                }
                msg = InputDataValidate.CheckingProtectAnswer(answerOne, 3, false);
                if (!msg.Success)
                {
                    ajaxJson.msg = msg.Content;
                    return(ajaxJson.SerializeToJson());
                }
                inputItem++;
            }

            //验证补充资料
            msg = InputDataValidate.CheckingProtectAnswer(suppInfo, true);
            if (!msg.Success)
            {
                ajaxJson.msg = "补全资料太长,最长不能超过200个字符";
                return(ajaxJson.SerializeToJson());
            }

            //申诉项数验证
            if (inputItem < 4)
            {
                ajaxJson.msg = "为了保证您的申诉请求审核通过,请输入至少4项资料,不包括补充资料";
                return(ajaxJson.SerializeToJson());
            }
            #endregion

            //检测帐号
            Message userMsg = FacadeManage.aideAccountsFacade.GetUserGlobalInfo(0, 0, account);
            if (!userMsg.Success)
            {
                ajaxJson.msg = "您所申诉的帐号不存在";
                return(ajaxJson.SerializeToJson());
            }
            UserInfo userInfo = userMsg.EntityList[0] as UserInfo;
            if (userInfo == null)
            {
                ajaxJson.msg = "您所申诉的帐号不存在";
                return(ajaxJson.SerializeToJson());
            }

            //申诉实体信息
            LossReport lossReport = new LossReport();
            lossReport.ReportNo     = Fetch.GetForgetPwdNumber();
            lossReport.ReportEmail  = reportEmail;
            lossReport.Accounts     = account;
            lossReport.RegisterDate = regDate;
            lossReport.Compellation = realName;
            lossReport.PassportID   = idCard;
            lossReport.MobilePhone  = mobile;
            lossReport.OldNickName1 = nicknameOne;
            lossReport.OldNickName2 = nicknameTwo;
            lossReport.OldNickName3 = nicknameThree;
            if (!string.IsNullOrEmpty(passwordOne))
            {
                lossReport.OldLogonPass1 = Utility.MD5(passwordOne);
            }
            if (!string.IsNullOrEmpty(passwordTwo))
            {
                lossReport.OldLogonPass2 = Utility.MD5(passwordTwo);
            }
            if (!string.IsNullOrEmpty(passwordThree))
            {
                lossReport.OldLogonPass3 = Utility.MD5(passwordThree);
            }
            lossReport.ReportIP     = GameRequest.GetUserIP();
            lossReport.Random       = Utils.TextUtility.CreateRandom(4, 1, 0, 0, 0, "");
            lossReport.GameID       = userInfo.GameID;
            lossReport.UserID       = userInfo.UserID;
            lossReport.OldQuestion1 = questionOne;
            lossReport.OldResponse1 = answerOne;
            lossReport.OldQuestion2 = questionTwo;
            lossReport.OldResponse2 = answerTwo;
            lossReport.OldQuestion3 = questionThree;
            lossReport.OldResponse3 = answerThree;
            lossReport.SuppInfo     = suppInfo;

            //保存数据
            try
            {
                FacadeManage.aideNativeWebFacade.SaveLossReport(lossReport);
                ajaxJson.SetValidDataValue(true);
                string url = string.Format("Complaint-Setp-2.aspx?number={0}&account={1}", lossReport.ReportNo, account);
                ajaxJson.AddDataItem("uri", url);
                ajaxJson.msg = "申诉成功,系统将在2个工作日内处理,申诉结果将会以邮件的形式通知您!请注意查收邮件";
            }
            catch (Exception ex)
            {
                ajaxJson.msg = ex.ToString();
            }
            return(ajaxJson.SerializeToJson());
        }
Example #2
0
        public string AccountReport()
        {
            Message       message       = new Message();
            AjaxJsonValid ajaxJsonValid = new AjaxJsonValid();
            int           num           = 0;
            string        formString    = GameRequest.GetFormString("reportEmail");
            string        formString2   = GameRequest.GetFormString("txtUser");
            string        formString3   = GameRequest.GetFormString("regDate");
            string        formString4   = GameRequest.GetFormString("realName");
            string        formString5   = GameRequest.GetFormString("idCard");
            string        formString6   = GameRequest.GetFormString("mobile");
            string        formString7   = GameRequest.GetFormString("nicknameOne");
            string        formString8   = GameRequest.GetFormString("nicknameTwo");
            string        formString9   = GameRequest.GetFormString("nicknameThree");
            string        formString10  = GameRequest.GetFormString("passwordOne");
            string        formString11  = GameRequest.GetFormString("passwordTwo");
            string        formString12  = GameRequest.GetFormString("passwordThree");
            string        formString13  = GameRequest.GetFormString("questionOne");
            string        formString14  = GameRequest.GetFormString("answerOne");
            string        formString15  = GameRequest.GetFormString("questionTwo");
            string        formString16  = GameRequest.GetFormString("answerTwo");
            string        formString17  = GameRequest.GetFormString("questionThree");
            string        formString18  = GameRequest.GetFormString("answerThree");
            string        formString19  = GameRequest.GetFormString("suppInfo");

            message = InputDataValidate.CheckingEmail(formString);
            string result;

            if (!message.Success)
            {
                ajaxJsonValid.msg = "申诉结果接受邮箱输入有误";
                result            = ajaxJsonValid.SerializeToJson();
            }
            else
            {
                message = InputDataValidate.CheckingUserNameFormat(formString2);
                if (!message.Success)
                {
                    ajaxJsonValid.msg = "申诉帐号输入有误";
                    result            = ajaxJsonValid.SerializeToJson();
                }
                else
                {
                    if (!string.IsNullOrEmpty(formString3))
                    {
                        if (!Validate.IsShortDate(formString3))
                        {
                            ajaxJsonValid.msg = "注册日期输入有误";
                            result            = ajaxJsonValid.SerializeToJson();
                            return(result);
                        }
                        num++;
                    }
                    if (!string.IsNullOrEmpty(formString4))
                    {
                        message = InputDataValidate.CheckingRealNameFormat(formString4, true);
                        if (!message.Success)
                        {
                            ajaxJsonValid.msg = "真实姓名输入有误";
                            result            = ajaxJsonValid.SerializeToJson();
                            return(result);
                        }
                        num++;
                    }
                    if (!string.IsNullOrEmpty(formString5))
                    {
                        message = InputDataValidate.CheckingIDCardFormat(formString5, true);
                        if (!message.Success)
                        {
                            ajaxJsonValid.msg = "身份证号输入有误";
                            result            = ajaxJsonValid.SerializeToJson();
                            return(result);
                        }
                        num++;
                    }
                    if (!string.IsNullOrEmpty(formString6))
                    {
                        message = InputDataValidate.CheckingMobilePhoneNumFormat(formString6, true);
                        if (!message.Success)
                        {
                            ajaxJsonValid.msg = "移动电话输入有误";
                            result            = ajaxJsonValid.SerializeToJson();
                            return(result);
                        }
                        num++;
                    }
                    if (!string.IsNullOrEmpty(formString7))
                    {
                        message = InputDataValidate.CheckingNickNameFormat(formString7);
                        if (!message.Success)
                        {
                            ajaxJsonValid.msg = "历史昵称1输入有误";
                            result            = ajaxJsonValid.SerializeToJson();
                            return(result);
                        }
                        num++;
                    }
                    if (!string.IsNullOrEmpty(formString8))
                    {
                        message = InputDataValidate.CheckingNickNameFormat(formString8);
                        if (!message.Success)
                        {
                            ajaxJsonValid.msg = "历史昵称2输入有误";
                            result            = ajaxJsonValid.SerializeToJson();
                            return(result);
                        }
                        if (formString8 == formString7)
                        {
                            ajaxJsonValid.msg = "历史昵称不能相同";
                            result            = ajaxJsonValid.SerializeToJson();
                            return(result);
                        }
                        num++;
                    }
                    if (!string.IsNullOrEmpty(formString9))
                    {
                        message = InputDataValidate.CheckingNickNameFormat(formString9);
                        if (!message.Success)
                        {
                            ajaxJsonValid.msg = "历史昵称3输入有误";
                            result            = ajaxJsonValid.SerializeToJson();
                            return(result);
                        }
                        if (formString9 == formString7 || formString9 == formString8)
                        {
                            ajaxJsonValid.msg = "历史昵称不能相同";
                            result            = ajaxJsonValid.SerializeToJson();
                            return(result);
                        }
                        num++;
                    }
                    if (!string.IsNullOrEmpty(formString10))
                    {
                        num++;
                    }
                    if (!string.IsNullOrEmpty(formString11))
                    {
                        if (formString11 == formString10)
                        {
                            ajaxJsonValid.msg = "历史密码不能相同";
                            result            = ajaxJsonValid.SerializeToJson();
                            return(result);
                        }
                        num++;
                    }
                    if (!string.IsNullOrEmpty(formString12))
                    {
                        if (formString12 == formString11 || formString12 == formString10)
                        {
                            ajaxJsonValid.msg = "历史密码不能相同";
                            result            = ajaxJsonValid.SerializeToJson();
                            return(result);
                        }
                        num++;
                    }
                    if (formString13 != "0")
                    {
                        message = InputDataValidate.CheckingProtectAnswer(formString14, 1, false);
                        if (!message.Success)
                        {
                            ajaxJsonValid.msg = message.Content;
                            result            = ajaxJsonValid.SerializeToJson();
                            return(result);
                        }
                        num++;
                    }
                    if (formString15 != "0")
                    {
                        if (formString13 == formString15)
                        {
                            ajaxJsonValid.msg = "密保问题不能相同";
                            result            = ajaxJsonValid.SerializeToJson();
                            return(result);
                        }
                        message = InputDataValidate.CheckingProtectAnswer(formString14, 2, false);
                        if (!message.Success)
                        {
                            ajaxJsonValid.msg = message.Content;
                            result            = ajaxJsonValid.SerializeToJson();
                            return(result);
                        }
                        num++;
                    }
                    if (formString17 != "0")
                    {
                        if (formString17 == formString13 || formString17 == formString15)
                        {
                            ajaxJsonValid.msg = "密保问题不能相同";
                            result            = ajaxJsonValid.SerializeToJson();
                            return(result);
                        }
                        message = InputDataValidate.CheckingProtectAnswer(formString14, 3, false);
                        if (!message.Success)
                        {
                            ajaxJsonValid.msg = message.Content;
                            result            = ajaxJsonValid.SerializeToJson();
                            return(result);
                        }
                        num++;
                    }
                    message = InputDataValidate.CheckingProtectAnswer(formString19, true);
                    if (!message.Success)
                    {
                        ajaxJsonValid.msg = "补全资料太长,最长不能超过200个字符";
                        result            = ajaxJsonValid.SerializeToJson();
                    }
                    else
                    {
                        if (num < 4)
                        {
                            ajaxJsonValid.msg = "为了保证您的申诉请求审核通过,请输入至少4项资料,不包括补充资料";
                            result            = ajaxJsonValid.SerializeToJson();
                        }
                        else
                        {
                            Message userGlobalInfo = FacadeManage.aideAccountsFacade.GetUserGlobalInfo(0, 0, formString2);
                            if (!userGlobalInfo.Success)
                            {
                                ajaxJsonValid.msg = "您所申诉的帐号不存在";
                                result            = ajaxJsonValid.SerializeToJson();
                            }
                            else
                            {
                                UserInfo userInfo = userGlobalInfo.EntityList[0] as UserInfo;
                                if (userInfo == null)
                                {
                                    ajaxJsonValid.msg = "您所申诉的帐号不存在";
                                    result            = ajaxJsonValid.SerializeToJson();
                                }
                                else
                                {
                                    LossReport lossReport = new LossReport();
                                    lossReport.ReportNo     = Fetch.GetForgetPwdNumber();
                                    lossReport.ReportEmail  = formString;
                                    lossReport.Accounts     = formString2;
                                    lossReport.RegisterDate = formString3;
                                    lossReport.Compellation = formString4;
                                    lossReport.PassportID   = formString5;
                                    lossReport.MobilePhone  = formString6;
                                    lossReport.OldNickName1 = formString7;
                                    lossReport.OldNickName2 = formString8;
                                    lossReport.OldNickName3 = formString9;
                                    if (!string.IsNullOrEmpty(formString10))
                                    {
                                        lossReport.OldLogonPass1 = Utility.MD5(formString10);
                                    }
                                    if (!string.IsNullOrEmpty(formString11))
                                    {
                                        lossReport.OldLogonPass2 = Utility.MD5(formString11);
                                    }
                                    if (!string.IsNullOrEmpty(formString12))
                                    {
                                        lossReport.OldLogonPass3 = Utility.MD5(formString12);
                                    }
                                    lossReport.ReportIP     = GameRequest.GetUserIP();
                                    lossReport.Random       = TextUtility.CreateRandom(4, 1, 0, 0, 0, "");
                                    lossReport.GameID       = userInfo.GameID;
                                    lossReport.UserID       = userInfo.UserID;
                                    lossReport.OldQuestion1 = formString13;
                                    lossReport.OldResponse1 = formString14;
                                    lossReport.OldQuestion2 = formString15;
                                    lossReport.OldResponse2 = formString16;
                                    lossReport.OldQuestion3 = formString17;
                                    lossReport.OldResponse3 = formString18;
                                    lossReport.SuppInfo     = formString19;
                                    try
                                    {
                                        FacadeManage.aideNativeWebFacade.SaveLossReport(lossReport);
                                        ajaxJsonValid.SetValidDataValue(true);
                                        string value = string.Format("Complaint-Setp-2.aspx?number={0}&account={1}", lossReport.ReportNo, formString2);
                                        ajaxJsonValid.AddDataItem("uri", value);
                                        ajaxJsonValid.msg = "申诉成功,系统将在2个工作日内处理,申诉结果将会以邮件的形式通知您!请注意查收邮件";
                                    }
                                    catch (System.Exception ex)
                                    {
                                        ajaxJsonValid.msg = ex.ToString();
                                    }
                                    result = ajaxJsonValid.SerializeToJson();
                                }
                            }
                        }
                    }
                }
            }
            return(result);
        }