protected void Page_Load(object sender, EventArgs e) { openAddCountry.ToolTip = Translate("btnAddCountryTooltip"); lblNew.Text = Translate("lblNew"); _startDate = FirstDayOfMonthFromDateTime(DateTime.Today.AddMonths(-12)); _endDate = LastDayOfMonthFromDateTime(DateTime.Today); if (!Page.IsPostBack) { //First Load Countries From Thads Search DSPU.DSPortalUsers dspus = new DSPU.DSPortalUsers(); ssoGUID = UserInfo.Profile.GetPropertyValue("ssoGUID"); var resp = dspus.GetPortalsForUser("CASAUTH", "thecatsaysmeow3", ssoGUID); //DSPortalsService.DSPortalsSoapClient dsw = new DSPortalsService.DSPortalsSoapClient(); //var resp = dsw.GetPortalsForUserJson(ssoGUID).Distinct(); var thisInstance = StaffBrokerFunctions.GetSetting("DataserverURL", PortalId); if (String.IsNullOrEmpty(thisInstance)) thisInstance = "-unknownLocation"; // MyCountries.Items.Add(new ListItem("South Africa", "https://tntdataserver.com/dataserver/rsa/dataquery/dataqueryservice.asmx")); ////MyCountries.Items.Add(new ListItem("Bulgaria Test", "https://tntdataserver.eu/dataserver/bgr/dataquery/dataqueryservice.asmx")); foreach (var p in resp.OrderByDescending(x => x.PortalUri.Contains(thisInstance)).ThenBy(y => y.PortalName)) { MyCountries.Items.Add(new ListItem(p.PortalName, p.PortalUri)); } MinistryView.MinistryViewDataContext dm = new MinistryView.MinistryViewDataContext(); var addCountries = from c in dm.MinistryView_UserCountryProfiles where c.GUID == ssoGUID select new { c.UserCountryProfileId, c.MinistryView_AdditionalCountry.CountryName }; foreach (var row in addCountries) { MyCountries.Items.Add(new ListItem(row.CountryName, "ADD" + row.UserCountryProfileId)); } //MyCountries.Items.Add(new ListItem("devtest","https://tntdataserver.eu/dataserver/devtest/dataquery/dataqueryservice.asmx")); //MyCountries.Items.Add(new ListItem("AgapeAOA","https://tntdataserver.eu/dataserver/AgapeAOA/dataquery/dataqueryservice.asmx")); //// if (MyCountries.Items.Count > 0) { MyCountries_SelectedIndexChanged(this, null); lblMessage.Visible = false; } else { lblMessage.Text = Translate("lblMessage"); string Message = "No DataServer accounts for: " + UserInfo.DisplayName + "(" + UserId.ToString() + ") " + ssoGUID + "CountryCount:" + MyCountries.Items.Count.ToString() + ";" + (resp.Count()).ToString(); DotNetNuke.Services.Log.EventLog.EventLogController objEventLog = new DotNetNuke.Services.Log.EventLog.EventLogController(); objEventLog.AddLog("Accounts", Message, PortalSettings, UserId, Services.Log.EventLog.EventLogController.EventLogType.ADMIN_ALERT); lblMessage.Visible = true; accordion.Visible = false; divBalance.Visible = false; IncExpGraph.Visible = false; } } // InitializeValues(); }
protected void Page_Load(object sender, EventArgs e) { openAddCountry.ToolTip = Translate("btnAddCountryTooltip"); lblNew.Text = Translate("lblNew"); _startDate = FirstDayOfMonthFromDateTime(DateTime.Today.AddMonths(-12)); _endDate = LastDayOfMonthFromDateTime(DateTime.Today); if (!Page.IsPostBack) { //First Load Countries From Thads Search DSPU.DSPortalUsers dspus = new DSPU.DSPortalUsers(); ssoGUID = UserInfo.Profile.GetPropertyValue("ssoGUID"); var resp = dspus.GetPortalsForUser("CASAUTH", "thecatsaysmeow3", ssoGUID); //DSPortalsService.DSPortalsSoapClient dsw = new DSPortalsService.DSPortalsSoapClient(); //var resp = dsw.GetPortalsForUserJson(ssoGUID).Distinct(); var thisInstance = StaffBrokerFunctions.GetSetting("DataserverURL", PortalId); if (String.IsNullOrEmpty(thisInstance)) { thisInstance = "-unknownLocation"; } // MyCountries.Items.Add(new ListItem("South Africa", "https://tntdataserver.com/dataserver/rsa/dataquery/dataqueryservice.asmx")); ////MyCountries.Items.Add(new ListItem("Bulgaria Test", "https://tntdataserver.eu/dataserver/bgr/dataquery/dataqueryservice.asmx")); foreach (var p in resp.OrderByDescending(x => x.PortalUri.Contains(thisInstance)).ThenBy(y => y.PortalName)) { MyCountries.Items.Add(new ListItem(p.PortalName, p.PortalUri)); } MinistryView.MinistryViewDataContext dm = new MinistryView.MinistryViewDataContext(); var addCountries = from c in dm.MinistryView_UserCountryProfiles where c.GUID == ssoGUID select new { c.UserCountryProfileId, c.MinistryView_AdditionalCountry.CountryName }; foreach (var row in addCountries) { MyCountries.Items.Add(new ListItem(row.CountryName, "ADD" + row.UserCountryProfileId)); } //MyCountries.Items.Add(new ListItem("devtest","https://tntdataserver.eu/dataserver/devtest/dataquery/dataqueryservice.asmx")); //MyCountries.Items.Add(new ListItem("AgapeAOA","https://tntdataserver.eu/dataserver/AgapeAOA/dataquery/dataqueryservice.asmx")); //// if (MyCountries.Items.Count > 0) { MyCountries_SelectedIndexChanged(this, null); lblMessage.Visible = false; } else { lblMessage.Text = Translate("lblMessage"); string Message = "No DataServer accounts for: " + UserInfo.DisplayName + "(" + UserId.ToString() + ") " + ssoGUID + "CountryCount:" + MyCountries.Items.Count.ToString() + ";" + (resp.Count()).ToString(); DotNetNuke.Services.Log.EventLog.EventLogController objEventLog = new DotNetNuke.Services.Log.EventLog.EventLogController(); objEventLog.AddLog("Accounts", Message, PortalSettings, UserId, Services.Log.EventLog.EventLogController.EventLogType.ADMIN_ALERT); lblMessage.Visible = true; accordion.Visible = false; divBalance.Visible = false; IncExpGraph.Visible = false; } } // InitializeValues(); }