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

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

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

            return(true);
        }