public IActionResult GetPersonnelStatusesForDepartment(bool includeAny) { List <PersonnelStatusJson> personnelStauses = new List <PersonnelStatusJson>(); var customStauses = _customStateService.GetActivePersonnelStateForDepartment(DepartmentId); if (includeAny) { personnelStauses.Add(new PersonnelStatusJson() { Id = -1, Name = "Any" }); } if (customStauses != null) { foreach (var detail in customStauses.GetActiveDetails()) { var status = new PersonnelStatusJson(); status.Id = detail.CustomStateDetailId; status.Name = detail.ButtonText; personnelStauses.Add(status); } } else { personnelStauses.Add(new PersonnelStatusJson() { Id = 0, Name = "Standing By" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 1, Name = "Not Responding" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 2, Name = "Responding" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 3, Name = "On Scene" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 4, Name = "Available Station" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 5, Name = "Responding Station" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 6, Name = "Responding Scene" }); } return(Json(personnelStauses)); }
public IActionResult GetPersonnelStaffingLevelsForDepartment(bool includeAny) { List <PersonnelStatusJson> personnelStauses = new List <PersonnelStatusJson>(); var customStaffingLevels = _customStateService.GetActiveStaffingLevelsForDepartment(DepartmentId); if (includeAny) { personnelStauses.Add(new PersonnelStatusJson() { Id = -1, Name = "Any" }); } if (customStaffingLevels != null) { foreach (var detail in customStaffingLevels.GetActiveDetails()) { var status = new PersonnelStatusJson(); status.Id = detail.CustomStateDetailId; status.Name = detail.ButtonText; personnelStauses.Add(status); } } else { personnelStauses.Add(new PersonnelStatusJson() { Id = 0, Name = "Available" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 1, Name = "Delayed" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 2, Name = "Unavailable" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 3, Name = "Committed" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 4, Name = "On Shift" }); } return(Json(personnelStauses)); }
public IActionResult GetUnitStatusesLevelsForDepartmentCombined(bool includeAny) { List <PersonnelStatusJson> personnelStauses = new List <PersonnelStatusJson>(); var customStates = _customStateService.GetAllActiveUnitStatesForDepartment(DepartmentId); if (includeAny) { personnelStauses.Add(new PersonnelStatusJson() { Id = -1, Name = "Any" }); } if (customStates != null && customStates.Any()) { foreach (var customState in customStates) { foreach (var detail in customState.GetActiveDetails()) { var status = new PersonnelStatusJson(); status.Id = detail.CustomStateDetailId; status.Name = $"{customState.Name}:{detail.ButtonText}"; personnelStauses.Add(status); } } } else { personnelStauses.Add(new PersonnelStatusJson() { Id = 0, Name = "Available" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 1, Name = "Delayed" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 2, Name = "Unavailable" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 3, Name = "Committed" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 4, Name = "Out Of Service" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 5, Name = "Responding" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 6, Name = "On Scene" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 7, Name = "Staging" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 8, Name = "Returning" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 9, Name = "Cancelled" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 10, Name = "Released" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 11, Name = "Manual" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 12, Name = "Enroute" }); } return(Json(personnelStauses)); }
public IActionResult GetUnitStatusesLevelsForDepartment(bool includeAny, int unitTypeId) { List <PersonnelStatusJson> personnelStauses = new List <PersonnelStatusJson>(); CustomState customState = null; var unitType = _unitsService.GetUnitTypeById(unitTypeId); if (unitType.CustomStatesId.HasValue && unitType.CustomStatesId.Value > 0) { customState = _customStateService.GetCustomSateById(unitType.CustomStatesId.Value); } if (includeAny) { personnelStauses.Add(new PersonnelStatusJson() { Id = -1, Name = "Any" }); } if (customState != null) { foreach (var detail in customState.GetActiveDetails()) { var status = new PersonnelStatusJson(); status.Id = detail.CustomStateDetailId; status.Name = detail.ButtonText; personnelStauses.Add(status); } } else { personnelStauses.Add(new PersonnelStatusJson() { Id = 0, Name = "Available" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 1, Name = "Delayed" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 2, Name = "Unavailable" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 3, Name = "Committed" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 4, Name = "Out Of Service" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 5, Name = "Responding" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 6, Name = "On Scene" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 7, Name = "Staging" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 8, Name = "Returning" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 9, Name = "Cancelled" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 10, Name = "Released" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 11, Name = "Manual" }); personnelStauses.Add(new PersonnelStatusJson() { Id = 12, Name = "Enroute" }); } return(Json(personnelStauses)); }