public static CustomStateDetail GetCustomState(int departmentId, int detailId)
        {
            var customStateService = WebBootstrapper.GetKernel().Resolve <ICustomStateService>();

            var stateDetail = customStateService.GetCustomDetailForDepartment(departmentId, detailId);

            return(stateDetail);
        }
Exemple #2
0
        public static ClaimsPrincipal GetClaimsPrincipal()
        {
            if (_httpContextAccessor == null)
            {
                _httpContextAccessor = WebBootstrapper.GetKernel().Resolve <IHttpContextAccessor>();
            }

            return(_httpContextAccessor.HttpContext.User);
        }
Exemple #3
0
        public TopIconsModel()
        {
            if (_messageService == null)
            {
                _messageService = WebBootstrapper.GetKernel().Resolve <IMessageService>();
            }

            if (_callsService == null)
            {
                _callsService = WebBootstrapper.GetKernel().Resolve <ICallsService>();
            }
        }
Exemple #4
0
        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);
            }
        }
Exemple #7
0
        public static string CallPriorityToString(int departmentId, int priority)
        {
            var callsService = WebBootstrapper.GetKernel().Resolve <ICallsService>();

            return(callsService.CallPriorityToString(priority, departmentId));
        }
Exemple #8
0
 public EventingHub()
 {
     _inboundEventProvider   = WebBootstrapper.GetKernel().Resolve <IInboundEventProvider>();
     _departmentLinksService = WebBootstrapper.GetKernel().Resolve <IDepartmentLinksService>();
     _inboundEventProvider.RegisterForEvents(PersonnelStatusUpdated, UnitStatusUpdated, CallsUpdated, PersonnelStaffingUpdated);
 }