protected void ddlZoneList_SelectedIndexChanged(object sender, EventArgs e) { var zoneId = ddlZoneList.SelectedValue; var zoneCache = AllZoneinfoMgr.GetById(Convert.ToInt32(zoneId)); if (zoneCache == null) { return; } var platform = AllUaplatformMgr.GetByCode(zoneCache.PlatformCode); if (platform == null) { return; } txtLoginAddress.Text = zoneCache.ApiUrl; txtLoginKey.Text = platform.LoginKey; txtLoginPlatform.Text = platform.PlatformCode; txtLoginUsername.Text = "dbbb"; txtChargeAddress.Text = zoneCache.ApiUrl; txtChargeCash.Text = "1"; txtChargeKey.Text = platform.ChargeKey; txtChargeOrderId.Text = string.Format("AdminTest@{0:yyyyMMddHHmmssfff}", DateTime.Now); txtChargePlatform.Text = platform.PlatformCode; txtChargeUsername.Text = "dbbb"; txtCharegeServerId.Text = zoneCache.PlatformZoneName; }
private CrossSiteCache() { try { s_lstDomains.Clear(); s_dicDomains.Clear(); s_dicSites.Clear(); s_lstSites.Clear(); ConfigCrosssiteEntity siteItem = null; var sites = ConfigCrosssiteMgr.GetAll(); var zones = AllZoneinfoMgr.GetAllForFactory(); foreach (var item in sites) { s_dicSites[item.SiteId] = item; if (!s_dicDomains.ContainsKey(item.DomainId)) { s_dicDomains[item.DomainId] = new List <string>(); } s_dicDomains[item.DomainId].Add(item.SiteId); s_lstSites.Add(item); } foreach (var item in zones) { if (s_dicSites.ContainsKey(item.ZoneName)) { continue; } siteItem = GetSiteItem(item); s_dicSites[siteItem.SiteId] = siteItem; if (!s_dicDomains.ContainsKey(siteItem.DomainId)) { s_dicDomains[siteItem.DomainId] = new List <string>(); } s_dicDomains[siteItem.DomainId].Add(siteItem.SiteId); s_lstSites.Add(siteItem); s_lstSitesName.Add(item.ZoneName); } foreach (var val in s_dicDomains.Keys) { s_lstDomains.Add(val); } this.InitFlag = true; } catch (Exception ex) { SystemlogMgr.Error("CrossSiteCache:Init", ex); this.InitFlag = false; } }
protected void ddlPlatform_SelectedIndexChanged(object sender, EventArgs e) { var platform = ddlPlatform.SelectedValue; var list = AllZoneinfoMgr.GetByPlatform(platform); ddlZoneList.DataSource = list; ddlZoneList.DataTextField = "ZoneName"; ddlZoneList.DataValueField = "Idx"; ddlZoneList.DataBind(); if (list != null && list.Count > 0) { ddlZoneList.SelectedIndex = 0; ddlZoneList_SelectedIndexChanged(null, null); } }
private void Init() { try { var list = AllZoneinfoMgr.GetAllForFactory(); _zoneWebServerDic = list.ToDictionary(d => d.ZoneName.ToLower(), d => d.WebServerUrl); _zoneWebServerPlatformDic = list.ToDictionary(d => BuildZoneKey(d.PlatformCode, d.PlatformZoneName), d => d.WebServerUrl); _zoneIdPlatDic = list.ToDictionary(d => d.ZoneName.ToLower(), d => d.PlatformZoneName.ToLower()); _zoneApiUrlDic = list.ToDictionary(d => d.ZoneName.ToLower(), d => d.ApiUrl); } catch (Exception ex) { LogHelper.Insert(ex); } }
protected void btn_SendPrize_Click(object sender, EventArgs e) { int matchId = ConvertHelper.ConvertToInt(txtSendMatchId.Text.Trim()); if (matchId == 0) { ShowMessage("比赛ID不能为0"); return; } var allzone = AllZoneinfoMgr.GetAll(); foreach (var item in allzone) { SendPrize(matchId, item.ZoneName); } ShowMessage("发奖完成"); }
void InitCache() { LogHelper.Insert("Function app cache init start", LogType.Info); var list = AllAppMgr.GetAllForFactory(); _appDic = list.ToDictionary(d => d.Name, d => d.Idx); var list2 = AllLogfunctionMgr.GetAllForFactory(); _functionDic = list2.ToDictionary(d => d.Name, d => d.Idx); var list3 = AllZoneinfoMgr.GetAllForFactory(); foreach (var entity in list3) { entity.ApiHost = entity.ApiUrl.ToLower().Replace("http://", "").TrimEnd('/'); } _zoneDic = list3.ToDictionary(d => d.ZoneName.ToLower(), d => d); _zonePlatformDic = list3.ToDictionary(d => BuildZoneKey(d.PlatformCode, d.PlatformZoneName), d => d); LogHelper.Insert("Function app cache init end", LogType.Info); }
void InitCache() { _zoneDic = new Dictionary <string, AllZoneinfoEntity>(); _platFormZoneDic = new Dictionary <string, List <AllZoneinfoEntity> >(); _qunheiZoneList = new List <AllZoneinfoEntity>(); _aloneZoneList = new List <AllZoneinfoEntity>(); _mixtureZoneList = new List <AllZoneinfoEntity>(); _wanBaZoneList = new List <AllZoneinfoEntity>(); _wanBaZoneListIos = new List <AllZoneinfoEntity>(); _qunheiAnd9GList = new List <AllZoneinfoEntity>(); _egretZoneList = new List <AllZoneinfoEntity>(); _bearZoneList = new List <AllZoneinfoEntity>(); _allZoneList = AllZoneinfoMgr.GetAll(); foreach (var item in _allZoneList) { if (!_platFormZoneDic.ContainsKey(item.PlatformCode)) { _platFormZoneDic.Add(item.PlatformCode, new List <AllZoneinfoEntity>()); } _platFormZoneDic[item.PlatformCode].Add(item); int platzoneId = ConvertHelper.ConvertToInt(item.PlatformZoneName); if (!_zoneDic.ContainsKey(item.ZoneName)) { _zoneDic.Add(item.ZoneName, item); } if (ShareUtil.IsTx) { if (platzoneId > 1000 && platzoneId < 10000) { _wanBaZoneList.Add(item); } else if (platzoneId > 10000) { _wanBaZoneListIos.Add(item); } continue; } if (item.PlatformCode == "h5_egret") { _egretZoneList.Add(item); } else if (item.PlatformCode == "h5_qunhei") { _qunheiZoneList.Add(item); } //if (platzoneId == 1001) //{ // _egretZoneList.Add(item); //} //else if (platzoneId == 1003) { _bearZoneList.Add(item); } else if (platzoneId == 1) { _mixtureZoneList.Add(item); _aloneZoneList.Add(item); _qunheiAnd9GList.Add(item); } else if (platzoneId < 1000) { if (platzoneId == 2) { _qunheiAnd9GList.Add(item); } _aloneZoneList.Add(item); } else { if (platzoneId != 10002) { _qunheiAnd9GList.Add(item); } _mixtureZoneList.Add(item); } } }
public void SendPrize() { try { var package = ItemCore.Instance.GetPackage(new Guid("731DF1FF-B4ED-4932-989B-A60E01314832"), EnumTransactionType.AdminAddItem, AllZoneinfoMgr.GetById(1004).ZoneName); var result = package.AddItems(120006, 1, 1, false, false); if (result == MessageCode.Success) { bool isSuccess = package.Save(); if (isSuccess) { package.Shadow.Save(); } } } catch (Exception ex) { SystemlogMgr.Error("Admin AddItems", ex); } }
private SiteMapCache() { try { s_dicPlats.Clear(); s_dicSites.Clear(); s_dicPlatSites.Clear(); s_dicUaPlats.Clear(); var plats = AllPlatmapMgr.GetAll(); var sites = AllSitemapMgr.GetAll(); var uaPlats = AllUaplatformMgr.GetAll(); var zones = AllZoneinfoMgr.GetAll(); string factCode = FactoryCode; AllPlatmapEntity root = null; foreach (var item in plats) { item.PlatCode = item.PlatCode.ToLower(); s_dicPlats[item.PlatCode] = item; if (null == root && string.Compare(factCode, item.PlatCode, true) == 0) { root = item; } } foreach (var item in zones) { if (string.Compare(item.ZoneName, SiteId, true) == 0) { PlatCode = item.PlatformCode; ZoneIno = item; break; } if (!s_zoneDic.ContainsKey(item.PlatformCode + item.ZoneName)) { s_zoneDic.Add(item.PlatformCode + item.ZoneName, item); } s_zoneDic[item.PlatformCode + item.ZoneName] = item; } foreach (var item in sites) { if (string.Compare(factCode, item.PlatCode, true) != 0) { continue; } s_dicSites[item.SiteId] = item; s_dicPlatSites[item.PlatSiteId] = item; if (null == root) { continue; } if (string.IsNullOrEmpty(item.PlatMainUrl)) { item.PlatMainUrl = root.PlatMainUrl; } if (string.IsNullOrEmpty(item.PlatApiUrl)) { item.PlatApiUrl = root.PlatApiUrl; } if (string.IsNullOrEmpty(item.PayUrl)) { item.PayUrl = root.PayUrl; } if (string.IsNullOrEmpty(item.BbsUrl)) { item.BbsUrl = root.BbsUrl; } if (string.IsNullOrEmpty(item.NavUrl)) { item.NavUrl = root.NavUrl; } if (string.IsNullOrEmpty(item.CdnUrl)) { item.CdnUrl = root.CdnUrl; } if (string.IsNullOrEmpty(item.ChatUrl)) { item.ChatUrl = root.ChatUrl; } } foreach (var item in uaPlats) { s_dicUaPlats[item.PlatformCode.ToLower()] = item; } this.InitFlag = true; } catch (Exception ex) { SystemlogMgr.Error("SiteMapCache:Init", ex); this.InitFlag = false; } }
void Init() { try { _errorPage = "/Error.aspx"; _factory = ConfigurationManager.AppSettings["FactoryName"].ToLower(); JumpScript = ConfigurationManager.AppSettings["JumpScript"]; ZoneName = ConfigurationManager.AppSettings["ZoneName"].ToLower(); var ualog = ConfigurationManager.AppSettings["OpenUALog"]; _zoneDic = new Dictionary <string, AllZoneinfoEntity>(); _zoneNameDic = new Dictionary <string, AllZoneinfoEntity>(); if (!string.IsNullOrEmpty(ualog) && ualog == "1") { OpenUALog = true; } var timeout = ConfigurationManager.AppSettings["UATimeOut"]; var uARequestRecord = ConfigurationManager.AppSettings["UARequestRecord"]; if (!string.IsNullOrEmpty(uARequestRecord) && uARequestRecord == "1") { _uARequestRecord = true; } var zoneInfoList = AllZoneinfoMgr.GetByPlatform(FactoryName); foreach (var item in zoneInfoList) { if (!_zoneDic.ContainsKey(item.ZoneName)) { _zoneDic.Add(item.ZoneName, null); } _zoneDic[item.ZoneName] = item; if (!_zoneNameDic.ContainsKey(item.PlatformCode + item.PlatformZoneName)) { _zoneNameDic.Add(item.PlatformCode + item.PlatformZoneName, null); } _zoneNameDic[item.PlatformCode + item.PlatformZoneName] = item; } string className = _factory.ToLower(); if (!string.IsNullOrEmpty(_factory)) { if (_factory.Contains("gov_")) { className = "gov"; } } if (!string.IsNullOrEmpty(_factory)) { if (_factory.Contains("h5_a8")) { className = "A8"; } } if (!string.IsNullOrEmpty(_factory)) { if (_factory.Contains("txh5_a8")) { className = "wbTx"; } } if (!string.IsNullOrEmpty(_factory)) { if (_factory.Contains("h5_wb")) { className = "wbTx"; } } if (!string.IsNullOrEmpty(_factory)) { if (_factory.Contains("h5_egret")) { className = "egret"; } } if (!string.IsNullOrEmpty(_factory)) { if (_factory.Contains("h5_bear")) { className = "bear"; } } if (!string.IsNullOrEmpty(_factory)) { if (_factory.Contains("h5_qunhei")) { className = "qunhei"; } } if (!string.IsNullOrEmpty(timeout)) { var t = ConvertHelper.ConvertToInt(timeout); if (t > 0) { _timeout = t; } } _adapter = UAAdapter.GetInstance(className); var platforms = GetPlatformList(_factory); if (platforms == null || platforms.Count <= 0) { SystemlogMgr.Error("UaFactory create", "UaFactory config is null,factory:" + _factory); } else { _platformDic = platforms.ToDictionary(d => d.PlatformCode, d => d); _platformUrl = platforms[0].PlatformUrl; _defaultPlatform = platforms[0]; } if (IsTx) { var appId = ConfigAppsettingMgr.GetById(20004); if (appId != null) { _txAppId = ConvertHelper.ConvertToInt(appId.Value); } var appKey = ConfigAppsettingMgr.GetById(20005); if (appKey != null) { _txAppKey = appKey.Value; } } } catch (Exception ex) { SystemlogMgr.Error("UaFactory create", ex); throw ex; } }