예제 #1
0
        public static string GetForgetPwdNumber()
        {
            StringBuffer stringBuffer = new StringBuffer() + TextUtility.GetDateTimeLongString();

            stringBuffer += TextUtility.CreateRandom(8, 1, 0, 0, 0, "");
            return(stringBuffer.ToString());
        }
예제 #2
0
        public static string GetOrderID()
        {
            StringBuffer buffer = new StringBuffer();

            buffer += TextUtility.GetDateTimeLongString();
            buffer += TextUtility.CreateRandom(8, 1, 0, 0, 0, "");
            return(buffer.ToString());
        }
예제 #3
0
        /// <summary>
        /// 生成编号 如 找回密码编号
        /// </summary>
        /// <returns></returns>
        public static string GetForgetPwdNumber()
        {
            //构造编号(如:20101201102322159111111)
            StringBuffer tradeNoBuffer = new StringBuffer();

            tradeNoBuffer += TextUtility.GetDateTimeLongString();
            tradeNoBuffer += TextUtility.CreateRandom(8, 1, 0, 0, 0, "");
            return(tradeNoBuffer.ToString());
        }
예제 #4
0
        /// <summary>
        /// 获取交易流水号
        /// </summary>
        /// <returns></returns>
        public static string GetOrderID()
        {
            //构造订单号 (形如:20101201102322159111111)
            StringBuffer tradeNoBuffer = new StringBuffer();

            tradeNoBuffer += TextUtility.GetDateTimeLongString();
            tradeNoBuffer += TextUtility.CreateRandom(8, 1, 0, 0, 0, "");

            return(tradeNoBuffer.ToString());
        }
예제 #5
0
        public static string GetOrderIDByPrefix(string prefix)
        {
            int          num          = 22;
            int          num2         = 6;
            StringBuffer stringBuffer = new StringBuffer();

            stringBuffer += prefix;
            stringBuffer += TextUtility.GetDateTimeLongString();
            if (stringBuffer.Length + num2 > num)
            {
                num2 = num - stringBuffer.Length;
            }
            stringBuffer += TextUtility.CreateRandom(num2, 1, 0, 0, 0, "");
            return(stringBuffer.ToString());
        }
예제 #6
0
        /// <summary>
        /// 获取交易流水号
        /// </summary>
        /// <param name="prefix"></param>
        /// <returns></returns>
        public static string GetOrderIDByPrefix(string prefix, int orderIDLength)
        {
            //构造订单号 (形如:20101201102322159111111)
            int           randomLength  = 6;
            StringBuilder tradeNoBuffer = new(prefix);

            tradeNoBuffer.Append(TextUtility.GetDateTimeLongString());

            if ((tradeNoBuffer.Length + randomLength) > orderIDLength)
            {
                randomLength = orderIDLength - tradeNoBuffer.Length;
            }

            tradeNoBuffer.Append(TextUtility.CreateRandom(randomLength, true, false, false, false, ""));

            return(tradeNoBuffer.ToString());
        }
예제 #7
0
        /// <summary>
        /// 获取交易流水号
        /// </summary>
        /// <param name="prefix"></param>
        /// <returns></returns>
        public static string GetOrderIDByPrefix(string prefix)
        {
            //构造订单号 (形如:20101201102322159111111)
            int          orderIDLength = 32;
            int          randomLength  = 6;
            StringBuffer tradeNoBuffer = new StringBuffer();

            tradeNoBuffer += prefix;
            tradeNoBuffer += TextUtility.GetDateTimeLongString();

            if ((tradeNoBuffer.Length + randomLength) > orderIDLength)
            {
                randomLength = orderIDLength - tradeNoBuffer.Length;
            }

            tradeNoBuffer += TextUtility.CreateRandom(randomLength, 1, 0, 0, 0, "");

            return(tradeNoBuffer.ToString());
        }
예제 #8
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (!IsValid)
            {
                return;
            }

            #region 验证
            string strAccount    = TextFilter.FilterAll(CtrlHelper.GetText(txtAccount));
            string strNickName   = TextFilter.FilterAll(CtrlHelper.GetText(txtNickName));
            string strLogonPass  = CtrlHelper.GetText(txtLogonPass);
            string strLogonPass2 = CtrlHelper.GetText(txtLogonPass2);

            int accountsLength = System.Text.Encoding.Default.GetBytes(strAccount).Length;
            if (accountsLength > 32 || accountsLength < 6)
            {
                MessageBox("游戏帐号的长度为6-32位,中文算两位");
                return;
            }

            if (string.IsNullOrEmpty(strNickName))
            {
                strNickName = strAccount;
            }
            else
            {
                int nickNameLength = System.Text.Encoding.Default.GetBytes(strNickName).Length;
                if (nickNameLength > 32 || nickNameLength < 6)
                {
                    MessageBox("昵称的的长度为6-32位,中文算两位");
                    return;
                }
            }


            //计算用户权限
            int intUserRight = 0;
            if (ckbUserRight.Items.Count > 0)
            {
                foreach (ListItem item in ckbUserRight.Items)
                {
                    if (item.Selected)
                    {
                        intUserRight |= int.Parse(item.Value);
                    }
                }
            }
            //计算管理权限
            int intMasterRight = 0;
            if (ckbMasterRight.Items.Count > 0)
            {
                foreach (ListItem item in ckbMasterRight.Items)
                {
                    if (item.Selected)
                    {
                        intMasterRight |= int.Parse(item.Value);
                    }
                }
            }
            #endregion

            AccountsInfo    account = new AccountsInfo();
            IndividualDatum datum   = new IndividualDatum();

            account.Accounts    = strAccount;
            account.NickName    = strNickName;
            account.LogonPass   = Utility.MD5(strLogonPass);
            account.InsurePass  = string.IsNullOrEmpty(CtrlHelper.GetText(txtInsurePass)) ? Utility.MD5(strLogonPass) : Utility.MD5(CtrlHelper.GetText(txtInsurePass));
            account.DynamicPass = TextUtility.CreateRandom(32, 1, 1, 1, 0, "");
            account.UnderWrite  = TextFilter.FilterAll(CtrlHelper.GetText(txtUnderWrite));

            account.Present     = CtrlHelper.GetInt(txtPresent, 0);
            account.LoveLiness  = CtrlHelper.GetInt(txtLoveLiness, 0);
            account.Experience  = CtrlHelper.GetInt(txtExperience, 0);
            account.Gender      = byte.Parse(ddlGender.SelectedValue);
            account.FaceID      = (short)GameRequest.GetFormInt("inFaceID", 0);
            account.Nullity     = (byte)(ckbNullity.Checked ? 1 : 0);
            account.StunDown    = (byte)(ckbStunDown.Checked ? 1 : 0);
            account.MoorMachine = byte.Parse(rdoMoorMachine.SelectedValue);

            account.IsAndroid   = (byte)(chkIsAndroid.Checked ? 1 : 0);
            account.UserRight   = intUserRight;
            account.MasterRight = intMasterRight;
            account.MasterOrder = Convert.ToByte(ddlMasterOrder.SelectedValue.Trim());

            account.Compellation     = TextFilter.FilterAll(CtrlHelper.GetText(txtCompellation));
            account.MemberOrder      = byte.Parse(ddlMemberOrder.SelectedValue);
            account.MemberOverDate   = string.IsNullOrEmpty(CtrlHelper.GetText(txtMemberOverDate)) ? Convert.ToDateTime("1980-01-01") : Convert.ToDateTime(CtrlHelper.GetText(txtMemberOverDate));
            account.MemberSwitchDate = string.IsNullOrEmpty(CtrlHelper.GetText(txtMemberOverDate)) ? Convert.ToDateTime("1980-01-01") : Convert.ToDateTime(CtrlHelper.GetText(txtMemberOverDate));
            account.RegisterIP       = GameRequest.GetUserIP();

            datum.QQ            = TextFilter.FilterAll(CtrlHelper.GetText(txtQQ));
            datum.EMail         = TextFilter.FilterAll(CtrlHelper.GetText(txtEMail));
            datum.SeatPhone     = TextFilter.FilterAll(CtrlHelper.GetText(txtSeatPhone));
            datum.MobilePhone   = TextFilter.FilterAll(CtrlHelper.GetText(txtMobilePhone));
            datum.PostalCode    = TextFilter.FilterAll(CtrlHelper.GetText(txtPostalCode));
            datum.DwellingPlace = TextFilter.FilterAll(CtrlHelper.GetText(txtDwellingPlace));
            datum.UserNote      = TextFilter.FilterAll(CtrlHelper.GetText(txtUserNote));

            Message msg = FacadeManage.aideAccountsFacade.AddAccount(account, datum);
            if (msg.Success)
            {
                Page.ClientScript.RegisterStartupScript(typeof(Page), "", string.Format("alert(\"{0}\");location.href='{1}';", "添加成功", Request.Url.AbsoluteUri), true);
            }
            else
            {
                MessageBox(msg.Content);
            }
        }
예제 #9
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);
        }