コード例 #1
0
        public async Task <IActionResult> Delete(List <IFormFile> files)
        {
            List <ValidationResult> validationsResults = new List <ValidationResult>();

            foreach (var file in files)
            {
                var arrayFile = OFXUtils.ReadAsArray(file);
                var result    = OFXUtils.ReadOFXtoXMLFromArray(arrayFile);

                var ofx = OFX.GetOFXFromString(result);
                ofx.Id = ofx.GenerateOFXId();

                validationsResults.Add(await _OFXAppService.Remove(ofx.Id));
            }

            return(!ModelState.IsValid ? CustomResponse(ModelState) : CustomResponse(validationsResults));
        }
コード例 #2
0
        public async Task <IActionResult> Put(List <IFormFile> files)
        {
            List <ValidationResult> validationsResults = new List <ValidationResult>();

            foreach (var file in files)
            {
                var arrayFile = OFXUtils.ReadAsArray(file);
                var result    = OFXUtils.ReadOFXtoXMLFromArray(arrayFile);

                var ofx = OFX.GetOFXFromString(result);
                ofx.FileOFX = string.Join('\n', result);

                var ofxViewModel = new OFXViewModel
                {
                    OFX = ofx
                };

                validationsResults.Add(await _OFXAppService.Update(ofxViewModel));
            }

            return(!ModelState.IsValid ? CustomResponse(ModelState) : CustomResponse(validationsResults));
        }
コード例 #3
0
 public void TestReadXML()
 {
     var input = OFXUtils.ReadOFXtoXMLFromPath(@"D:\Rubens\Desktop\DevelopersChallenge2-master\DevelopersChallenge2-master\OFX\extrato1.ofx");
     var ofx   = OFX.GetOFXFromString(input);
 }