public static void SetPopulationStatus(Guid tenantId, PopulationStatus status, string testTenantManagementUrl = "https://tws.365upgrade.microsoftonline.com/TestTenantManagementService.svc") { using (ProxyWrapper <TestTenantManagementClient, ITestTenantManagement> proxyWrapper = new ProxyWrapper <TestTenantManagementClient, ITestTenantManagement>(new Uri(testTenantManagementUrl), PopulationValidationUtils.TestTenantManagementCert)) { proxyWrapper.Proxy.UpdateTenantPopulationStatus(tenantId, status); } }
private IAsyncResult OnBeginUpdateTenantPopulationStatus(object[] inValues, AsyncCallback callback, object asyncState) { Guid tenantId = (Guid)inValues[0]; PopulationStatus status = (PopulationStatus)inValues[1]; return(this.BeginUpdateTenantPopulationStatus(tenantId, status, callback, asyncState)); }
private IAsyncResult OnBeginUpdateTenantPopulationStatusWithScenario(object[] inValues, AsyncCallback callback, object asyncState) { Guid tenantId = (Guid)inValues[0]; PopulationStatus status = (PopulationStatus)inValues[1]; string scenario = (string)inValues[2]; string comment = (string)inValues[3]; return(this.BeginUpdateTenantPopulationStatusWithScenario(tenantId, status, scenario, comment, callback, asyncState)); }
public static List <Guid> GetTenantsBasedOnPopulationStatus(PopulationStatus status, string testTenantManagementUrl = "https://tws.365upgrade.microsoftonline.com/TestTenantManagementService.svc", string serviceInstancePrefix = "Exchange/namprd03") { List <Guid> list = new List <Guid>(); using (ProxyWrapper <TestTenantManagementClient, ITestTenantManagement> proxyWrapper = new ProxyWrapper <TestTenantManagementClient, ITestTenantManagement>(new Uri(testTenantManagementUrl), PopulationValidationUtils.TestTenantManagementCert)) { Tenant[] array = proxyWrapper.Proxy.QueryTenantsToPopulate(status); foreach (Tenant tenant in array) { if (string.IsNullOrEmpty(serviceInstancePrefix) || tenant.ExchangeServiceInstance.StartsWith(serviceInstancePrefix, true, CultureInfo.InvariantCulture)) { list.Add(tenant.TenantId); } } } return(list); }
public void QueryTenantsToPopulateAsync(PopulationStatus status, object userState) { if (this.onBeginQueryTenantsToPopulateDelegate == null) { this.onBeginQueryTenantsToPopulateDelegate = new ClientBase <ITestTenantManagement> .BeginOperationDelegate(this.OnBeginQueryTenantsToPopulate); } if (this.onEndQueryTenantsToPopulateDelegate == null) { this.onEndQueryTenantsToPopulateDelegate = new ClientBase <ITestTenantManagement> .EndOperationDelegate(this.OnEndQueryTenantsToPopulate); } if (this.onQueryTenantsToPopulateCompletedDelegate == null) { this.onQueryTenantsToPopulateCompletedDelegate = new SendOrPostCallback(this.OnQueryTenantsToPopulateCompleted); } base.InvokeAsync(this.onBeginQueryTenantsToPopulateDelegate, new object[] { status }, this.onEndQueryTenantsToPopulateDelegate, this.onQueryTenantsToPopulateCompletedDelegate, userState); }
public void UpdateTenantPopulationStatusAsync(Guid tenantId, PopulationStatus status, object userState) { if (this.onBeginUpdateTenantPopulationStatusDelegate == null) { this.onBeginUpdateTenantPopulationStatusDelegate = new ClientBase <ITestTenantManagement> .BeginOperationDelegate(this.OnBeginUpdateTenantPopulationStatus); } if (this.onEndUpdateTenantPopulationStatusDelegate == null) { this.onEndUpdateTenantPopulationStatusDelegate = new ClientBase <ITestTenantManagement> .EndOperationDelegate(this.OnEndUpdateTenantPopulationStatus); } if (this.onUpdateTenantPopulationStatusCompletedDelegate == null) { this.onUpdateTenantPopulationStatusCompletedDelegate = new SendOrPostCallback(this.OnUpdateTenantPopulationStatusCompleted); } base.InvokeAsync(this.onBeginUpdateTenantPopulationStatusDelegate, new object[] { tenantId, status }, this.onEndUpdateTenantPopulationStatusDelegate, this.onUpdateTenantPopulationStatusCompletedDelegate, userState); }
public void UpdateTenantPopulationStatusWithScenario(Guid tenantId, PopulationStatus status, string scenario, string comment) { base.Channel.UpdateTenantPopulationStatusWithScenario(tenantId, status, scenario, comment); }
public void QueryTenantsToPopulateAsync(PopulationStatus status) { this.QueryTenantsToPopulateAsync(status, null); }
private IAsyncResult OnBeginQueryTenantsToPopulate(object[] inValues, AsyncCallback callback, object asyncState) { PopulationStatus status = (PopulationStatus)inValues[0]; return(this.BeginQueryTenantsToPopulate(status, callback, asyncState)); }
public IAsyncResult BeginQueryTenantsToPopulate(PopulationStatus status, AsyncCallback callback, object asyncState) { return(base.Channel.BeginQueryTenantsToPopulate(status, callback, asyncState)); }
public Tenant[] QueryTenantsToPopulate(PopulationStatus status) { return(base.Channel.QueryTenantsToPopulate(status)); }
public void UpdateTenantPopulationStatusWithScenarioAsync(Guid tenantId, PopulationStatus status, string scenario, string comment) { this.UpdateTenantPopulationStatusWithScenarioAsync(tenantId, status, scenario, comment, null); }
public FactsheetRepository() { var requestUrl = HttpContext.Current.Server.UrlDecode(HttpContext.Current.Request.Url.Segments.Last()); /*Setup for array of Segments' id number is for Live server, Change this for local machine if require. */ int idspecies = 0; int n; bool id = int.TryParse(requestUrl, out n); if (requestUrl.Length > 0 && id == true) { idspecies = int.Parse(requestUrl); try { myConn = new MySqlConnection(connStr); myConn.Open(); MySqlCommand myCmd = new MySqlCommand(cmdStr, myConn); myCmd.Prepare(); myCmd.Parameters.Add("@species_id", MySqlDbType.Int32).Value = idspecies; myReader = myCmd.ExecuteReader(); while (myReader.Read()) { PopulationStatus[] ps = new PopulationStatus[] { new PopulationStatus { speciesid = myReader.IsDBNull(0) ? 0 : myReader.GetInt32(0), gb = myReader.IsDBNull(15) ? "" : myReader.GetString(15), england = myReader.IsDBNull(16) ? "" : myReader.GetString(16), scotland = myReader.IsDBNull(17) ? "" : myReader.GetString(17), wales = myReader.IsDBNull(18) ? "" : myReader.GetString(18) } }; SpeciesStatus[] ss = new SpeciesStatus[] { new SpeciesStatus { speciesid = myReader.IsDBNull(0) ? 0 : myReader.GetInt32(0), gb = myReader.IsDBNull(11) ? "" : myReader.GetString(11), england = myReader.IsDBNull(12) ? "" : myReader.GetString(12), scotland = myReader.IsDBNull(13) ? "" : myReader.GetString(13), wales = myReader.IsDBNull(14) ? "" : myReader.GetString(14) } }; Factsheet[] fs = new Factsheet[] { new Factsheet { fact_id = myReader.IsDBNull(21) ? 0 : myReader.GetInt32(21), short_desc = myReader.IsDBNull(22) ? "" : WriteXml(myReader.GetString(22)), biology_ecology = myReader.IsDBNull(23) ? "" : WriteXml(myReader.GetString(23)), habitat = myReader.IsDBNull(24) ? "" : WriteXml(myReader.GetString(24)), habitat_summary = myReader.IsDBNull(25) ? "" : WriteXml(myReader.GetString(25)), distribution = myReader.IsDBNull(26) ? "" : WriteXml(myReader.GetString(26)), impact = myReader.IsDBNull(27) ? "" : WriteXml(myReader.GetString(27)), impact_summary = myReader.IsDBNull(28) ? "" : WriteXml(myReader.GetString(28)), management = myReader.IsDBNull(29) ? "" : WriteXml(myReader.GetString(29)), status_summary = myReader.IsDBNull(30) ? "" : WriteXml(myReader.GetString(30)), invasion_history = myReader.IsDBNull(31) ? "" : WriteXml(myReader.GetString(31)), references = myReader.IsDBNull(33) ? "" : WriteXml(myReader.GetString(33)), other_references = myReader.IsDBNull(34) ? "" : WriteXml(myReader.GetString(34)), authors = myReader.IsDBNull(35) ? "" : WriteXml(myReader.GetString(35)), last_updated = myReader.IsDBNull(36) ? "" : WriteXml(myReader.GetString(36)) } }; //legislation = myReader.IsDBNull(32) ? "" : WriteXml(myReader.GetString(32)), List <string> syn = getSynonyms(idspecies); List <string> cmn = getCommonNames(idspecies); List <string> nrange = getNativeRanges(idspecies); Species[] sp = new Species[] { new Species { speciesid = myReader.IsDBNull(0) ? 0 : myReader.GetInt32(0), brcnumber = myReader.IsDBNull(1) ? "" : myReader.GetString(1), nbntvk = myReader.IsDBNull(2) ? "" : myReader.GetString(2), latinname = myReader.IsDBNull(3) ? "" : myReader.GetString(3), authority = myReader.IsDBNull(4) ? "" : myReader.GetString(4), phylum = myReader.IsDBNull(6) ? "" : myReader.GetString(6), family = myReader.IsDBNull(7) ? "" : myReader.GetString(7), order = myReader.IsDBNull(8) ? "" : myReader.GetString(8), environment = myReader.IsDBNull(9) ? "" : myReader.GetString(9), functional = myReader.IsDBNull(10) ? "" : myReader.GetString(10), locationfound = myReader.IsDBNull(19) ? "" : myReader.GetString(19), firstdate = myReader.IsDBNull(20) ? "" : myReader.GetString(20), factsheet = fs.Count <Factsheet>() == 0 ? null : fs[0], speciesStatus = ss.Count <SpeciesStatus>() == 0 ? null : ss[0], populationStatus = ps.Count <PopulationStatus>() == 0 ? null : ps[0], CommonNames = cmn, Synonyms = syn, NativeRanges = nrange, displaynativemap = myReader.IsDBNull(37) ? "no" : myReader.GetString(37), displaydistributionmap = myReader.IsDBNull(38) ? "no" : myReader.GetString(38), } }; species.Add(sp[0]); } } catch (MySqlException mysqlErr) { Console.WriteLine("MySQL Error :" + mysqlErr.ToString()); } finally { if (myReader != null) { myReader.Close(); } if (myConn != null) { myConn.Close(); } } } if (species == null) { // option 1 (throw) var notFoundMessage = new HttpResponseMessage(HttpStatusCode.NotFound); throw new HttpResponseException(notFoundMessage); } }
public IAsyncResult BeginUpdateTenantPopulationStatusWithScenario(Guid tenantId, PopulationStatus status, string scenario, string comment, AsyncCallback callback, object asyncState) { return(base.Channel.BeginUpdateTenantPopulationStatusWithScenario(tenantId, status, scenario, comment, callback, asyncState)); }
public void UpdateTenantPopulationStatus(Guid tenantId, PopulationStatus status) { base.Channel.UpdateTenantPopulationStatus(tenantId, status); }
public void UpdateTenantPopulationStatusAsync(Guid tenantId, PopulationStatus status) { this.UpdateTenantPopulationStatusAsync(tenantId, status, null); }
public IAsyncResult BeginUpdateTenantPopulationStatus(Guid tenantId, PopulationStatus status, AsyncCallback callback, object asyncState) { return(base.Channel.BeginUpdateTenantPopulationStatus(tenantId, status, callback, asyncState)); }