public async Task <APIGatewayProxyResponse> FunctionHandler(APIGatewayProxyRequest apigProxyEvent, ILambdaContext context) { var body = CommonProcesses.ReturnSomething(); return(new APIGatewayProxyResponse { Body = body, StatusCode = 200, }); }
private void ReplaceWordContent(CashFlowInformation information) { DirectoryInfo directoryInfo = DirectoryHelper.GetWordTemplateDirectory(); string source = Path.Combine(directoryInfo.FullName, information.WordDocument); foreach (CashFlowDetail detail in information.InvestorDetails) { FillStrings(detail); RadFlowDocument wordDocument = new RadFlowDocument(); try { using (Stream input = File.OpenRead(source)) { wordDocument = provider.Import(input); } } catch (Exception ex) { throw new Exception($"Das Word-Template konnte nicht geöffnet werden. {ex.Message}"); } editor = new RadFlowDocumentEditor(wordDocument); ReplacePlaceholder(detail); //add docuemnt to seriesDocument seriesDocument.Merge(editor.Document); // save single file string fileName = DirectoryHelper.FindInvestorCashFlow(detail.Investor.Id, cashFlowNumber); using (Stream output = File.OpenWrite(fileName)) { provider.Export(editor.Document, output); } eventAggregator.GetEvent <StatusBarEvent>().Publish($"Das Ausschüttungsschreiben für {detail.Reference} wurde erstellt."); detail.FileName = fileName; } string seriesFileName = DirectoryHelper.FindFundCashFlow(information.Fund.Id, cashFlowNumber); using (Stream output = File.OpenWrite(seriesFileName)) { provider.Export(seriesDocument.Document, output); } CommonProcesses.StartWord(seriesFileName); }