Example #1
0
        public async Task <CustomStateDetail> GetCustomPersonnelStaffingAsync(int departmentId, UserState state)
        {
            if (state.State <= 25)
            {
                var detail = new CustomStateDetail();

                detail.ButtonText  = state.GetStaffingText();
                detail.ButtonColor = state.GetStaffingCss();

                if (string.IsNullOrWhiteSpace(detail.ButtonColor))
                {
                    detail.ButtonColor = "label-default";
                }

                return(detail);
            }
            else
            {
                var stateDetail = await GetCustomDetailForDepartmentAsync(departmentId, state.State);

                return(stateDetail);
            }
        }
Example #2
0
        public static CustomStateDetail GetCustomPersonnelStaffing(int departmentId, UserState state)
        {
            if (state.State <= 25)
            {
                var detail = new CustomStateDetail();

                detail.ButtonText  = state.GetStaffingText();
                detail.ButtonColor = state.GetStaffingCss();

                if (string.IsNullOrWhiteSpace(detail.ButtonColor))
                {
                    detail.ButtonColor = "label-default";
                }

                return(detail);
            }
            else
            {
                var customStateService = WebBootstrapper.GetKernel().Resolve <ICustomStateService>();
                var stateDetail        = customStateService.GetCustomDetailForDepartment(departmentId, state.State);

                return(stateDetail);
            }
        }