示例#1
0
        public async Task <IResult> AddForeignIndividualAsync(CurrentCardAndForeignIndividualAddDto currentCardAndForeignIndividualAddDto)
        {
            var currentCardAddResult = await this.AddCurrentCardAsync(currentCardAndForeignIndividualAddDto.CurrentCardAddDto);

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

            currentCardAndForeignIndividualAddDto.IndividualCurrentCardAddDto.CurrentCardId = currentCardAddResult.Data.Id;

            var individualCurrentCardAddResult = await this.AddIndividualCurrentCardAsync(currentCardAndForeignIndividualAddDto.IndividualCurrentCardAddDto);

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

            currentCardAndForeignIndividualAddDto.ForeignIndividualCurrentCardAddDto.IndividualCurrentCardId = individualCurrentCardAddResult.Data.Id;

            var foreignIndividualAddResult = await _foreignIndividualCurrentCardService.AddAsync(currentCardAndForeignIndividualAddDto.ForeignIndividualCurrentCardAddDto);

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

            return(new SuccessResult(Messages.ForeignIndividualCurrentCardAdded));
        }
示例#2
0
        public async Task <IActionResult> AddAsync(ForeignIndividualCurrentCardAddDto foreignIndividualCurrentCardAddDto)
        {
            var result = await _foreignIndividualCurrentCardService.AddAsync(foreignIndividualCurrentCardAddDto);

            return(result.Success == false?BadRequest(result) : Ok(result));
        }