public ActionResult DeleteConfirmed(int id) { _providerService.Delete(id); _providerService.SaveChanges(); return(RedirectToAction("Index")); }
public async Task <IActionResult> Delete(int id) { if (await _providerService.Delete(id)) { return(NoContent()); } return(BadRequest("Fail to delete Provider")); }
public void Delete(Guid id, string searchQueryId = null) { using (var transaction = ContextManager.NewTransaction()) { providerService.Delete(id); transaction.Commit(); } RefreshGridItem(searchQueryId, null, model => model.Id == id); }
public async Task <IActionResult> Delete(Provider provider) { if (provider == null) { return(RedirectToAction(nameof(Error))); } await _providerService.Delete(provider); return(RedirectToAction(nameof(Index))); }
public HttpResponseMessage Delete(HttpRequestMessage request, int id) { return(CreateHttpResponse(request, () => { HttpResponseMessage response = null; if (!ModelState.IsValid) { request.CreateResponse(HttpStatusCode.BadRequest, ModelState); } else { var oldProvider = _providerService.Delete(id); _providerService.Save(); var responseData = Mapper.Map <Provider, ProviderViewModel>(oldProvider); response = request.CreateResponse(HttpStatusCode.Created, responseData); } return response; })); }
private void btnDeleteProvider_Click(object sender, EventArgs e) { if (dtgProviders.SelectedRows.Count > 0) { if (MessageBox.Show("Tem Certeza que deseja excluir?", "Atenção", MessageBoxButtons.YesNo) == DialogResult.Yes) { _providerService.Delete((long)dtgProviders.SelectedRows[0].Cells[4].Value); UpdateList(); } } }
// DELETE api/providers/5 public HttpResponseMessage Delete(long id) { try { _providerService.Delete(id); return(Request.CreateResponse(System.Net.HttpStatusCode.Accepted)); } catch { return(Request.CreateResponse(System.Net.HttpStatusCode.InternalServerError)); } }
public async Task <ActionResult <ProviderDTO> > Delete(Guid id) { var provider = _providerRepository.GetById(id); if (provider == null) { return(NotFound()); } await _service.Delete(id); return(CustomResponse()); }
public async Task <IActionResult> Delete(string id) { try { var result = await ProviderService.Delete(id); return(Ok(result)); } catch (Exception ex) { Logger.LogException(ex, "Fox.Provider.Api"); return(BadRequest(ex)); } }
public async Task <IActionResult> Delete(int id) { try { var response = await _providerService.Delete(id); if (response.Status != true) { return(StatusCode(StatusCodes.Status500InternalServerError, "Ocurrio un error al realizar la solicitud")); } return(Ok(response)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public ActionResult Delete(int id, SearchProvider model) { if (!ModelState.IsValid) { return(View(model)); } try { _service.Delete(model); return(RedirectToAction("Index")); } catch { return(View()); } }
public async Task <ActionResult> Delete(string cnpj) { try { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var result = await _service.Delete(cnpj); if (result == false) { return(NotFound()); } return(Ok(result)); } catch (ArgumentException ex) { return(StatusCode((int)HttpStatusCode.InternalServerError, ex.Message)); } }
public ActionResult Delete(int id) { _providerService.Delete(_providerService.Get(id)); return(RedirectToAction("Index")); }
// DELETE: api/Provider/5 public void Delete(int id) { _providerService.Delete(id); }
public ActionResult Delete(Guid id, FormCollection collection) { _providerService.Delete(id); return(RedirectToAction("Index", new ProviderListFiltersModel().GetRouteValues()).WithSuccess("Camion Eliminado")); }
public ActionResult Delete(int id) { return(Ok( _providerService.Delete(id))); }
public void Delete(int id) { _service.Delete(id); }
public IHttpActionResult Delete(List <string> ids) { return(Ok(_service.Delete(ids))); }