public ActionResult Delete(int id) { try { // TODO: Add delete logic here bool success = EmpresaRepository.DeleteEmpresa(id); if (success) { return(RedirectToAction("Index")); } else { return(View()); } } catch (SqlException e) { Console.WriteLine(e.Message); return(View()); } }