diff --git a/Core/Resgrid.Model/DepartmentNotification.cs b/Core/Resgrid.Model/DepartmentNotification.cs index 2727cf70..359cd0cc 100644 --- a/Core/Resgrid.Model/DepartmentNotification.cs +++ b/Core/Resgrid.Model/DepartmentNotification.cs @@ -88,6 +88,8 @@ public string TranslateBefore(List customStates = null) switch ((EventTypes)EventType) { case EventTypes.UnitStatusChanged: + if (string.IsNullOrWhiteSpace(BeforeData)) + return "Any"; if (BeforeData == "-1") return "Any"; else @@ -115,6 +117,8 @@ public string TranslateBefore(List customStates = null) } break; case EventTypes.PersonnelStaffingChanged: + if (string.IsNullOrWhiteSpace(BeforeData)) + return "Any"; if (BeforeData == "-1") return "Any"; else @@ -142,6 +146,8 @@ public string TranslateBefore(List customStates = null) } break; case EventTypes.PersonnelStatusChanged: + if (string.IsNullOrWhiteSpace(BeforeData)) + return "None"; if (BeforeData == "-1") return "Any"; else @@ -202,6 +208,8 @@ public string TranslateCurrent(List customStates = null) switch ((EventTypes)EventType) { case EventTypes.UnitStatusChanged: + if (string.IsNullOrWhiteSpace(CurrentData)) + return "None"; if (CurrentData == "-1") return "Any"; else @@ -229,6 +237,8 @@ public string TranslateCurrent(List customStates = null) } break; case EventTypes.PersonnelStaffingChanged: + if (string.IsNullOrWhiteSpace(CurrentData)) + return "None"; if (CurrentData == "-1") return "Any"; else @@ -256,6 +266,8 @@ public string TranslateCurrent(List customStates = null) } break; case EventTypes.PersonnelStatusChanged: + if (string.IsNullOrWhiteSpace(CurrentData)) + return "None"; if (CurrentData == "-1") return "Any"; else diff --git a/Web/Resgrid.Web/Areas/User/Controllers/NotificationsController.cs b/Web/Resgrid.Web/Areas/User/Controllers/NotificationsController.cs index 141c2100..2ffdcec9 100644 --- a/Web/Resgrid.Web/Areas/User/Controllers/NotificationsController.cs +++ b/Web/Resgrid.Web/Areas/User/Controllers/NotificationsController.cs @@ -99,9 +99,9 @@ public async Task Index() var user = _usersService.GetUserById(userId); if (sb.Length > 0) - sb.Append("," + UserHelper.GetFullNameForUser(user.UserId)); + sb.Append("," + await UserHelper.GetFullNameForUser(user.UserId)); else - sb.Append(UserHelper.GetFullNameForUser(user.UserId)); + sb.Append(await UserHelper.GetFullNameForUser(user.UserId)); } }