예제 #1
0
        public IActionResult DeleteIncident(int id)
        {
            var steps             = IncidentStepProcessor.LoadStepsByIncidentId(id);
            var incidentEmployees = IncidentEmployeeProcessor.LoadEmployeesByIncidentId(id);

            foreach (var employee in incidentEmployees)
            {
                IncidentEmployeeProcessor.RemoveEmployeeFromIncident(id, employee.Employee_Id);
            }
            foreach (var step in steps)
            {
                IncidentStepProcessor.DeleteStep(step.id);
            }
            IncidentProcessor.DeleteIncident(id);
            return(RedirectToAction("ViewIncidents"));
        }
예제 #2
0
 public IActionResult DeleteStep(int id, int incident_Id)
 {
     IncidentStepProcessor.DeleteStep(id);
     return(RedirectToAction("DetailsIncident", "Incident", new { id = incident_Id }));
 }