public ActionResult DeleteConfirmed(int id)
        {
            clientsRepository.Delete(id);
            clientsRepository.Save();

            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 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" }));
        }
Exemplo n.º 4
0
 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"));
        }
Exemplo n.º 6
0
        public async Task <ActionResult> DeleteClient(int clientId)
        {
            await _clientRepository.Delete(clientId);

            return(RedirectToAction(nameof(ListClients)));
        }
Exemplo n.º 7
0
 public Task DeleteAsync(int id)
 {
     _clientRepository.Delete(id);
     return(Task.FromResult <object>(null));
 }
Exemplo n.º 8
0
 public bool Delete(int id)
 {
     return(_clientsRepository.Delete(id));
 }
Exemplo n.º 9
0
        public async Task <bool> Delete(int id)
        {
            await _clientsRepository.Delete(id);

            return(true);
        }