示例#1
0
 public async Task <IActionResult> Delete([FromRoute] Guid id)
 {
     if (await _employeeService.Delete(id))
     {
         return(Ok(true));
     }
     return(BadRequest("No se ha podido eliminar el empleado"));
 }
        public ActionResult Delete(int idToDelete)
        {
            try
            {
                _employeService.Delete(idToDelete, _donneNomPrenomUtilisateur());
                _employeService.Save();
                FlashMessage.Confirmation("Suppression de l'employé");
            }
            catch (Exception)
            {
                FlashMessage.Danger("Erreur lors de la suppression de l'employé");
                throw;
            }

            return(RedirectToAction("Index"));
        }
示例#3
0
 public IActionResult Delete(long id)
 {
     _employeService.Delete(id);
     return(new NoContentResult());
 }