コード例 #1
0
        public IActionResult SaveMatureOrder(MatureOrderRequest request)
        {
            if (ModelState.IsValid)
            {
                var response = new SingleResponse <long>()
                {
                    ResultCode = ResultCodes.normal
                };
                if (request.Order.Type == OrderType.LoanMature)
                {
                    request.Order.Description = _xbInfoService.GetLoanMatureTypesForIBanking()
                                                .Where(x => x.Key == ((int)request.Order.MatureType)
                                                       .ToString())
                                                .First().Value;
                }
                if (request.Order.MatureType == MatureType.PartialRepayment)
                {
                    request.Order.MatureType = MatureType.RepaymentByCreditCode;
                }
                ActionResult saveResult = _xbService.SaveMatureOrder(request.Order);

                response.ResultCode  = ResultCodeFormatter.FromPersonalAccountSecurityService(saveResult.ResultCode);
                response.Result      = saveResult.Id;
                response.Description = utils.GetActionResultErrors(saveResult.Errors);

                return(ResponseExtensions.ToHttpResponse(response));
            }
            else
            {
                return(ValidationError.GetValidationErrorResponse(ModelState));
            }
        }