Auf DataContract umgestiegen
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using BS.Shared.Attributes;
|
||||
using BS.Shared.DataContracts.AdminService;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -23,7 +24,7 @@ namespace BeWo.Service.ServiceContracts
|
||||
string Echo(string echo);
|
||||
|
||||
[OperationContract]
|
||||
[WebInvoke(UriTemplate = "/GetGkvSum?start={start}&end={end}", Method = "POST", ResponseFormat = WebMessageFormat.Json)]
|
||||
object GetGkvAbrechnungSumme(DateTime start, DateTime end);
|
||||
[WebInvoke(UriTemplate = "/GetGkvSum", Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
|
||||
object GetGkvAbrechnungSumme(AdminServiceSumReqDC request);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Service.ServiceContracts;
|
||||
using BS.Shared.DataContracts.AdminService;
|
||||
using DevExpress.Pdf.Native.BouncyCastle.Ocsp;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -23,19 +24,24 @@ namespace BeWo.Service.ServiceImplementations
|
||||
return echo;
|
||||
}
|
||||
|
||||
public object GetGkvAbrechnungSumme(DateTime start, DateTime end)
|
||||
public object GetGkvAbrechnungSumme(AdminServiceSumReqDC request)
|
||||
{
|
||||
if(start == default(DateTime))
|
||||
if (request == null)
|
||||
{
|
||||
return "Start darf nicht default(DateTime) sein";
|
||||
throw new ArgumentException("Request darf nicht null sein");
|
||||
}
|
||||
|
||||
if(end == default(DateTime))
|
||||
if(request.Start == default)
|
||||
{
|
||||
return "End darf nicht default(DateTime) sein";
|
||||
throw new ArgumentException("Start darf nicht default(DateTime) sein");
|
||||
}
|
||||
|
||||
var sum = DAOFactory.ScriptDAO.GetGkvSumByDateRange(start, end);
|
||||
if(request.End == default)
|
||||
{
|
||||
throw new ArgumentException("End darf nicht default(DateTime) sein");
|
||||
}
|
||||
|
||||
var sum = DAOFactory.ScriptDAO.GetGkvSumByDateRange(request.Start, request.End);
|
||||
|
||||
if (sum is decimal s)
|
||||
{
|
||||
|
||||
20
Shared/DataContracts/AdminService/AdminServiceSumReqDC.cs
Normal file
20
Shared/DataContracts/AdminService/AdminServiceSumReqDC.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BS.Shared.DataContracts.AdminService
|
||||
{
|
||||
[DataContract]
|
||||
public class AdminServiceSumReqDC : IAdminServiceDC
|
||||
{
|
||||
[DataMember(Name = "end")]
|
||||
public DateTime End { get; set; }
|
||||
|
||||
[DataMember(Name = "start")]
|
||||
public DateTime Start { get; set; }
|
||||
}
|
||||
}
|
||||
12
Shared/DataContracts/AdminService/IAdminServiceDC.cs
Normal file
12
Shared/DataContracts/AdminService/IAdminServiceDC.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BS.Shared.DataContracts.AdminService
|
||||
{
|
||||
public interface IAdminServiceDC : IDataContract
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -170,6 +170,8 @@
|
||||
<Compile Include="Core\ValidatorExtended.cs" />
|
||||
<Compile Include="Core\WohnheimbuchungsIntervall.cs" />
|
||||
<Compile Include="DataContracts\AbsenceOverviewFilterDC.cs" />
|
||||
<Compile Include="DataContracts\AdminService\IAdminServiceDC.cs" />
|
||||
<Compile Include="DataContracts\AdminService\AdminServiceSumReqDC.cs" />
|
||||
<Compile Include="DataContracts\AiSettingsDC.cs" />
|
||||
<Compile Include="DataContracts\AiChatDC.cs" />
|
||||
<Compile Include="DataContracts\AbwesenheitsInformationDC.cs" />
|
||||
|
||||
Reference in New Issue
Block a user