Пример #1
0
        public async Task <IActionResult> AddCorporateAsync(CurrentCardAndCorporateAddDto currentCardAndCorporateAddDto)
        {
            var addResult = await _currentCardManagementService.AddCorporateAsync(currentCardAndCorporateAddDto);

            if (!addResult.Success)
            {
                return(BadRequest(addResult));
            }

            return(Ok(addResult));
        }
Пример #2
0
        public async Task <IResult> AddCorporateAsync(CurrentCardAndCorporateAddDto currentCardAndCorporateAddDto)
        {
            var currentCardAddResult = await this.AddCurrentCardAsync(currentCardAndCorporateAddDto.CurrentCardAddDto);

            if (!currentCardAddResult.Success)
            {
                return(currentCardAddResult);
            }

            currentCardAndCorporateAddDto.CorporateCurrentCardAddDto.CurrentCardId = currentCardAddResult.Data.Id;

            var corporateCardAddResult = await this.AddCorporateCardAsync(currentCardAndCorporateAddDto.CorporateCurrentCardAddDto);

            if (!corporateCardAddResult.Success)
            {
                return(corporateCardAddResult);
            }

            return(new SuccessResult(Messages.CorporateCurrentCardAdded));
        }