private void ajaxCharge() { string checkCode = base.f("name"); string value = base.f("money"); string code = base.f("code"); string text = ""; if (!ValidateCode.CheckValidateCode(code, ref text)) { this._response = base.JsonResult(0, "验证码错误"); } else { int num = new Lottery.DAL.Flex.UserChargeDAL().Save(this.AdminId, "1007", checkCode, Convert.ToDecimal(value)); if (num == -1) { this._response = base.JsonResult(0, "充值金额不能小于最小充值金额!"); } else if (num > 0) { this._response = base.JsonResult(1, this.AdminId.ToString()); } else { this._response = base.JsonResult(0, "充值失败"); } } }
/// <summary> /// 生成订单号 /// </summary> private void ajaxChargeOrderId() { this._response = this.JsonResult(1, SsId.Charge); string _code = this.q("code"); string _realcode = ""; if (!ValidateCode.CheckValidateCode(_code, ref _realcode)) { this._response = this.JsonResult(0, "验证码错误"); } }
private void ajaxGetPwd() { string str1 = this.f("name"); string str2 = this.f("question"); string str3 = this.f("answer"); string _code = this.f("code"); string _realcode = ""; if (!ValidateCode.CheckValidateCode(_code, ref _realcode)) { this._response = "验证码应该是" + _realcode; } else { this.doh.Reset(); this.doh.ConditionExpress = "userName=@userName"; this.doh.AddConditionParameter("@userName", (object)str1); if (!this.doh.Exist("N_User")) { this._response = "对不起,账号不存在!"; } else { this.doh.Reset(); this.doh.ConditionExpress = "userName =@userName and Question=@Question and Answer=@Answer"; this.doh.AddConditionParameter("@userName", (object)str1); this.doh.AddConditionParameter("@Question", (object)str2); this.doh.AddConditionParameter("@Answer", (object)str3); if (!this.doh.Exist("N_User")) { this._response = "对不起,验证问题错误!"; } else { this.doh.Reset(); this.doh.ConditionExpress = "userName=@userName"; this.doh.AddConditionParameter("@userName", (object)str1); this.doh.AddFieldItem("Password", (object)MD5.Last64(MD5.Lower32("123456"))); this.doh.Update("N_User"); this._response = "密码也为您重置为:123456,请您登陆系统及时更改密码!"; new LogSysDAL().Save("会员管理", str1 + "找回密码!"); } } } }
private void ajaxGetPwd() { string text = base.f("name"); string conditionValue = base.f("question"); string conditionValue2 = base.f("answer"); string code = base.f("code"); string str = ""; if (!ValidateCode.CheckValidateCode(code, ref str)) { this._response = "验证码应该是" + str; } else { this.doh.Reset(); this.doh.ConditionExpress = "userName=@userName"; this.doh.AddConditionParameter("@userName", text); if (!this.doh.Exist("N_User")) { this._response = "对不起,账号不存在!"; } else { this.doh.Reset(); this.doh.ConditionExpress = "userName =@userName and Question=@Question and Answer=@Answer"; this.doh.AddConditionParameter("@userName", text); this.doh.AddConditionParameter("@Question", conditionValue); this.doh.AddConditionParameter("@Answer", conditionValue2); if (!this.doh.Exist("N_User")) { this._response = "对不起,验证问题错误!"; } else { this.doh.Reset(); this.doh.ConditionExpress = "userName=@userName"; this.doh.AddConditionParameter("@userName", text); this.doh.AddFieldItem("Password", MD5.Last64(MD5.Lower32("123456"))); this.doh.Update("N_User"); this._response = "密码也为您重置为:123456,请您登陆系统及时更改密码!"; new LogSysDAL().Save("会员管理", text + "找回密码!"); } } } }
private void ajaxCash() { string BankId = this.f("bankId"); string UserBankId = this.f("userBankId"); string Money = this.f("money"); string PassWord = this.f("pass"); string _code = this.f("code"); string _realcode = ""; if (!ValidateCode.CheckValidateCode(_code, ref _realcode)) { this._response = this.JsonResult(0, "验证码错误"); } else { this._response = this.JsonResult(0, new UserGetCashDAL().UserGetCash(this.AdminId, UserBankId, BankId, Money, PassWord)); } }
private void ajaxCash() { string bankId = base.f("bankId"); string userBankId = base.f("userBankId"); string money = base.f("money"); string passWord = base.f("pass"); string code = base.f("code"); string text = ""; if (!ValidateCode.CheckValidateCode(code, ref text)) { this._response = base.JsonResult(0, "验证码错误"); } else { string str = new UserGetCashDAL().UserGetCash(this.AdminId, userBankId, bankId, money, passWord); this._response = base.JsonResult(0, str); } }
private void ajaxLogin() { string str1 = this.f("name"); string str2 = this.f("pass"); string _code = this.f("code"); string _realcode = ""; if (!ValidateCode.CheckValidateCode(_code, ref _realcode)) { this._response = this.GetJsonResult(0, "验证码不正确!"); } else { int iExpires = 604800; string _userid = new UserDAL().ChkLogin(str1.Trim(), str2.Trim(), iExpires); if (_userid.Length < 10) { new LogUserLoginDAL().Save(_userid, "mobile", "", "", IPHelp.ClientIP); _userid = this.GetJsonResult(1, "success"); } this._response = _userid; } }
private void ajaxLogin() { string text = base.f("name"); string text2 = base.f("pass"); string code = base.f("code"); string text3 = ""; if (!ValidateCode.CheckValidateCode(code, ref text3)) { this._response = base.GetJsonResult(0, "验证码不正确!"); } else { int iExpires = 604800; string text4 = new UserDAL().ChkLogin(text.Trim(), text2.Trim(), iExpires); if (text4.Length < 10) { new LogUserLoginDAL().Save(text4, "mobile", "", "", IPHelp.ClientIP); text4 = base.GetJsonResult(1, "success"); } this._response = text4; } }
private void ajaxRegister() { string _UserName = this.f("name"); string _Password = this.f("pass"); string _code = this.f("code"); string str1 = this.f("u"); string _realcode = ""; try { if (!ValidateCode.CheckValidateCode(_code, ref _realcode)) { this._response = this.JsonResult(0, "验证码错误"); } else if (_UserName.Length > 0 && _Password.Length > 0) { string decryptKey = ConfigurationManager.AppSettings["DesKey"].ToString(); string str2 = this.DecryptDES(str1.Replace("@", "+"), decryptKey); string str3 = str2.Substring(0, str2.IndexOf('@')); this.doh.Reset(); this.doh.ConditionExpress = "id=@id and Isdel=0"; this.doh.AddConditionParameter("@id", (object)str3); if (this.doh.Count("N_User") < 1) { this._response = this.JsonResult(0, "对不起,该注册链接已失效!"); } else { string str4 = str2.Substring(str2.IndexOf('@') + 1); if (Convert.ToDecimal(str4) >= new Decimal(125)) { this.doh.Reset(); this.doh.ConditionExpress = "UserId=@UserId and Point=@Point"; this.doh.AddConditionParameter("@UserId", (object)str3); this.doh.AddConditionParameter("@Point", (object)Convert.ToDecimal(Convert.ToDecimal(str4) / new Decimal(10)).ToString("0.00")); object[] fields = this.doh.GetFields("V_UserQuota", "ChildNums,useNums,useNums2"); if (fields == null) { this._response = this.JsonResult(0, "对不起,此链接的配额不足,请联系上级!"); return; } if (Convert.ToDecimal(fields[0]) - (Convert.ToDecimal(fields[1]) + Convert.ToDecimal(fields[2])) < new Decimal(1)) { this._response = this.JsonResult(0, "对不起,此链接的配额不足,请联系上级!"); return; } } int result; if (int.TryParse(str3, out result)) { this.GetRandomNumberString(64, false); int num1 = new UserDAL().Register(str3, _UserName, _Password, Convert.ToDecimal(str4)); if (num1 > 0) { this.doh.Reset(); this.doh.ConditionExpress = "id=@id"; this.doh.AddConditionParameter("@id", (object)str3); string str5 = this.doh.GetField("N_User", "UserCode").ToString() + Strings.PadLeft(num1.ToString()); this.doh.Reset(); this.doh.ConditionExpress = "id=" + (object)num1; this.doh.AddFieldItem("UserCode", (object)str5); this.doh.AddFieldItem("UserGroup", (object)"0"); if (this.doh.Update("N_User") > 0) { this.doh.Reset(); this.doh.SqlCmd = "select Id,Point from N_User with(nolock) where Id=" + (object)num1 + " and IsEnable=0 and IsDel=0"; DataTable dataTable1 = this.doh.GetDataTable(); for (int index1 = 0; index1 < dataTable1.Rows.Count; ++index1) { this.doh.Reset(); this.doh.SqlCmd = "SELECT [Point] FROM [N_UserLevel] where Point>=125.00 and Point<=" + (object)Convert.ToDecimal(dataTable1.Rows[index1]["Point"]) + " order by [Point] desc"; DataTable dataTable2 = this.doh.GetDataTable(); for (int index2 = 0; index2 < dataTable2.Rows.Count; ++index2) { int num2 = 0; string str6 = "0"; this.doh.Reset(); this.doh.SqlCmd = "select isnull(ChildNums-useNums-useNums2,0) as num from V_UserQuota with(nolock) where UserId=" + this.AdminId + " and point=" + (object)(Convert.ToDecimal(dataTable2.Rows[index2]["Point"]) / new Decimal(10)); DataTable dataTable3 = this.doh.GetDataTable(); if (dataTable3.Rows.Count > 0) { num2 = Convert.ToInt32(dataTable3.Rows[0]["num"]); } if (Convert.ToDecimal(dataTable2.Rows[index2]["Point"]) == Convert.ToDecimal(dataTable1.Rows[index1]["Point"])) { new UserQuotaDAL().SaveUserQuota(dataTable1.Rows[index1]["Id"].ToString(), Convert.ToDecimal(dataTable2.Rows[index2]["Point"]) / new Decimal(10), 0); } else { if (num2 <= 5) { str6 = string.Concat((object)num2); } new UserQuotaDAL().SaveUserQuota(dataTable1.Rows[index1]["Id"].ToString(), Convert.ToDecimal(dataTable2.Rows[index2]["Point"]) / new Decimal(10), Convert.ToInt32(str6)); } } } } new LogSysDAL().Save("会员管理", "Id为" + (object)num1 + "的会员注册成功!"); this._response = this.JsonResult(1, "会员注册成功"); } else { this._response = this.JsonResult(0, "注册失败,请重新注册"); } } else { this._response = this.JsonResult(0, "链接地址错误!请重新打开"); } } } } catch (Exception ex) { this._response = this.JsonResult(0, "注册异常:" + (object)ex); } }
private void ajaxRegister() { string text = base.f("name"); string text2 = base.f("pass"); string code = base.f("code"); string text3 = base.f("u"); string text4 = ""; try { if (!ValidateCode.CheckValidateCode(code, ref text4)) { this._response = base.JsonResult(0, "验证码错误"); } else if (text.Length > 0 && text2.Length > 0) { string decryptKey = ConfigurationManager.AppSettings["DesKey"].ToString(); string text5 = base.DecryptDES(text3.Replace("@", "+"), decryptKey); string text6 = text5.Substring(0, text5.IndexOf('@')); this.doh.Reset(); this.doh.ConditionExpress = "id=@id and Isdel=0"; this.doh.AddConditionParameter("@id", text6); if (this.doh.Count("N_User") < 1) { this._response = base.JsonResult(0, "对不起,该注册链接已失效!"); } else { string value = text5.Substring(text5.IndexOf('@') + 1); if (Convert.ToDecimal(value) >= 125m) { this.doh.Reset(); this.doh.ConditionExpress = "UserId=@UserId and Point=@Point"; this.doh.AddConditionParameter("@UserId", text6); this.doh.AddConditionParameter("@Point", Convert.ToDecimal(Convert.ToDecimal(value) / 10m).ToString("0.00")); object[] fields = this.doh.GetFields("V_UserQuota", "ChildNums,useNums,useNums2"); if (fields == null) { this._response = base.JsonResult(0, "对不起,此链接的配额不足,请联系上级!"); return; } if (Convert.ToDecimal(fields[0]) - (Convert.ToDecimal(fields[1]) + Convert.ToDecimal(fields[2])) < 1m) { this._response = base.JsonResult(0, "对不起,此链接的配额不足,请联系上级!"); return; } } int num; if (int.TryParse(text6, out num)) { string randomNumberString = base.GetRandomNumberString(64, false); int num2 = new UserDAL().Register(text6, text, text2, Convert.ToDecimal(value)); if (num2 > 0) { this.doh.Reset(); this.doh.ConditionExpress = "id=@id"; this.doh.AddConditionParameter("@id", text6); object field = this.doh.GetField("N_User", "UserCode"); string fieldValue = field + Strings.PadLeft(num2.ToString()); this.doh.Reset(); this.doh.ConditionExpress = "id=" + num2; this.doh.AddFieldItem("UserCode", fieldValue); this.doh.AddFieldItem("UserGroup", "0"); if (this.doh.Update("N_User") > 0) { this.doh.Reset(); this.doh.SqlCmd = "select Id,Point from N_User with(nolock) where Id=" + num2 + " and IsEnable=0 and IsDel=0"; DataTable dataTable = this.doh.GetDataTable(); for (int i = 0; i < dataTable.Rows.Count; i++) { this.doh.Reset(); this.doh.SqlCmd = "SELECT [Point] FROM [N_UserLevel] where Point>=125.00 and Point<=" + Convert.ToDecimal(dataTable.Rows[i]["Point"]) + " order by [Point] desc"; DataTable dataTable2 = this.doh.GetDataTable(); for (int j = 0; j < dataTable2.Rows.Count; j++) { int num3 = 0; string value2 = "0"; this.doh.Reset(); this.doh.SqlCmd = string.Concat(new object[] { "select isnull(ChildNums-useNums-useNums2,0) as num from V_UserQuota with(nolock) where UserId=", this.AdminId, " and point=", Convert.ToDecimal(dataTable2.Rows[j]["Point"]) / 10m }); DataTable dataTable3 = this.doh.GetDataTable(); if (dataTable3.Rows.Count > 0) { num3 = Convert.ToInt32(dataTable3.Rows[0]["num"]); } if (Convert.ToDecimal(dataTable2.Rows[j]["Point"]) == Convert.ToDecimal(dataTable.Rows[i]["Point"])) { new UserQuotaDAL().SaveUserQuota(dataTable.Rows[i]["Id"].ToString(), Convert.ToDecimal(dataTable2.Rows[j]["Point"]) / 10m, 0); } else { if (num3 <= 5) { value2 = string.Concat(num3); } new UserQuotaDAL().SaveUserQuota(dataTable.Rows[i]["Id"].ToString(), Convert.ToDecimal(dataTable2.Rows[j]["Point"]) / 10m, Convert.ToInt32(value2)); } } } } new LogSysDAL().Save("会员管理", "Id为" + num2 + "的会员注册成功!"); this._response = base.JsonResult(1, "会员注册成功"); } else { this._response = base.JsonResult(0, "注册失败,请重新注册"); } } else { this._response = base.JsonResult(0, "链接地址错误!请重新打开"); } } } } catch (Exception arg) { this._response = base.JsonResult(0, "注册异常:" + arg); } }