/// <summary> /// 返回会员账号的信息 /// </summary> /// <param name="objControl"></param> /// <param name="accountId"></param> /// <returns></returns> public static Hashtable GetMemberInfo(IControl objControl, string accountId) { // 判断会员账户是否存在? if (!MemberIsExist(objControl, accountId)) { return(new Hashtable()); } try { ParamUtil aPU = new ParamUtil(); aPU.SQLCmdLoadData(); aPU.SQLWithOutSchema(); aPU.SQLEntityScript("CAIKA_MEMBER", string.Format("SELECT ACCOUNTID,NICKNAME,TYPE,LEVEL,PHONE,EMAIL,REALNAME,CERTTYPE,CERTNUMS,ASKID1,ANSWER1,ASKID2,ANSWER2,DIGEST,STATE FROM CAIKA_MEMBER WHERE ACCOUNTID='{0}'", accountId)); if (aPU.ExecuteCmd(ADataLoader.DataLoader()).IsOK()) { return(new UriUtil() .ImportRow(aPU.GetValueAsDataSet().Tables["CAIKA_MEMBER"].Rows[0]) .ImportHashtable(ParamUtil.Pick().ImportSets(GetMemberDigest(objControl, accountId)).ParamTable) .ExportHashtable()); } } catch (Exception) { } return(new Hashtable()); }
public static Hashtable GetAuthorizeCache(HttpRequestBase Request) { Hashtable result = null; if (Request.Cookies["__sid"] != null) { string sid = Request.Cookies["__sid"].Value; string ticket = ACachTool.PickCachTool().GetValue(sid) as string; if (!string.IsNullOrEmpty(ticket)) { // 从服务器缓存中得到seession的ticket信息 FormsAuthenticationTicket authTicket = FormsAuthentication.Decrypt(ticket); if (authTicket != null && !authTicket.Expired && authTicket.UserData == Request.UserHostAddress) { Hashtable aHT = ACachTool.PickCachTool().GetValue(authTicket.Name) as Hashtable; if (aHT != null) { ParamUtil.Pick(aHT).ImportSets(MemberDBUtils.GetMemberDigest(BaseControl.GlobalControl, ParamUtil.Pick(aHT).GetValueAsString("DOMAINUSER"))); ParamUtil.Pick(aHT).SetParam("ticket", authTicket); // 缓存续期 ACachTool.PickCachTool().SetValue(sid, FormsAuthentication.Encrypt(authTicket), 30, true); ACachTool.PickCachTool().SetValue(authTicket.Name, aHT, 30, true); result = aHT; } } } } return(result); }
protected ParamUtil PickParam(Hashtable Params = null) { if (Params == null) { return(ParamUtil.Pick(new Hashtable())); } ParamUtil paramUtil = ParamUtil.Pick(Params); paramUtil.SetAction(this); return(paramUtil); }
/// <summary> /// 返回会员账户信息及通行证数据 /// </summary> /// <param name="objControl"></param> /// <param name="account"></param> /// <param name="domain"></param> /// <returns></returns> public static DataSet GetMemberAndPassport(IControl objControl, string account, string domain) { Hashtable aHT = new Hashtable(); ParamUtil.Pick(aHT).SQLEntityScript("CAIKA_MEMBER", string.Format("SELECT * FROM CAIKA_MEMBER WHERE ACCOUNTID='{0}'", account)); ParamUtil.Pick(aHT).SQLEntityScript("SSODOMAINREF", string.Format("SELECT * FROM SSODOMAINREF WHERE DOMAINUSER='******' AND DOMAINNAME='{1}'", account, domain)); ParamUtil.Pick(aHT).SQLEntityScript("SSOPASSPORT", string.Format("SELECT * FROM SSOPASSPORT WHERE SSOPST=(SELECT SSOPST FROM SSODOMAINREF WHERE DOMAINUSER='******' AND DOMAINNAME='{1}')", account, domain)); // 得到会员账户信息(包括通行证) if (ParamUtil.Pick(aHT).SQLCmdLoadData().ExecuteCmd(ADataLoader.DataLoader()).IsOK()) { return((DataSet)aHT[ActionUtil.RetResult]); } return(null); }
public JsonResult queryMessageList() { Hashtable aHT = Authorizes.GetAuthorizeCache(Request); if (aHT != null) { DataSet ds_result = AAccountUtil.GetMessageList(ParamUtil.Pick(aHT).GetValueAsString("DOMAINUSER"), Request["pageno"]); List <messageItem> rows = new List <messageItem>(); foreach (DataRow item in ds_result.Tables["list"].Rows) { messageItem a = new messageItem(); switch (item.Field <int>("MSGTYPE")) { case message_id.Account_KeyIn_BankCard: case message_id.Account_KeyIn_DetailInfo: case message_id.Account_KeyIn_Withdrawals: a.msg_type = "账户提示"; break; default: a.msg_type = "系统消息"; break; } a.msg_id = item["MSGID"].ToString(); a.title = item["MSGTITLE"].ToString(); a.ctime = Convert.ToDateTime(item["CTIME"]).ToString("yyyy/MM/dd HH:mm"); a.state = item["STATE"].ToString(); rows.Add(a); } return(Json(new { flag = "y", pagenums = ds_result.Tables["pages"].Rows.Count > 0 ? ds_result.Tables["pages"].Rows[0][0] : 0, pageno = string.IsNullOrEmpty(Request["pageno"]) ? "1" : Request["pageno"], rows = rows.ToList() })); } return(Json(new { flag = "n" })); }
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 ActionResult UserCenter(string id) { Hashtable aHT = Authorizes.GetAuthorizeCache(Request); if (aHT != null) { if (string.IsNullOrEmpty(id)) { id = "zhmx"; } PageModel model = new PageModel(this, @"model\usercenter.xml"); model.Parameters.Subpage = id; model.Parameters.Pid = string.Format("{0}{1}", id, Request["t"]); model.Parameters.Account = ParamUtil.Pick(aHT).GetValueAsString("DOMAINUSER"); model.Parameters.NickName = ParamUtil.Pick(aHT).GetValueAsString("NICKNAME"); model.Parameters.LoginTime = ParamUtil.Pick(aHT).GetValueAsString("LOGINTIME"); model.Parameters.Available = string.Format("{0:f2}", Convert.ToDecimal(aHT["AVAILABLE"])); model.Parameters.Freezed = string.Format("{0:f2}", Convert.ToDecimal(aHT["FREEZED"])); model.Parameters.Score = aHT["SCORE"].ToString(); switch (id) { case "czlink": model.Parameters.PayList = CommonDBUtils.GetPaymentList(); break; case "zhmx": // 返回账户流水清单 DataSet ds_result = new ParamUtil() .SetCmd(AAccountUtil.CGetJournalList) .SetParam(model.Parameters.Account).SetParam("type", Request["t"]).SetParam("time", Request["m"]).SetParam("pageno", Request["pageno"]) .ExecuteCmd(new AAccountUtil()) .GetValueAsDataSet(); model.Parameters.List = ds_result.Tables["list"]; DictSetUtil ds_total = new DictSetUtil(ds_result); model.Parameters.Deposited = string.Format("{0:f}", string.IsNullOrEmpty(ds_total.GetValue(journal_type.充值)) ? "0.00" : ds_total.GetValue(journal_type.充值)); model.Parameters.Bonus = string.Format("{0:f}", string.IsNullOrEmpty(ds_total.GetValue(journal_type.中奖)) ? "0.00" : ds_total.GetValue(journal_type.中奖)); model.Parameters.Exchanged = string.Format("{0:f}", string.IsNullOrEmpty(ds_total.GetValue(journal_type.积分兑换)) ? "0.00" : ds_total.GetValue(journal_type.积分兑换)); model.Parameters.Returned = string.Format("{0:f}", string.IsNullOrEmpty(ds_total.GetValue(journal_type.返点)) ? "0.00" : ds_total.GetValue(journal_type.返点)); model.Parameters.Consume = string.Format("{0:f}", string.IsNullOrEmpty(ds_total.GetValue(journal_type.投注)) ? "0.00" : ds_total.GetValue(journal_type.投注)); model.Parameters.Withdraw = string.Format("{0:f}", string.IsNullOrEmpty(ds_total.GetValue(journal_type.提现)) ? "0.00" : ds_total.GetValue(journal_type.提现)); model.Parameters.Type = Request["t"]; model.Parameters.Time = Request["m"]; model.Parameters.PageNo = string.IsNullOrEmpty(Request["pageno"]) ? "1" : Request["pageno"]; model.Parameters.PageNums = 0; if (ds_result.Tables["pages"].Rows.Count > 0) { model.Parameters.PageNums = ds_result.Tables["pages"].Rows[0][0]; } break; case "zhmm": model.Parameters.WithdrawIsEmpty = AAccountUtil.WithdrawIsEmpty(ParamUtil.Pick(aHT).GetValueAsString("DOMAINUSER")); break; case "bdyhk": model.Parameters.Provinces = CommonDBUtils.GetAreas(); // 返回账户的绑定的银行卡数据 DictSetUtil ds_bank = new DictSetUtil(AAccountUtil.GetBankData(ParamUtil.Pick(aHT).GetValueAsString("DOMAINUSER"))); model.Parameters.BankData = ds_bank.MyDS; model.Parameters.HaveBank = ds_bank.DSxtcs.Rows.Count > 0; break; case "grzl": DictSetUtil ds_info = new DictSetUtil(AAccountUtil.GetMemberInfo(ParamUtil.Pick(aHT).GetValueAsString("DOMAINUSER"))); model.Parameters.MemberInfo = ds_info.MyDS; model.Parameters.InfoIsFull = !string.IsNullOrEmpty(ds_info.GetValue("REALNAME")) && !string.IsNullOrEmpty(ds_info.GetValue("UID")) && !string.IsNullOrEmpty(ds_info.GetValue("ANSWER")); break; case "msglist": DataSet ds_msglist = AAccountUtil.GetMessageList(ParamUtil.Pick(aHT).GetValueAsString("DOMAINUSER"), Request["pageno"]); model.Parameters.List = ds_msglist.Tables["list"]; model.Parameters.PageNums = ds_msglist.Tables["pages"].Rows.Count > 0 ? ds_msglist.Tables["pages"].Rows[0][0] : 0; model.Parameters.PageNo = string.IsNullOrEmpty(Request["pageno"]) ? "1" : Request["pageno"]; break; } return(View("UserCenter", model)); } return(Redirect("/")); }
/// <summary> /// 创建一个新的会员账号 /// </summary> /// <param name="objControl"></param> /// <param name="Params"></param> public static void CreateMemberRecord(IControl objControl, Hashtable Params) { Hashtable aHT = new Hashtable(); ParamUtil.Pick(aHT).SQLEntityScript("CAIKA_MEMBER", string.Format("SELECT * FROM CAIKA_MEMBER WHERE ACCOUNTID='{0}'", Params["DOMAINUSER"])); ParamUtil.Pick(aHT).SQLEntityScript("BASE_CATEGORY", string.Format("SELECT * FROM BASE_CATEGORY WHERE CATEGORYID LIKE '{0}%' ORDER BY CATEGORYID DESC", Params["PARENTAGENT"])); // 得到一个待持久化的记录集 if (ParamUtil.Pick(aHT).SQLCmdLoadData().ExecuteCmd(ADataLoader.DataLoader()).IsOK()) { DataSet dsPersistent = ParamUtil.Pick(aHT).GetValueAsDataSet(); if (dsPersistent.Tables["CAIKA_MEMBER"].Rows.Count == 0) { // 生成当前账号的代理编号 if (ParamUtil.Pick(Params).IsNullOrEmpty("PARENTAGENT") || dsPersistent.Tables["BASE_CATEGORY"].Rows.Count == 0) { throw new Exception("参数列表中没有解析到上级代理商编号。"); } string strAgentCode = ""; int intLevel = 0; int intSeqNo = 0; if (dsPersistent.Tables["BASE_CATEGORY"].Rows.Count == 1) { strAgentCode = string.Format("{0}001", Params["PARENTAGENT"]); intLevel = Convert.ToInt32(dsPersistent.Tables["BASE_CATEGORY"].Rows[0]["LEVEL"]) + 1; intSeqNo = 1; } else { int idx = 0; string curCode = dsPersistent.Tables["BASE_CATEGORY"].Rows[0]["CATEGORYID"] + ""; if (!int.TryParse(curCode.Substring(curCode.Length - 3), out idx)) { throw new Exception(string.Format("解析代理商{0}的索引值出错。", dsPersistent.Tables["BASE_CATEGORY"].Rows[0]["CATEGORYID"])); } if ((idx + 1) > 998) { throw new Exception(string.Format("代理商{0}的下级代理数量已满。", Params["PARENTAGENT"])); } strAgentCode = Params["PARENTAGENT"] + (idx + 1).ToString().PadLeft(3, '0'); intLevel = Convert.ToInt32(dsPersistent.Tables["BASE_CATEGORY"].Rows[0]["LEVEL"]); intSeqNo = Convert.ToInt32(dsPersistent.Tables["BASE_CATEGORY"].Rows[0]["SEQNO"]) + 1; } DataRow rowNew = dsPersistent.Tables["CAIKA_MEMBER"].NewRow(); rowNew["ACCOUNTID"] = Params["DOMAINUSER"]; rowNew["NICKNAME"] = Params["DOMAINUSER"]; rowNew["TYPE"] = Params["TYPE"]; if (Params["TYPE"].ToString() == account_type.AgentAccount) { rowNew["LEVEL"] = member_level.L3; } else { rowNew["LEVEL"] = member_level.L5; } rowNew["AGENTCODE"] = strAgentCode; rowNew["CERTTYPE"] = "身份证"; rowNew["STATE"] = state.Enabled; rowNew["CTIME"] = DateTime.Now; rowNew["CUSER"] = objControl.GetContext().MyInfo["USERID"]; rowNew["ETIME"] = DateTime.Now; rowNew["EUSER"] = objControl.GetContext().MyInfo["USERID"]; // 通行证+超级密码 string key = new DictSetUtil(null) .PushSLItem(string.Format("{0}@{1}", Params["DOMAINUSER"], Params["DOMAINNAME"])) .DoSignature(); rowNew["DIGEST"] = key; DictSetUtil dictDigest = new DictSetUtil(ParamUtil.Pick(Params).GetValueAsDataSet()); rowNew["TOTALAMOUNT"] = dictDigest.GetValue("TOTALAMOUNT"); rowNew["AVAILABLE"] = dictDigest.GetValue("AVAILABLE"); rowNew["FREEZED"] = dictDigest.GetValue("FREEZED"); rowNew["SCORE"] = dictDigest.GetValue("SCORE"); dsPersistent.Tables["CAIKA_MEMBER"].Rows.Add(rowNew); DataRow rowAgent = dsPersistent.Tables["BASE_CATEGORY"].NewRow(); rowAgent["CATEGORYID"] = strAgentCode; rowAgent["NAME"] = Params["DOMAINUSER"]; rowAgent["DESC"] = Params["DOMAINUSER"]; rowAgent["PARENTID"] = Params["PARENTAGENT"]; rowAgent["LEVEL"] = intLevel; rowAgent["SEQNO"] = intSeqNo; rowAgent["ISEND"] = "Y"; rowAgent["CTYPE"] = category.CType_Label; rowAgent["STATE"] = state.Enabled; rowAgent["CTIME"] = DateTime.Now; rowAgent["CUSER"] = objControl.GetContext().MyInfo["USERID"]; rowAgent["ETIME"] = DateTime.Now; rowAgent["EUSER"] = objControl.GetContext().MyInfo["USERID"]; dsPersistent.Tables["BASE_CATEGORY"].Rows.Add(rowAgent); dsPersistent.Tables["BASE_CATEGORY"].Rows[dsPersistent.Tables["BASE_CATEGORY"].Rows.Count - 1]["ISEND"] = "N"; if (new ParamUtil().SQLCmdPersistent().SetParam(dsPersistent).ExecuteCmd(ADataLoader.DataLoader()).IsOK()) { // 会员账户的金额摘要数据 if (AEntryDic.Pick(objControl).SetDic(dictDigest.MyDS, key)) { ParamUtil.Pick(Params).Clear(); ParamUtil.Pick(Params).SetError(ActionUtil.DefaultError); } } } } }