protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SwitchStep(1); //检查代理域名 string agentDomain = Request.Url.Authority; int userID = FacadeManage.aideAccountsFacade.GetAccountAgentByDomain(agentDomain).UserID; string agentAccounts = FacadeManage.aideAccountsFacade.GetAccountsByUserID(userID); if (!string.IsNullOrEmpty(agentAccounts)) { txtSpreader.Text = agentAccounts; return; } else { //检查推广域名 string subDomain = GameRequest.GetSubDomain(); if (!string.IsNullOrEmpty(subDomain) && subDomain != "www" && Utils.Validate.IsNumeric(subDomain)) { string accounts = FacadeManage.aideAccountsFacade.GetAccountsBySubDomain(subDomain); if (!string.IsNullOrEmpty(accounts)) { txtSpreader.Text = accounts; return; } } } //添加推广cookie if (IntParam != 0) { WHCache.Default.Save <CookiesCache>("SpreadID", IntParam); } //不存在二级域名推广,则检查URL参数推广 object obj = WHCache.Default.Get <CookiesCache>("SpreadID"); if (obj != null && Utils.Validate.IsNumeric(obj)) { txtSpreader.Text = GetAccountsByUserID(Convert.ToInt32(obj)); } } if (IsPostBack) { RegisterAccounts(); } }
protected void Page_Load(object sender, EventArgs e) { //检查代理域名 string agentDomain = Request.Url.Authority; int userID = FacadeManage.aideAccountsFacade.GetAccountAgentByDomain(agentDomain).UserID; string gameid = userID > 0 ? GetGameIDByUserID(userID) : ""; if (!string.IsNullOrEmpty(gameid)) { txtSpreader.Text = gameid; txtSpreader.ReadOnly = true; liSpreader.Visible = false; return; } else { //检查推广域名 string subDomain = GameRequest.GetSubDomain(); if (!string.IsNullOrEmpty(subDomain) && subDomain != "www" && Utils.Validate.IsNumeric(subDomain)) { string accounts = FacadeManage.aideAccountsFacade.GetAccountsBySubDomain(subDomain); if (!string.IsNullOrEmpty(accounts)) { txtSpreader.Text = subDomain; txtSpreader.ReadOnly = true; return; } } } //添加推广cookie if (IntParam != 0) { WHCache.Default.Save <CookiesCache>("SpreadID", IntParam); } //不存在二级域名推广,则检查URL参数推广 object obj = WHCache.Default.Get <CookiesCache>("SpreadID"); if (obj != null && Utils.Validate.IsNumeric(obj)) { txtSpreader.ReadOnly = true; txtSpreader.Text = GetGameIDByUserID(Convert.ToInt32(obj)); } }
protected void Page_Load(object sender, System.EventArgs e) { if (!base.IsPostBack) { this.SwitchStep(1); string authority = base.Request.Url.Authority; int userID = FacadeManage.aideAccountsFacade.GetAccountAgentByDomain(authority).UserID; string accountsByUserID = FacadeManage.aideAccountsFacade.GetAccountsByUserID(userID); if (!string.IsNullOrEmpty(accountsByUserID)) { this.txtSpreader.Text = accountsByUserID; return; } string subDomain = GameRequest.GetSubDomain(); if (!string.IsNullOrEmpty(subDomain) && subDomain != "www" && Game.Utils.Validate.IsNumeric(subDomain)) { string accountsBySubDomain = FacadeManage.aideAccountsFacade.GetAccountsBySubDomain(subDomain); if (!string.IsNullOrEmpty(accountsBySubDomain)) { this.txtSpreader.Text = accountsBySubDomain; return; } } if (base.IntParam != 0) { WHCache.Default.Save <CookiesCache>("SpreadID", base.IntParam); } object obj = WHCache.Default.Get <CookiesCache>("SpreadID"); if (obj != null && Game.Utils.Validate.IsNumeric(obj)) { this.txtSpreader.Text = base.GetAccountsByUserID(System.Convert.ToInt32(obj)); } } if (base.IsPostBack) { this.RegisterAccounts(); } }