Exemplo n.º 1
0
 public IActionResult Delete(Guid id)
 {
     _service.Delete(id);
     return(new ContentResult {
         Content = id.ToString(), StatusCode = 200
     });
 }
Exemplo n.º 2
0
        public ActionResult Delete(int employee_id)
        {
            EmployeesModel employee = new EmployeesModel();

            try
            {
                employee = _employeesService.GetEmployee(employee_id);
                if (!_employeesService.Delete(employee))
                {
                    TempData["error"] = $"Problems with deleting employee (Service error \"Delete\").";
                    return(RedirectToAction("Index"));
                }
            }
            catch (Exception e)
            {
                TempData["error"] = $"Problems with getting information from database (services) or deleting information. {e.Message}";
                return(RedirectToAction("Index"));
            }


            return(RedirectToAction("Index"));
        }