Files
BeWoPlaner/Service/ServiceProxy/XRechnungApiClient.cs

58 lines
1.3 KiB
C#
Raw Permalink Normal View History

using BeWo.Data.Entities;
using BeWo.Service.Core;
using BS.Shared.Core;
using BS.Shared.Core.Facade;
Merge branch 'master' into feature_rene_18_ai - kein kommentar... # Conflicts: # BeWo/BeWo.csproj # BeWo/BeWoApp.xaml.cs # BeWo/ServiceProxy/GeneratedAiEnhancedService.cs # BeWo/Services/BeWoControlFactory.cs # BeWo/Services/BeWoWindowFactory.cs # BeWo/Services/BeWoWindowService.cs # BeWo/Services/IControlFactory.cs # BeWo/Services/IWindowFactory.cs # BeWo/Services/IWindowService.cs # BeWo/View/BeWoFileView.xaml # BeWo/View/Detail/Report/AbwesenheitsView.xaml # BeWo/View/Windows/AnimatedBeWoWindow.xaml.cs # BeWo/app.config # BeWoAllReports.sln # BeWoPlanerMobil.sln # BeWoPlanerMobil/.vs/BeWoPlanerMobil.csproj.dtbcache.json # BeWoTests.sln # Dakota/DakotaUtils.cs # Dakota/Logic/DakotaInfoCreator.cs # Dakota/Models/DakotaFile.cs # Data/Access/GenericDAO.cs # Data/Access/SearchDAO.cs # Data/Data.csproj # Host/Web.config # Server/Components/ServerUtils/ApiFacade/WebClientFacade.cs # Service/BeWoServiceEnums.cs # Service/Core/ServiceHelper.cs # Service/Core/ServiceValidator.cs # Service/Extensions/ServiceEnumExtension.cs # Service/Service.csproj # Service/ServiceContracts/Enhanced/IAiEnhancedService.cs # Service/ServiceContracts/Enhanced/IOperationsEnhancedService.cs # Service/ServiceImplementations/EmployeeServiceImp.cs # Service/ServiceImplementations/Enhanced/AiEnhancedServiceImp.cs # Service/ServiceImplementations/Enhanced/OperationsEnhancedServiceImp.cs # Service/ServiceProxy/OpenWebUIFacade.cs # Service/ServiceProxy/ServiceFacade.cs # Service/ServiceUtils/DistanceCalculator/GoogleDistanceMatrixAPI.cs # Shared/BeWoEntityEnums.cs # Shared/Core/AppError.cs # Shared/Core/Facade/WebClientFacade.cs # Shared/Core/WebClientFacade.cs # Shared/Shared.csproj
2025-11-28 12:07:35 +01:00
using BS.Shared.DataContracts;
using DevExpress.XtraRichEdit.Model;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
2025-06-05 14:03:55 +02:00
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
namespace BeWo.Service.ServiceProxy
{
public class XRechnungApiClient
{
private readonly JsonHttpClientFacade _JsonHttpClientFacade;
2025-06-05 14:03:55 +02:00
public XRechnungApiClient() : this(MergedConfig.GetSetting(WebConfigSetting.XRechnungApiUrl)) { }
public XRechnungApiClient(string base_url)
{
_JsonHttpClientFacade = new JsonHttpClientFacade(base_url);
}
2025-06-10 14:29:34 +02:00
public ApiResponse<byte[]> Create(object xrechnung)
2025-06-05 14:03:55 +02:00
{
_JsonHttpClientFacade.JsonObject = new
{
json = xrechnung
};
var bytes = _JsonHttpClientFacade.SendAsync("create").GetAwaiter().GetResult();
2025-06-10 14:29:34 +02:00
var response = ApiResponse<byte[]>.Parse(bytes);
2025-06-05 14:03:55 +02:00
return response;
}
2025-06-10 14:29:34 +02:00
public ApiResponse<byte[]> Create(object xrechnung, string url)
{
_JsonHttpClientFacade.JsonObject = new
{
json = xrechnung,
pdf = url
};
2025-06-05 14:03:55 +02:00
var bytes = _JsonHttpClientFacade.SendAsync("create").GetAwaiter().GetResult();
2025-06-10 14:29:34 +02:00
var response = ApiResponse<byte[]>.Parse(bytes);
2025-06-05 14:03:55 +02:00
return response;
}
}
}