public ActionResult DeleteConfirmed(int id) { clientsRepository.Delete(id); clientsRepository.Save(); return(RedirectToAction("Index")); }
public bool Delete(string clientId) { ThrowExceptionWheCliendIdIsNull(clientId); return(clientsRepository.Delete(new Client { _id = clientId })); }
public ActionResult DeleteConfirmed(Guid id) { bool isdeleted = _rep.Delete(id); if (isdeleted) { return(RedirectToAction("Index")); } return(RedirectToAction("DeleteConflicted", "Error", new { returnUrl = "/Clients/Index" })); }
public HttpResponseMessage DeleteClient(long cpf) { try { _repo.Delete(cpf); return(Request.CreateResponse(HttpStatusCode.OK)); } catch (InvalidOperationException) { return(Request.CreateResponse(HttpStatusCode.NotFound)); } catch { return(Request.CreateResponse(HttpStatusCode.InternalServerError)); } }
public IActionResult Delete(ClientViewModel clientData) { string firstName = clientData.FirstName; string lastName = clientData.LastName; string password = clientData.Password; if (_clientsRepository.Delete(firstName, lastName, password)) { ViewBag.UserName = firstName + " " + lastName; ViewBag.UserDelete = "Udało się usunąć konto."; } else { ViewBag.UserName = firstName + " " + lastName; ViewBag.UserDelete = "Nie udało się! Takiego użytkownika nie ma w naszym sklepie."; } return(View("Deleted")); }
public async Task <ActionResult> DeleteClient(int clientId) { await _clientRepository.Delete(clientId); return(RedirectToAction(nameof(ListClients))); }
public Task DeleteAsync(int id) { _clientRepository.Delete(id); return(Task.FromResult <object>(null)); }
public bool Delete(int id) { return(_clientsRepository.Delete(id)); }
public async Task <bool> Delete(int id) { await _clientsRepository.Delete(id); return(true); }