public async Task <IActionResult> UpdateComponent(UpdateComponentDto updateComponentDto)
        {
            Devon4NetLogger.Debug("Executing UpdateComponent from controller SmaxHcm");
            await SmaxHcmHandler.UpdateComponent(updateComponentDto);

            return(Ok());
        }
Exemplo n.º 2
0
        public ActionResult <Result <GetComponentDto> > Put([FromBody] UpdateComponentDto componentDto)
        {
            var componentToUpdate = new Component
            {
                Id           = componentDto.Id,
                QuantityType = componentDto.QuantityType,
                UnitPrice    = componentDto.UnitPrice,
                Description  = componentDto.Description
            };
            var resultFromRepository = componentRepository.Update(componentToUpdate);

            return(new Result <GetComponentDto>
            {
                IsSuccess = resultFromRepository.IsSuccess,
                Message = resultFromRepository.Message,
                Value = resultFromRepository.Value != null
                    ? new GetComponentDto
                {
                    Id = resultFromRepository.Value.Id,
                    QuantityType = resultFromRepository.Value.QuantityType,
                    UnitPrice = resultFromRepository.Value.UnitPrice,
                    Description = resultFromRepository.Value.Description
                }
                    : null
            });
        }
Exemplo n.º 3
0
        public Task UpdateComponent(UpdateComponentDto updateComponentDto)
        {
            var data = new UpdateComponentRequestDto
            {
                global_id         = updateComponentDto.component_id,
                name              = updateComponentDto.name,
                displayName       = updateComponentDto.displayName,
                description       = updateComponentDto.description,
                icon              = updateComponentDto.icon,
                processingOrder   = updateComponentDto.processingOrder,
                isConsumerVisible = updateComponentDto.isConsumerVisible,
                isPattern         = updateComponentDto.isPattern
            };

            return(SendSmaxHcm <object>(HttpMethod.Put, string.Format(SmaxHcmEndpointConst.UpdateComponent, SmaxHcmOptions.TenantId, updateComponentDto.component_id), data, false, true));
        }