示例#1
0
        public IActionResult test()
        {
            CreateInstallment operation = new CreateInstallment();


            operation.DocumentID         = 201;
            operation.CommissionAmount   = 1.2;
            operation.CommissionAmountLc = 1.3;
            operation.CreationDate       = DateTime.Now;
            operation.CreatedBy          = "admin";
            operation.DueDate            = DateTime.Now;
            operation.Exrate             = 1.2;
            operation.FeesAmount         = 1.0;
            operation.FeesAmountLC       = 1.2;
            operation.GrossAmount        = 1.3;
            operation.GrossAmountLc      = 1.4;
            operation.Percent            = 1.4;



            var result = operation.ExecuteAsync().Result;

            if (result is ValidationsOutput)
            {
                return(Ok(new ApiResult <List <ValidationItem> >()
                {
                    Data = ((ValidationsOutput)result).Errors
                }));
            }
            else
            {
                return(Ok((List <Cover>)result));
            }
        }
示例#2
0
        public IApiResult Update(CreateInstallment operation)
        {
            var result = operation.ExecuteAsync().Result;

            if (result is ValidationsOutput)
            {
                return(new ApiResult <List <ValidationItem> >()
                {
                    Data = ((ValidationsOutput)result).Errors
                });
            }
            else
            {
                return(new ApiResult <object>()
                {
                    Status = ApiResult <object> .ApiStatus.Success
                });
            }
        }