Beispiel #1
0
        public OperationForDetailDto GetDetail(int idOperation, int idUserGroup)
        {
            Operation operation = new Operation();

            if (idOperation == -1)
            {
                operation.OperationMethod = new OperationMethod {
                    Id = 1, Label = "INCONNU"
                };
                operation.OperationType = new OperationType {
                    Id = 1, Label = "INCONNU"
                };
            }
            else
            {
                operation = _operationRepository.GetDetail(idOperation);
            }
            var operationDto = _mapper.Map <OperationForDetailDto>(operation);

            operationDto.OperationMethod = new ComboSimple <SelectDto>
            {
                List     = _operationMethodService.GetSelectList(EnumSelectType.Empty),
                Selected = new SelectDto {
                    Id = operation.OperationMethod.Id, Label = operation.OperationMethod.Label
                }
            };
            operationDto.OperationType = new ComboSimple <SelectGroupDto>
            {
                List     = _operationTypeService.GetSelectGroup(idUserGroup),
                Selected = new SelectDto {
                    Id = operation.OperationType.Id, Label = operation.OperationType.Label
                }
            };
            return(operationDto);
        }
        public IActionResult GetOperationMethodSelectList(int idSelectType)
        {
            var selectsDto = _operationMethodService.GetSelectList((EnumSelectType)idSelectType);

            return(Ok(selectsDto));
        }