private Location DeleteLocationNg(LocationInfo locationInfo) { if (!locationInfo.UniqueId.HasValue) { throw new ExpectedException($"No uniqueID found for location '{locationInfo.Identifier}'"); } var location = Client.Provisioning.Get(new GetLocation { LocationUniqueId = locationInfo.UniqueId.Value }); try { try { _processor.Delete(new DeleteMigrationLocationByIdentifier { LocationIdentifier = locationInfo.Identifier }); } catch (WebServiceException exception) { if (exception.StatusCode != 400 && exception.StatusCode != 404) { throw; } Log.Warn($"Trying alternative API to delete '{locationInfo.Identifier}' ..."); var siteVisitLocation = GetSiteVisitLocation(locationInfo); // Try the other API (not quite as robust) _processor.Delete(new DeleteLocationByIdRequest { LocationId = siteVisitLocation.Id }); } } catch (WebServiceException exception) { if (exception.ErrorCode == "InvalidOperationException") { Log.Warn($"Location '{locationInfo.Identifier}' cannot be deleted. Reason: {exception.ErrorMessage}"); ++LockedLocationCount; return(null); } throw; } return(location); }
public virtual JsonResult Delete(int id) { try { var request = new DeleteRequest { Id = id }; _repository.Delete <DeleteRequest, DeleteResponse>(request); return(Json(new { Result = "OK" })); } catch (InvalidOperationException ex) { return(Json(new { Result = "ERROR", Message = String.Format("{0}<br/>Details:{1}", ex.Message, ex.Data["DetailHtml"]) })); } catch (Exception ex) { return(Json(new { Result = "ERROR", Message = ex.Message })); } }
private Location DeleteLocationNg(LocationInfo locationInfo) { if (!locationInfo.UniqueId.HasValue) { throw new ExpectedException($"No uniqueID found for location '{locationInfo.Identifier}'"); } var location = Client.Provisioning.Get(new GetLocation { LocationUniqueId = locationInfo.UniqueId.Value }); try { _processor.Delete(new DeleteMigrationLocationByIdentifier { LocationIdentifier = locationInfo.Identifier }); } catch (WebServiceException exception) { if (exception.ErrorCode == "InvalidOperationException") { Log.Warn($"Location '{locationInfo.Identifier}' cannot be deleted. Reason: {exception.ErrorMessage}"); ++LockedLocationCount; return(null); } throw; } return(location); }
public IHttpActionResult Delete(int id) { Customer cust = sclient.GetById(id); sclient.Delete(cust); sclient.Commit(); return(Ok("Index")); }
public async Task <IActionResult> Delete(Guid id) { try { if (await _serviceClient.Delete(id)) { return(NoContent()); } return(BadRequest(new FailResponse($"Erro ao excluir."))); } catch (Exception e) { return(StatusCode(StatusCodes.Status500InternalServerError, new FailResponse(e.Message, e))); } }
private Location DeleteLocationNg(LocationInfo locationInfo) { if (!locationInfo.UniqueId.HasValue) { throw new ExpectedException($"No uniqueID found for location '{locationInfo.Identifier}'"); } var location = Client.Provisioning.Get(new GetLocation { LocationUniqueId = locationInfo.UniqueId.Value }); _processor.Delete(new DeleteMigrationLocationByIdentifier { LocationIdentifier = locationInfo.Identifier }); return(location); }
public static void Logout(IServiceClient client) { client.Delete(new DeleteSession()); }
public TResponse Delete <TResponse>(IReturn <TResponse> requestDto) { return(InvokeWebServiceMethod(() => _client.Delete(requestDto))); }
public HttpWebResponse Delete(IReturnVoid requestDto) { return(cachedClient.Delete(requestDto)); }
public T Delete <T>(T data) where T : class { return(client.Delete <T>(data)); }
public IResponse Delete(Uri uri) { Guard.ArgumentIsNotNull(uri, "uri"); return(_serviceClient.Delete(uri)); }