public static CustomStateDetail GetCustomState(int departmentId, int detailId) { var customStateService = WebBootstrapper.GetKernel().Resolve <ICustomStateService>(); var stateDetail = customStateService.GetCustomDetailForDepartment(departmentId, detailId); return(stateDetail); }
public static ClaimsPrincipal GetClaimsPrincipal() { if (_httpContextAccessor == null) { _httpContextAccessor = WebBootstrapper.GetKernel().Resolve <IHttpContextAccessor>(); } return(_httpContextAccessor.HttpContext.User); }
public TopIconsModel() { if (_messageService == null) { _messageService = WebBootstrapper.GetKernel().Resolve <IMessageService>(); } if (_callsService == null) { _callsService = WebBootstrapper.GetKernel().Resolve <ICallsService>(); } }
public void SetMessages(string userId, int departmentId) { // Trying to speed this up (may need to ditch it all together) but at times // this is a big hit on NewRelic, most likely because it's constructing the // message and call service every time. It's not an ideal solution, but hopefully // it will help for a bit. try { NewMessages = _messageService.GetUnreadMessagesCountByUserId(userId); NewCalls = _callsService.GetActiveCallsForDepartment(departmentId); } catch (Exception) { _messageService = WebBootstrapper.GetKernel().Resolve <IMessageService>(); _callsService = WebBootstrapper.GetKernel().Resolve <ICallsService>(); NewMessages = _messageService.GetUnreadMessagesCountByUserId(userId); NewCalls = _callsService.GetActiveCallsForDepartment(departmentId); } }
public static CustomStateDetail GetCustomUnitState(UnitState state) { if (state.State <= 25) { var detail = new CustomStateDetail(); detail.ButtonText = state.ToStateDisplayText(); detail.ButtonColor = state.ToStateCss(); if (string.IsNullOrWhiteSpace(detail.ButtonColor)) { detail.ButtonColor = "label-default"; } return(detail); } else { var customStateService = WebBootstrapper.GetKernel().Resolve <ICustomStateService>(); var stateDetail = customStateService.GetCustomDetailForDepartment(state.Unit.DepartmentId, state.State); return(stateDetail); } }
public static CustomStateDetail GetCustomPersonnelStatus(int departmentId, ActionLog state) { if (state.ActionTypeId <= 25) { var detail = new CustomStateDetail(); detail.ButtonText = state.GetActionText(); detail.ButtonColor = state.GetActionCss(); if (string.IsNullOrWhiteSpace(detail.ButtonColor)) { detail.ButtonColor = "label-default"; } return(detail); } else { var customStateService = WebBootstrapper.GetKernel().Resolve <ICustomStateService>(); var stateDetail = customStateService.GetCustomDetailForDepartment(departmentId, state.ActionTypeId); return(stateDetail); } }
public static string CallPriorityToString(int departmentId, int priority) { var callsService = WebBootstrapper.GetKernel().Resolve <ICallsService>(); return(callsService.CallPriorityToString(priority, departmentId)); }
public EventingHub() { _inboundEventProvider = WebBootstrapper.GetKernel().Resolve <IInboundEventProvider>(); _departmentLinksService = WebBootstrapper.GetKernel().Resolve <IDepartmentLinksService>(); _inboundEventProvider.RegisterForEvents(PersonnelStatusUpdated, UnitStatusUpdated, CallsUpdated, PersonnelStaffingUpdated); }