static public int GetNewAdvId(int PortalId) { string NextAdvID = StaffBrokerFunctions.GetSetting("NextAdvID", PortalId); if (NextAdvID == "") { StaffRmbDataContext d = new StaffRmbDataContext(); var MaxAdvID = (from c in d.AP_Staff_AdvanceRequests where c.PortalId == PortalId select c.LocalAdvanceId); if (MaxAdvID.Count() == 0) { StaffBrokerFunctions.SetSetting("NextAdvID", "2", PortalId); return(1); } else { StaffBrokerFunctions.SetSetting("NextAdvID", (MaxAdvID.Max() + 1).ToString(), PortalId); return((int)MaxAdvID.First()); } } else { StaffBrokerFunctions.SetSetting("NextAdvID", (Convert.ToInt32(NextAdvID) + 1).ToString(), PortalId); return(Convert.ToInt32(NextAdvID)); } }
protected void Page_Load(object sender, EventArgs e) { _startDate = FirstDayOfMonthFromDateTime(DateTime.Today.AddMonths(-12)); _endDate = LastDayOfMonthFromDateTime(DateTime.Today); if (!Page.IsPostBack) { //First Load Countries From Thads Search DSPortalsService.DSPortalsSoapClient dsw = new DSPortalsService.DSPortalsSoapClient(); var ssoGUID = UserInfo.Profile.GetPropertyValue("ssoGUID"); 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")); foreach (DSPortalsService.DataserverPortal p in resp.OrderByDescending(x => x.InstanceUri.Contains(thisInstance)).ThenBy(y => y.InstanceName)) { MyCountries.Items.Add(new ListItem(p.InstanceName, p.InstanceUri)); } //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 = "We cannot find an tntDataserver account for you in any country. Please contact the countries in which you receive donations, as ask them to add your TheKey account to their dataserver."; 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; } } // InitializeValues(); }
private void PopulateDropdowns() { if (_myAccounts != null) { MyCountries.Visible = true; MyCountries.DataSource = _myAccounts.Countries; MyCountries.DataTextField = "Name"; MyCountries.DataValueField = "URL"; MyCountries.DataBind(); MyCountries.SelectedValue = StaffBrokerFunctions.GetSetting("https://tntdataserver.eu/dataserver/devtest/dataquery/dataqueryservice.asmx", PortalId); MyCountries_SelectedIndexChanged(this, null); } }
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(); }