public static DataTable GetAreas(string parentId = "") { DataTable dtResult = null; try { string filter = ""; if (string.IsNullOrEmpty(parentId)) { filter = "LEVEL = 1"; } else { filter = "PARENTID='" + parentId + "'"; } ParamUtil aPU = new ParamUtil() .SQLCmdLoadData() .SQLWithOutSchema() .SQLEntityScript("CAIKA_AREAS", string.Format("SELECT * FROM CAIKA_AREAS WHERE {0} ORDER BY ID", filter)) .ExecuteCmd(ADataLoader.DataLoader()); if (aPU.IsOK()) { dtResult = aPU.GetValueAsDataSet().Tables[0]; } } catch (Exception) { } return(dtResult); }
public JsonResult changeBank() { Hashtable aHT = Authorizes.GetAuthorizeCache(Request); if (aHT != null) { DictSetUtil ds_digest = new DictSetUtil(new DataSet()); ds_digest.SetValue("realname", Request["realname"]); ds_digest.SetValue("bankno", Request["bankno"]); ds_digest.SetValue("bankname", Request["bankname"]); ds_digest.SetValue("province", Request["province"]); ds_digest.SetValue("province_name", Request["province_name"]); ds_digest.SetValue("city", Request["city"]); ds_digest.SetValue("city_name", Request["city_name"]); ds_digest.SetValue("subbank", Request["subbank"]); ds_digest.SetValue("cardnum", Request["cardnum"]); ParamUtil aPU = new ParamUtil() .SetCmd(AAccountUtil.CChangeBank) .SetParam(aHT["DOMAINUSER"]).SetParam("c_pass", Request["c_pass"]).SetParam("realname", Request["realname"]).SetParam("digest", ds_digest.MyDS) .ExecuteCmd(new AAccountUtil()); if (aPU.IsOK()) { return(Json(new { flag = "y", message = "success" })); } else { return(Json(new { flag = "n", message = aPU.GetError() })); } } return(Json(new { flag = "n", message = "账户登录状态失效" })); }
public JsonResult postMember() { Hashtable aHT = Authorizes.GetAuthorizeCache(Request); if (aHT != null) { DictSetUtil ds_member = new DictSetUtil(new DataSet()); ds_member.SetValue("nickname", Request["nickname"]); ds_member.SetValue("email", Request["email"]); ds_member.SetValue("realname", Request["realname"]); ds_member.SetValue("idtype", Request["idtype"]); ds_member.SetValue("id", Request["id"]); ds_member.SetValue("ask", Request["ask"]); ds_member.SetValue("answer", Request["answer"]); ParamUtil aPU = new ParamUtil() .SetCmd(AAccountUtil.CPostMemberInfo) .SetParam(aHT["DOMAINUSER"]).SetParam("c_pass", Request["c_pass"]).SetParam("member", ds_member.MyDS) .ExecuteCmd(new AAccountUtil()); if (aPU.IsOK()) { return(Json(new { flag = "y", message = "success" })); } else { return(Json(new { flag = "n", message = aPU.GetError() })); } } return(Json(new { flag = "n", message = "账户登录状态失效" })); }
public FileContentResult getQRImage() { Hashtable aHT = Authorizes.GetAuthorizeCache(Request); if (aHT != null) { string channel = Request.QueryString["c"]; string payId = Request.QueryString["p"]; if (channel == "qrway" && double.TryParse(Request["a"], out double amount) && amount > 0) { // 得到接口数据并解析其对应的支付接口逻辑。 Hashtable htPayment = PaymentUtil.GetPaymethod2Hashtable(channel, payId); if (htPayment != null) { UriUtil uriUtil = null; try { uriUtil = new UriUtil(PickParam(htPayment).GetValueAsString("PAYLINK")); } catch (Exception) { } if (uriUtil != null) { ParamUtil paramUtil = PickParam(Request.QueryString).Merge(htPayment).SetCmd(uriUtil.GetQueryItem(ActionUtil.Cmd)).ExecuteCmd(uriUtil.GetActionInstance(GetControl())); if (paramUtil.IsOK()) { return(File(paramUtil.GetValue <byte[]>(), paramUtil.GetValueAsString("content-type"))); } } } } } // 返回默认二维码图片 using (Image image = Image.FromFile(Server.MapPath("~/content/images/noimage.png"))) { using (MemoryStream ms1 = new MemoryStream()) { image.Save(ms1, System.Drawing.Imaging.ImageFormat.Png); return(File(ms1.ToArray(), "image/png")); } } }
public static DataTable GetPaymentList() { try { ParamUtil paramUtil = new ParamUtil().SQLCmdLoadData().SQLWithOutSchema() .SQLEntityScript("CAIKA_PAYMENT", string.Format("SELECT PAYID,NAME,PAYLINK,PAYMETHOD,CSSNAME,SEQNO FROM CAIKA_PAYMENT WHERE STATE='{0}'", state.Enabled)) .ExecuteCmd(ADataLoader.DataLoader()); if (paramUtil.IsOK()) { return(paramUtil.GetValueAsDataSet().Tables["CAIKA_PAYMENT"]); } } catch (Exception) { } return(null); }
/// <summary> /// 获取会员账号的资金摘要信息 /// </summary> /// <param name="objControl"></param> /// <param name="accountId"></param> /// <returns></returns> public static DataSet GetMemberDigest(IControl objControl, string accountId = "") { DictSetUtil digestDS = new DictSetUtil(new DataSet()); try { digestDS.SetValue("TOTALAMOUNT", "0.00"); // 账户总额 digestDS.SetValue("AVAILABLE", "0.00"); // 可用余额 digestDS.SetValue("FREEZED", "0.00"); // 冻结金额 digestDS.SetValue("SCORE", "0"); // 积分 digestDS.SetValue("DEPOSITED", "0.0"); // 充值金额 digestDS.SetValue("BONUS", "0.0"); // 中奖金额 digestDS.SetValue("EXCHANGED", "0.0"); // 积分兑换 digestDS.SetValue("RETURNED", "0.0"); // 游戏返点 digestDS.SetValue("CONSUME", "0.0"); // 投注金额 digestDS.SetValue("WITHDRAW", "0.0"); // 提款金额 // 得到会员账号的资金摘要信息 if (!string.IsNullOrEmpty(accountId)) { ParamUtil aPU = new ParamUtil() .SQLCmdLoadData() .SQLEntityScript("CAIKA_MEMBER", string.Format("SELECT * FROM CAIKA_MEMBER WHERE ACCOUNTID='{0}'", accountId)) .SQLWithOutSchema() .ExecuteCmd(ADataLoader.DataLoader()); if (aPU.IsOK()) { DataSet dsDigest = AEntryDic.Pick(objControl).GetDic(aPU.GetValueAsDataSet().Tables["CAIKA_MEMBER"].Rows[0].Field <string>("DIGEST")); if (dsDigest != null) { digestDS.MyDS.Merge(dsDigest); digestDS.AcceptChanges(); } } } } catch (Exception) { } return(digestDS.MyDS); }
public PageModel(BaseController controller, string file) { Parameters = new DynamicParameters(); ParamUtil aPU = new ParamUtil().SQLCmdLoadDataFromXML(file).ExecuteCmd(ADataLoader.LocalDataLoader()); if (!aPU.IsOK()) { throw new InvalidOperationException(string.Format("上下文中未匹配到合适的Model信息! file={0}", file)); } DictSetUtil aXTCS = new DictSetUtil(aPU.GetValueAsDataSet()); Title = aXTCS.GetValue("Title"); Description = aXTCS.GetValue("Description"); Keywords = aXTCS.GetValue("Keywords"); ResConfigFile = aXTCS.GetValue("ResConfigFile"); AppDomain = controller.AppDomain; ResVersion = controller.ResVersion; }
public static Hashtable GetPaymethod2Hashtable(string channel, string payId) { Hashtable aHT = new Hashtable(); try { ParamUtil paramUtil = new ParamUtil().SQLCmdLoadData() .SQLEntityScript("CAIKA_PAYMENT", string.Format("SELECT PAYID,VENDORID,PAYLINK,PAYMETHOD,PAYPARAMS,RATE,TOTALREQUEST,TOTALRECEIVED FROM CAIKA_PAYMENT WHERE PAYID='{0}' AND PAYMETHOD='{1}' AND STATE='{2}'", payId, channel, AosuApp.state.Enabled)) .ExecuteCmd(ADataLoader.DataLoader()); if (paramUtil.IsOK()) { ParamUtil.Pick(aHT) .Merge(new UriUtil().ImportRow(paramUtil.GetValueAsDataSet().Tables[0].Rows[0]).ExportHashtable()) .ImportSets(AEntryDic.Pick().GetDic(ParamUtil.Pick(aHT).GetValueAsString("PAYPARAMS"))); } } catch (Exception) { } return(aHT); }
public JsonResult postRequest(string id) { Hashtable aHT = Authorizes.GetAuthorizeCache(Request); if (aHT != null) { ParamUtil aPU = new ParamUtil() .SetCmd(AAccountUtil.CPostRequest) .SetParam(aHT["DOMAINUSER"]).SetParam("type", id).SetParam("msgid", Request["msgid"]) .ExecuteCmd(new AAccountUtil()); if (aPU.IsOK()) { return(Json(new { flag = "y", message = "success" })); } else { return(Json(new { flag = "n", message = aPU.GetError() })); } } return(Json(new { flag = "n", message = "账户登录失效" })); }
public JsonResult changePwd() { Hashtable aHT = Authorizes.GetAuthorizeCache(Request); if (aHT != null) { ParamUtil aPU = new ParamUtil() .SetCmd(AAccountUtil.CChangePassword) .SetParam(aHT["DOMAINUSER"]).SetParam("type", Request["t"]).SetParam("c_pass", Request["c_pass"]).SetParam("n_pass", Request["n_pass"]) .ExecuteCmd(new AAccountUtil()); if (aPU.IsOK()) { return(Json(new { flag = "y", message = "success" })); } else { return(Json(new { flag = "n", message = aPU.GetError() })); } } return(Json(new { flag = "n", message = "账户登录状态失效" })); }
public static Hashtable GetPaymentInfo(string payid) { Hashtable aHT = null; try { ParamUtil paramUtil = new ParamUtil().SQLCmdLoadData().SQLWithOutSchema() .SQLEntityScript("CAIKA_PAYMENT", string.Format("SELECT TOP 1 * FROM CAIKA_PAYMENT WHERE STATE='{0}' AND PAYID='{1}'", state.Enabled, payid)) .ExecuteCmd(ADataLoader.DataLoader()); if (paramUtil.IsOK()) { if (paramUtil.GetValueAsDataSet().Tables["CAIKA_PAYMENT"].Rows.Count == 1) { aHT = new UriUtil().ImportRow(paramUtil.GetValueAsDataSet().Tables["CAIKA_PAYMENT"].Rows[0]) .ExportHashtable(); } } } catch (Exception) { } return(aHT); }
public JsonResult doRegister() { string flag = "success"; string message = ""; if (!string.IsNullOrEmpty(Request["vcode"])) { string strAccountId = Request["account"]; string strPassword = Request["password"]; string strAgentCode = Request["agentcode"]; if (string.IsNullOrEmpty(strAgentCode)) { strAgentCode = "000101999"; } // 是否存在? if (MemberDBUtils.MemberIsExist(GetControl(), strAccountId)) { flag = "failed"; message = "用户名已存在"; } else { Hashtable aHT = new Hashtable(); PickParam(aHT).SetParam("DOMAINUSER", strAccountId); PickParam(aHT).SetParam("DOMAINNAME", "caika.com"); PickParam(aHT).SetParam("PSTPWD", strPassword); PickParam(aHT).SetParam("TYPE", account_type.NormalAcount); PickParam(aHT).SetParam("IP", Request.UserHostAddress); PickParam(aHT).SetParam(MemberDBUtils.GetMemberDigest(GetControl())); PickParam(aHT).SetParam("PARENTAGENT", strAgentCode); // 校验应用许可权的合法性 ParamUtil checkLicense = PickParam().Merge(aHT).SetCmd(ADomain.CCheckLicense).ExecuteCmd(new ADomain()); if (!checkLicense.IsOK()) { flag = "failed"; message = checkLicense.GetError(); } else { // 先注册通行证、然后再添加会员账户 // 执行CRegister命令后会破坏aHT参数信息,所以在此创建一个临时aHT1用于避免原始参数集合不被破坏。 Hashtable aHT1 = new Hashtable(); if (PickParam(aHT1).Merge(aHT).SetCmd(APassport.CRegister).ExecuteCmd(new APassport()).IsOK()) { // 创建会员账户 Hashtable aHT2 = new Hashtable(); MemberDBUtils.CreateMemberRecord(GetControl(), PickParam(aHT2).Merge(aHT).ParamTable); if (!PickParam(aHT2).IsOK()) { flag = "failed"; message = PickParam(aHT2).GetError(); } else { // 注册完成后直接登录 if (PickParam(aHT).SetCmd(APassport.CSignOn).ExecuteCmd(new APassport()).IsOK()) { Authorizes.SetAuthorizeCache(Request, Response, PickParam(aHT).GetValue("passport") as Hashtable); } else { flag = "failed"; message = PickParam(aHT).GetError(); } } } else { flag = "failed"; message = PickParam(aHT1).GetError(); } } } } else { flag = "failed"; message = "验证码失效"; } return(Json(new { state = flag, message = message })); }
private void AppendNode4List(Hashtable Params) { IModelForm instance = PickParam(Params).GetValue <IModelForm>(ActionUtil.ActionID); if (instance != null) { string userId = GetControl().GetContext().GetValue <string>("USERID"); StandardGrid gridList = instance.GetActived <ListModelFormProxy>().GridControl; if (gridList.CurrentRow != null) { DataRowView curRow = (DataRowView)gridList.CurrentRow.DataBoundItem; // 得到当前层级最大编号 DataView curLevel = new DataView(((DataSet)gridList.DataSource).Tables[gridList.DataMember], "PARENTID='" + curRow["PARENTID"] + "'", "CATEGORYID DESC", DataViewRowState.CurrentRows); if (curLevel.Count == 0) { return; } int idx; string cId = curLevel[0]["CATEGORYID"].ToString().Trim(); if (int.TryParse(cId.Substring(cId.Length - 3), out idx)) { if (idx + 1 > 999) { AlertBox.ShowTips("已超过最大编码范围(0-999)!", instance, MessageBoxButtons.OK); return; } // 新编码 string nId = string.Format("{0}{1:000}", cId.Substring(0, cId.Length - 3), idx + 1); ParamUtil aPU = new ParamUtil() .SQLCmdLoadData().SQLEntityScript("BASE_CATEGORY", string.Format("SELECT * FROM BASE_CATEGORY WHERE CATEGORYID='{0}'", nId)) .ExecuteCmd(ADataLoader.DataLoader()); if (aPU.IsOK()) { bool isNew = false; #region 构建分类数据 DataRow rowNew = ((DataSet)gridList.DataSource).Tables[gridList.DataMember].NewRow(); if (aPU.GetValueAsDataSet().Tables["BASE_CATEGORY"].Rows.Count == 0) { rowNew["CATEGORYID"] = nId; rowNew["PARENTID"] = curRow["PARENTID"]; rowNew["CTYPE"] = curRow["CTYPE"]; rowNew["SEQNO"] = curRow.Row.Field <int>("SEQNO") + 1; rowNew["LEVEL"] = curRow["LEVEL"]; rowNew["ISEND"] = "Y"; rowNew["STATE"] = AosuApp.state.Enabled; rowNew["CTIME"] = DateTime.Now; rowNew["CUSER"] = userId; rowNew["ETIME"] = DateTime.Now; rowNew["EUSER"] = userId; isNew = true; } else { if (AlertBox.ShowWarning(string.Format("{0}编号已经存在,是否将数据放入当前窗体上下文中?", nId), instance, MessageBoxButtons.YesNo) != DialogResult.Yes) { return; } rowNew.ItemArray = aPU.GetValueAsDataSet().Tables["BASE_CATEGORY"].Rows[0].ItemArray; rowNew["STATE"] = AosuApp.state.Enabled; rowNew["ETIME"] = DateTime.Now; rowNew["EUSER"] = userId; } #endregion #region 插入到列表 int newIdx = 0; DataView dvChild = new DataView(((DataSet)gridList.DataSource).Tables[gridList.DataMember], "CATEGORYID LIKE '" + cId + "%'", "CATEGORYID DESC", DataViewRowState.CurrentRows); if (dvChild.Count > 0) { DataGridViewRow gridRow = gridList.Rows.OfType <DataGridViewRow>().FirstOrDefault(cm => ((DataRowView)cm.DataBoundItem)["CATEGORYID"] == dvChild[0]["CATEGORYID"]); if (gridRow != null) { newIdx = gridRow.Index + 1; } } else { DataGridViewRow gridRow = gridList.Rows.OfType <DataGridViewRow>().FirstOrDefault(cm => ((DataRowView)cm.DataBoundItem)["CATEGORYID"] == curLevel[0]["CATEGORYID"]); if (gridRow != null) { newIdx = gridRow.Index + 1; } } ((DataSet)gridList.DataSource).Tables[gridList.DataMember].Rows.InsertAt(rowNew, newIdx); if (!isNew) { // 行状态改为"Modified" rowNew.AcceptChanges(); rowNew["EUSER"] = userId; rowNew["ETIME"] = DateTime.Now; } gridList.CurrentCell = gridList[0, newIdx]; #endregion } else { AlertBox.ShowError(aPU.GetError(), instance, MessageBoxButtons.OK); } } else { AlertBox.ShowTips(string.Format("无效的分类编号{0}!"), instance, MessageBoxButtons.OK); } } } }
private void VerifyPasswrod(Hashtable Params) { string account = PickParam(Params).GetValueAsString(); string pwd = PickParam(Params).GetValueAsString("pwd"); string type = PickParam(Params).GetValueAsString("type"); try { if (type == "pay") { DataSet dsMember = new ParamUtil() .SQLCmdLoadData() .SQLWithOutSchema() .SQLEntityScript("CAIKA_MEMBER", string.Format("SELECT * FROM CAIKA_MEMBER WHERE SSOPST='{0}@caika.com'", account)) .ExecuteCmd(ADataLoader.DataLoader()) .GetValueAsDataSet(); DataRow rowMember = dsMember.Tables[0].Rows[0]; string signature = new DictSetUtil(null).DoSignature(pwd); if (signature == rowMember.Field <string>("WITHDRAWALS").Trim()) { PickParam(Params).Clear().SetParam(true); } else { PickParam(Params).Clear().SetError("密码输入不正确"); PickParam(Params).SetParam(false); } } else { // 得到通行证数据 DataSet dsPassport = new ParamUtil() .SQLCmdLoadData() .SQLEntityScript("SSODOMAINREF", string.Format("SELECT * FROM SSODOMAINREF WHERE DOMAINNAME='caika.com' AND DOMAINUSER='******'", account)) .SQLEntityScript("SSOPASSPORT", string.Format("SELECT * FROM SSOPASSPORT WHERE SSOPST = '{0}@caika.com'", account)) .ExecuteCmd(ADataLoader.DataLoader()) .GetValueAsDataSet(); if (dsPassport.Tables["SSODOMAINREF"].Rows.Count == 0 || dsPassport.Tables["SSOPASSPORT"].Rows.Count == 0) { PickParam(Params).Clear().SetError("用户名或密码错误"); PickParam(Params).SetParam(false); } else { ParamUtil aPU = new ParamUtil().SetCmd(CVerifyPasswrod).SetParam(dsPassport).SetParam("PSTPWD", pwd).ExecuteCmd(new APassport()); if (aPU.IsOK()) { PickParam(Params).Clear(); PickParam(Params).SetParam(aPU.GetValue()); } else { PickParam(Params).Clear().SetError(aPU.GetError()); PickParam(Params).SetParam(false); } } } } catch (Exception) { PickParam(Params).Clear().SetError("校验密码出错"); PickParam(Params).SetParam(false); } }
private void CreateNewAccount(Hashtable Params) { string account = PickParam(Params).GetValueAsString("DOMAINUSER"); string domain = PickParam(Params).GetValueAsString("DOMAINNAME"); try { // 注册通行证 ParamUtil register = PickParam(Params).SetCmd(APassport.CRegister).ExecuteCmd(new APassport()); if (register.IsOK()) { ParamUtil aPU = new ParamUtil() .SQLCmdLoadData() .SQLEntityScript("CAIKA_MEMBER", string.Format("SELECT * FROM CAIKA_MEMBER WHERE SSOPST='{0}'", register.GetValue())) .SQLEntityScript("CAIKA_MEMBER_MESSAGE", string.Format("SELECT * FROM CAIKA_MEMBER_MESSAGE WHERE SSOPST='{0}'", register.GetValue())) .ExecuteCmd(ADataLoader.DataLoader()); if (aPU.IsOK()) { DataSet dsPersistent = aPU.GetValueAsDataSet(); if (dsPersistent.Tables["CAIKA_MEMBER"].Rows.Count == 0) { DataRow rowNew = dsPersistent.Tables["CAIKA_MEMBER"].NewRow(); rowNew["SSOPST"] = register.GetValue(); rowNew["NICKNAME"] = account; rowNew["UPDFLAG"] = "Y"; rowNew["STATE"] = AosuApp.state.Enabled; rowNew["CTIME"] = DateTime.Now; rowNew["ETIME"] = DateTime.Now; dsPersistent.Tables["CAIKA_MEMBER"].Rows.Add(rowNew); // 添加提示信息 - 详细资料 DataRow row_message1 = AosuApp.Functions.FindRow(string.Format("MSGTYPE={0}", message_id.Account_KeyIn_DetailInfo), dsPersistent.Tables["CAIKA_MEMBER_MESSAGE"]); if (row_message1 == null) { row_message1 = dsPersistent.Tables["CAIKA_MEMBER_MESSAGE"].NewRow(); row_message1["MSGID"] = Guid.NewGuid(); row_message1["SSOPST"] = register.GetValue(); row_message1["MSGTYPE"] = message_id.Account_KeyIn_DetailInfo; row_message1["MSGTITLE"] = "请完善用户基本资料"; row_message1["MSGBODY"] = "<strong>完善用户基本资料提醒</strong><br/></br/>为了确保彩咖网更好的服务于您,请您完善<a href='/member/usercenter/grzl'><strong>个人资料信息</strong></a>。"; row_message1["STATE"] = message_state.UnRead; row_message1["CTIME"] = DateTime.Now; dsPersistent.Tables["CAIKA_MEMBER_MESSAGE"].Rows.Add(row_message1); } // 添加提示信息 - 设置提款密码 DataRow row_message2 = AosuApp.Functions.FindRow(string.Format("MSGTYPE={0}", message_id.Account_KeyIn_Withdrawals), dsPersistent.Tables["CAIKA_MEMBER_MESSAGE"]); if (row_message2 == null) { row_message2 = dsPersistent.Tables["CAIKA_MEMBER_MESSAGE"].NewRow(); row_message2["MSGID"] = Guid.NewGuid(); row_message2["SSOPST"] = register.GetValue(); row_message2["MSGTYPE"] = message_id.Account_KeyIn_Withdrawals; row_message2["MSGTITLE"] = "请设置提款密码"; row_message2["MSGBODY"] = "<strong>设置提款密码提醒</strong><br/></br/>提款密码用于提取彩咖网账户可用余额的安全密码,请您务必设置<a href='/member/usercenter/zhmm'><strong>提款密码</strong></a>。定期重新设置提款密码能提高您的账户安全性!"; row_message2["STATE"] = message_state.UnRead; row_message2["CTIME"] = DateTime.Now; dsPersistent.Tables["CAIKA_MEMBER_MESSAGE"].Rows.Add(row_message2); } // 添加提示信息 - 绑定银行卡 DataRow row_message3 = AosuApp.Functions.FindRow(string.Format("MSGTYPE={0}", message_id.Account_KeyIn_BankCard), dsPersistent.Tables["CAIKA_MEMBER_MESSAGE"]); if (row_message3 == null) { row_message3 = dsPersistent.Tables["CAIKA_MEMBER_MESSAGE"].NewRow(); row_message3["MSGID"] = Guid.NewGuid(); row_message3["SSOPST"] = register.GetValue(); row_message3["MSGTYPE"] = message_id.Account_KeyIn_BankCard; row_message3["MSGTITLE"] = "请绑定银行卡"; row_message3["MSGBODY"] = "<strong>绑定银行卡提醒</strong><br/></br/>当您购彩中奖后,彩咖网将会依据您提交的银行卡信息将彩金转入你的真实有效的银行卡账户中;所以请您务必<a href='/member/usercenter/bdyhk'><strong>绑定银行卡</strong></a>,并确保银行卡的真实有效。"; row_message3["STATE"] = message_state.UnRead; row_message3["CTIME"] = DateTime.Now; dsPersistent.Tables["CAIKA_MEMBER_MESSAGE"].Rows.Add(row_message3); } if (new ParamUtil().SQLCmdPersistent().SetParam(dsPersistent).ExecuteCmd(ADataLoader.DataLoader()).IsOK()) { // 生成账户的摘要集 DictSetUtil ds_summary = new DictSetUtil(new DataSet()); ds_summary.SetValue("TOTALAMOUNT", "0.00"); // 账户总额 ds_summary.SetValue("AVAILABLE", "0.00"); // 可用余额 ds_summary.SetValue("FREEZED", "0.00"); // 冻结金额 ds_summary.SetValue("SCORE", "0"); // 积分 ds_summary.SetValue("DEPOSITED", "0.0"); // 充值金额 ds_summary.SetValue("BONUS", "0.0"); // 中奖金额 ds_summary.SetValue("EXCHANGED", "0.0"); // 积分兑换 ds_summary.SetValue("RETURNED", "0.0"); // 游戏返点 ds_summary.SetValue("CONSUME", "0.0"); // 投注金额 ds_summary.SetValue("WITHDRAW", "0.0"); // 提款金额 // 通行证+超级密码 string key = new DictSetUtil(null).PushSLItem(PickParam(Params).GetValueAsString()).PushSLItem("6B276432FFAF4FD4E086E739009256B3") .DoSignature(); AEntryDic.Pick(GetControl()).SetDic(ds_summary.MyDS, key); } else { PickParam(Params).Clear().SetError("注册失败"); } } else { PickParam(Params).Clear().SetError("账户名已存在"); } } else { PickParam(Params).Clear().SetError(aPU.GetError()); } } else { PickParam(Params).Clear().SetError(register.GetError()); } } catch { PickParam(Params).Clear().SetError("注册失败"); } }
private void Controls_RequestValidationEvent(object sender, EventArgs e) { IControlValidation objControl = (IControlValidation)sender; objControl.IsValid = true; objControl.IsValidated = true; switch (((Control)sender).Name) { case "TxtAgentCode": if (objControl.IsEmpty) { objControl.IsValid = false; objControl.ValidationErrorMsg = "上级代理商编号不能为空!"; } else { ParamUtil aPU = new ParamUtil().SQLCmdLoadData().SQLWithOutSchema() .SQLEntityScript("BASE_CATEGORY", string.Format("SELECT CATEGORYID FROM BASE_CATEGORY WHERE CATEGORYID='{0}'", objControl.CurrentText)) .ExecuteCmd(ADataLoader.DataLoader()); if (!aPU.IsOK()) { objControl.IsValid = false; objControl.ValidationErrorMsg = aPU.GetError(); } else { if (aPU.GetValueAsDataSet().Tables["BASE_CATEGORY"].Rows.Count == 0) { objControl.IsValid = false; objControl.ValidationErrorMsg = string.Format("代理商编号[{0}]无效!", objControl.CurrentText); } } } break; case "TxtAccountID": if (objControl.IsEmpty) { objControl.IsValid = false; objControl.ValidationErrorMsg = "账户名不能为空!"; } else { if (objControl.CurrentText.Length < 4 || objControl.CurrentText.Length > 18) { objControl.IsValid = false; objControl.ValidationErrorMsg = "账户名长度必须在(4-18)之间!"; } else { // 是否存在? if (MemberDBUtils.MemberIsExist(GetControl(), TxtAccountID.Text)) { objControl.IsValid = false; objControl.ValidationErrorMsg = string.Format("账号[{0}]已经存在!", TxtAccountID.Text); } } } break; case "TxtPassword": case "TxtConfirm": if (objControl.IsEmpty) { objControl.IsValid = false; objControl.ValidationErrorMsg = "密码不能为空!"; } else { if (objControl.CurrentText.Length < 4 || objControl.CurrentText.Length > 18) { objControl.IsValid = false; objControl.ValidationErrorMsg = "密码长度必须在(4-18)之间!"; } } if (objControl.IsValidated && objControl.IsValid) { if (TxtPassword.Text != TxtConfirm.Text) { objControl.IsValid = false; objControl.ValidationErrorMsg = "两次密码输入不一致!"; if (objControl == TxtPassword && string.IsNullOrEmpty(TxtConfirm.Text)) { objControl.IsValid = true; } } else { TxtPassword.IsValid = true; TxtConfirm.IsValid = true; } } break; } if (!objControl.IsValid && objControl.IsValidated) { ((Control)objControl).Focus(); } }