private async Task UploadFileAndFileStatusForRejected(Aggregate <Disbsad> aggregate, string outputPath) { await writer.UpLoadFile(aggregate.InValidFlow, outputPath); await writer.UpdateFileStatus(Common.GetStatusOfRejectedFile(outputPath, BusinessValidationConstants.REJECTED)); businessValidationProxy.InValid = true; }
/// <summary> /// The CreateVersionOfExistingFile /// </summary> /// <param name="boalfList">The boalfList<see cref="List{Boalf}"/></param> /// <param name="path">The path<see cref="string"/></param> /// <returns>The <see cref="Task"/></returns> private Task CreateVersionOfExistingFile(List <Boalf> boalfList, string path) { try { var newPath = BusinessValidationConstants.BOALF + DateTime.Now.ToString(BusinessValidationConstants.DATEFORMATE) + BusinessValidationConstants.FILEEXTENSION; return(writer.UpLoadFile(boalfList, path.Replace(BusinessValidationConstants.BOALFFILE, newPath, StringComparison.CurrentCultureIgnoreCase))); } catch (Exception ex) { Log.Error(ex.Message); throw; } }
/// <summary> /// The FileProcessAsync /// </summary> /// <param name="bods">The bods<see cref="List{Bod}"/></param> /// <param name="path">The path<see cref="string"/></param> /// <param name="isValid">The isValid<see cref="bool"/></param> /// <param name="warningResult">The warningResult<see cref="ValidationResult"/></param> /// <param name="folderName">The folderName<see cref="string"/></param> /// <returns>The <see cref="Task"/></returns> private async Task FileProcessAsync(List <Bod> bods, string path, bool isValid, ValidationResult warningResult, string folderName) { path = Common.GetOutputFolderPath(bods.Select(x => x.SettlementDay).FirstOrDefault(), Convert.ToInt32(bods.Select(x => x.SettlementPeriod).FirstOrDefault()), path, folderName); await writer.UpLoadFile(bods, path); if (isValid) { businessValidationProxy.Valid = true; businessValidationProxy.ValidPaths.Add(path); businessValidationProxy.ValidationResult = warningResult.IsValid; } else { businessValidationProxy.InValid = true; businessValidationProxy.InValidPaths.Add(path); LogErrorMessage(warningResult); } }
/// <summary> /// The FileProcessAsync /// </summary> /// <param name="fpns">The fpns<see cref="List{Fpn}"/></param> /// <param name="path">The path<see cref="string"/></param> /// <param name="isValid">The isValid<see cref="bool"/></param> /// <param name="warningResult">The warningResult<see cref="ValidationResult"/></param> /// <param name="folderName">The folderName<see cref="string"/></param> /// <returns>The <see cref="Task"/></returns> private async Task FileProcessAsync(List <Fpn> fpns, string path, bool isValid, ValidationResult warningResult, string folderName) { path = Common.GetOutputFolderPath(fpns.Select(x => x.SettlementDay).FirstOrDefault(), Convert.ToInt32(fpns.Select(x => x.SettlementPeriod).FirstOrDefault()), path, folderName); await _writer.UpLoadFile(fpns, path); if (isValid) { businessValidationProxy.Valid = true; businessValidationProxy.ValidPaths.Add(path); businessValidationProxy.ValidationResult = warningResult.IsValid; await _writer.UpdateFileStatus(Common.GetStatusOfBusinessValidation(path)); } else { businessValidationProxy.InValid = true; businessValidationProxy.InValidPaths.Add(path); await _writer.UpdateFileStatus(Common.GetStatusOfRejectedFile(path, BusinessValidationConstants.WARNING)); } }