diff --git a/BeWoOhneReports.sln b/BeWoOhneReports.sln index d2b525eab..6a8978484 100644 --- a/BeWoOhneReports.sln +++ b/BeWoOhneReports.sln @@ -40,6 +40,7 @@ Global EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {3FEBB560-9275-413A-9767-BB68C44EEBC3}.Debug|.NET.ActiveCfg = Debug|Any CPU + {3FEBB560-9275-413A-9767-BB68C44EEBC3}.Debug|.NET.Build.0 = Debug|Any CPU {3FEBB560-9275-413A-9767-BB68C44EEBC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3FEBB560-9275-413A-9767-BB68C44EEBC3}.Debug|Any CPU.Build.0 = Debug|Any CPU {3FEBB560-9275-413A-9767-BB68C44EEBC3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -50,6 +51,7 @@ Global {3FEBB560-9275-413A-9767-BB68C44EEBC3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {3FEBB560-9275-413A-9767-BB68C44EEBC3}.Release|Mixed Platforms.Build.0 = Release|Any CPU {094331C3-ECEE-4C89-BBFD-4C9DED89F0EF}.Debug|.NET.ActiveCfg = Debug|Any CPU + {094331C3-ECEE-4C89-BBFD-4C9DED89F0EF}.Debug|.NET.Build.0 = Debug|Any CPU {094331C3-ECEE-4C89-BBFD-4C9DED89F0EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {094331C3-ECEE-4C89-BBFD-4C9DED89F0EF}.Debug|Any CPU.Build.0 = Debug|Any CPU {094331C3-ECEE-4C89-BBFD-4C9DED89F0EF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -60,6 +62,7 @@ Global {094331C3-ECEE-4C89-BBFD-4C9DED89F0EF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {094331C3-ECEE-4C89-BBFD-4C9DED89F0EF}.Release|Mixed Platforms.Build.0 = Release|Any CPU {B0D73E3D-4AE7-4024-93A6-DB1F46D7CCEE}.Debug|.NET.ActiveCfg = Debug|Any CPU + {B0D73E3D-4AE7-4024-93A6-DB1F46D7CCEE}.Debug|.NET.Build.0 = Debug|Any CPU {B0D73E3D-4AE7-4024-93A6-DB1F46D7CCEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B0D73E3D-4AE7-4024-93A6-DB1F46D7CCEE}.Debug|Any CPU.Build.0 = Debug|Any CPU {B0D73E3D-4AE7-4024-93A6-DB1F46D7CCEE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -70,6 +73,7 @@ Global {B0D73E3D-4AE7-4024-93A6-DB1F46D7CCEE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {B0D73E3D-4AE7-4024-93A6-DB1F46D7CCEE}.Release|Mixed Platforms.Build.0 = Release|Any CPU {2F50B83D-A3F0-4EC4-979A-3F9B7E3D8ED4}.Debug|.NET.ActiveCfg = Debug|Any CPU + {2F50B83D-A3F0-4EC4-979A-3F9B7E3D8ED4}.Debug|.NET.Build.0 = Debug|Any CPU {2F50B83D-A3F0-4EC4-979A-3F9B7E3D8ED4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2F50B83D-A3F0-4EC4-979A-3F9B7E3D8ED4}.Debug|Any CPU.Build.0 = Debug|Any CPU {2F50B83D-A3F0-4EC4-979A-3F9B7E3D8ED4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -80,6 +84,7 @@ Global {2F50B83D-A3F0-4EC4-979A-3F9B7E3D8ED4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {2F50B83D-A3F0-4EC4-979A-3F9B7E3D8ED4}.Release|Mixed Platforms.Build.0 = Release|Any CPU {D5E53B0F-BF5A-41E8-93E2-0F32845FC729}.Debug|.NET.ActiveCfg = Debug|Any CPU + {D5E53B0F-BF5A-41E8-93E2-0F32845FC729}.Debug|.NET.Build.0 = Debug|Any CPU {D5E53B0F-BF5A-41E8-93E2-0F32845FC729}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D5E53B0F-BF5A-41E8-93E2-0F32845FC729}.Debug|Any CPU.Build.0 = Debug|Any CPU {D5E53B0F-BF5A-41E8-93E2-0F32845FC729}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -90,6 +95,7 @@ Global {D5E53B0F-BF5A-41E8-93E2-0F32845FC729}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {D5E53B0F-BF5A-41E8-93E2-0F32845FC729}.Release|Mixed Platforms.Build.0 = Release|Any CPU {40D8B312-EA64-49E3-A31A-5E57ED4D5654}.Debug|.NET.ActiveCfg = Debug|Any CPU + {40D8B312-EA64-49E3-A31A-5E57ED4D5654}.Debug|.NET.Build.0 = Debug|Any CPU {40D8B312-EA64-49E3-A31A-5E57ED4D5654}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {40D8B312-EA64-49E3-A31A-5E57ED4D5654}.Debug|Any CPU.Build.0 = Debug|Any CPU {40D8B312-EA64-49E3-A31A-5E57ED4D5654}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -100,6 +106,7 @@ Global {40D8B312-EA64-49E3-A31A-5E57ED4D5654}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {40D8B312-EA64-49E3-A31A-5E57ED4D5654}.Release|Mixed Platforms.Build.0 = Release|Any CPU {E1154C7B-BB77-4155-9854-DAD8FC5A8BC3}.Debug|.NET.ActiveCfg = Debug|Any CPU + {E1154C7B-BB77-4155-9854-DAD8FC5A8BC3}.Debug|.NET.Build.0 = Debug|Any CPU {E1154C7B-BB77-4155-9854-DAD8FC5A8BC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E1154C7B-BB77-4155-9854-DAD8FC5A8BC3}.Debug|Any CPU.Build.0 = Debug|Any CPU {E1154C7B-BB77-4155-9854-DAD8FC5A8BC3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -110,6 +117,7 @@ Global {E1154C7B-BB77-4155-9854-DAD8FC5A8BC3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {E1154C7B-BB77-4155-9854-DAD8FC5A8BC3}.Release|Mixed Platforms.Build.0 = Release|Any CPU {663EFCB5-9E3E-4C76-97EE-3188E072634C}.Debug|.NET.ActiveCfg = Debug|Any CPU + {663EFCB5-9E3E-4C76-97EE-3188E072634C}.Debug|.NET.Build.0 = Debug|Any CPU {663EFCB5-9E3E-4C76-97EE-3188E072634C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {663EFCB5-9E3E-4C76-97EE-3188E072634C}.Debug|Any CPU.Build.0 = Debug|Any CPU {663EFCB5-9E3E-4C76-97EE-3188E072634C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU diff --git a/Data/Data.csproj b/Data/Data.csproj index bb315d94e..aec90b6f3 100644 --- a/Data/Data.csproj +++ b/Data/Data.csproj @@ -200,6 +200,7 @@ + @@ -732,6 +733,9 @@ Designer + + Designer + Designer diff --git a/Data/Entities/Address.cs b/Data/Entities/Address.cs index fd156065c..ce709453e 100644 --- a/Data/Entities/Address.cs +++ b/Data/Entities/Address.cs @@ -1,7 +1,9 @@ using BS.Shared; +using System.Diagnostics; namespace BeWo.Data.Entities { + [DebuggerDisplay("{Oid}: {Street}, {Town}")] public class Address : BeWoEntityBase { public static string PropertyName_AddressLine1 = "AddressLine1"; @@ -30,6 +32,12 @@ namespace BeWo.Data.Entities private string _Town; + private decimal? _Latitude; + + private decimal? _Longitude; + + private long? _L_Version; + public Address() { this._Tid = TableID.Address; @@ -114,7 +122,7 @@ namespace BeWo.Data.Entities } } } - + public virtual string Street { get @@ -147,6 +155,54 @@ namespace BeWo.Data.Entities } } + public virtual decimal? Latitude + { + get + { + return this._Latitude; + } + + set + { + if (this.AreDifferent(this._Latitude, value)) + { + this._Latitude = value; + } + } + } + + public virtual decimal? Longitude + { + get + { + return this._Longitude; + } + + set + { + if (this.AreDifferent(this._Longitude, value)) + { + this._Longitude = value; + } + } + } + + public virtual long? L_Version + { + get + { + return this._L_Version; + } + + set + { + if (this.AreDifferent(this._L_Version, value)) + { + this._L_Version = value; + } + } + } + public virtual Address CopyToNew() { return new Address @@ -161,5 +217,13 @@ namespace BeWo.Data.Entities Town = this.Town }; } + + public override int GetHashCode() + { + if (this is null) + return 0; + + return Oid.Value.GetHashCode(); + } } } \ No newline at end of file diff --git a/Data/Entities/AddressRoute.cs b/Data/Entities/AddressRoute.cs new file mode 100644 index 000000000..b5f2337ee --- /dev/null +++ b/Data/Entities/AddressRoute.cs @@ -0,0 +1,149 @@ +using BS.Shared; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BeWo.Data.Entities +{ + [DebuggerDisplay("{Oid}({Origin.Oid},{Destination.Oid}): {Distance_in_meter}m, {Time_in_seconds}s")] + public class AddressRoute : BeWoEntityBase + { + private Address _Origin; + private long _Origin_Version; + private Address _Destination; + private long _Destination_Version; + + private int distance_in_meter; + private string distance_in_meter_txt; + private int time_in_seconds; + private string time_in_seconds_txt; + + public AddressRoute() + { + _Tid = TableID.AddressRoute; + } + + public virtual Address Origin + { + get + { + return _Origin; + } + set + { + if (AreDifferent(_Origin, value)) + { + _Origin = value; + } + } + } + + public virtual long Origin_Version + { + get + { + return _Origin_Version; + } + set + { + if (AreDifferent(_Origin_Version, value)) + { + _Origin_Version = value; + } + } + } + + public virtual Address Destination + { + get + { + return _Destination; + } + set + { + if (AreDifferent(_Destination, value)) + { + _Destination = value; + } + } + } + + public virtual long Destination_Version + { + get + { + return _Destination_Version; + } + set + { + if (AreDifferent(_Destination_Version, value)) + { + _Destination_Version = value; + } + } + } + + public virtual int Distance_in_meter + { + get + { + return distance_in_meter; + } + set + { + if (AreDifferent(distance_in_meter, value)) + { + distance_in_meter = value; + } + } + } + + public virtual string Distance_in_meter_txt + { + get + { + return distance_in_meter_txt; + } + set + { + if (AreDifferent(distance_in_meter_txt, value)) + { + distance_in_meter_txt = value; + } + } + } + + public virtual int Time_in_seconds + { + get + { + return time_in_seconds; + } + set + { + if (AreDifferent(time_in_seconds, value)) + { + time_in_seconds = value; + } + } + } + + public virtual string Time_in_seconds_txt + { + get + { + return time_in_seconds_txt; + } + set + { + if (AreDifferent(time_in_seconds_txt, value)) + { + time_in_seconds_txt = value; + } + } + } + } +} diff --git a/Data/Mappings/Address.hbm.xml b/Data/Mappings/Address.hbm.xml index bc2beb473..3aaee5e42 100644 --- a/Data/Mappings/Address.hbm.xml +++ b/Data/Mappings/Address.hbm.xml @@ -6,19 +6,22 @@ - + - - - - - - - - - - - + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Data/Mappings/AddressRoute.hbm.xml b/Data/Mappings/AddressRoute.hbm.xml new file mode 100644 index 000000000..13ea6c719 --- /dev/null +++ b/Data/Mappings/AddressRoute.hbm.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Host/Host.csproj.user b/Host/Host.csproj.user index a441248c4..47b4326c0 100644 --- a/Host/Host.csproj.user +++ b/Host/Host.csproj.user @@ -3,7 +3,7 @@ BeWo2.0 true - Release|Any CPU + Debug|Any CPU false diff --git a/Host/Web.config b/Host/Web.config index 3cfe074b5..8a991ae7e 100644 --- a/Host/Web.config +++ b/Host/Web.config @@ -156,6 +156,12 @@ + + + + + + @@ -217,6 +223,11 @@ + + + + + diff --git a/Model/Changes_2023_03_09_AddressRoute.txt b/Model/Changes_2023_03_09_AddressRoute.txt new file mode 100644 index 000000000..ce4c5aae7 --- /dev/null +++ b/Model/Changes_2023_03_09_AddressRoute.txt @@ -0,0 +1,18 @@ +CREATE TABLE `AddressRoute` ( + `Oid` bigint NOT NULL AUTO_INCREMENT, + `Tid` int DEFAULT NULL, + `IsActive` tinyint DEFAULT NULL, + `Notice` varchar(1024) DEFAULT NULL, + `InsTs` datetime DEFAULT NULL, + `InsUser` varchar(256) DEFAULT NULL, + `Version` bigint DEFAULT NULL, + `UdpUser` varchar(256) DEFAULT NULL, + `SystemEntryID` int DEFAULT NULL, + `Address1Oid` bigint DEFAULT NULL, + `Address1Version` bigint DEFAULT NULL, + `Address2Oid` bigint DEFAULT NULL, + `Address2Version` bigint DEFAULT NULL, + `DistanceMeter` int DEFAULT NULL, + `TimeSec` int DEFAULT NULL, + PRIMARY KEY (`Oid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; \ No newline at end of file diff --git a/Model/Changes_2023_03_20_Address_Längengrad.txt b/Model/Changes_2023_03_20_Address_Längengrad.txt new file mode 100644 index 000000000..8a738cba0 --- /dev/null +++ b/Model/Changes_2023_03_20_Address_Längengrad.txt @@ -0,0 +1,4 @@ +ALTER TABLE `bewodemo`.`address` +ADD COLUMN `Latitude` DECIMAL(8,6) NULL DEFAULT NULL AFTER `AddressLine2`, +ADD COLUMN `Longitude` DECIMAL(9,6) NULL DEFAULT NULL AFTER `Latitude`, +ADD COLUMN `L_Version` BIGINT(19) NULL DEFAULT NULL AFTER `Longitude`; \ No newline at end of file diff --git a/Service/DCEntityMapper/AddressRouteDC_AddressRoute.cs b/Service/DCEntityMapper/AddressRouteDC_AddressRoute.cs new file mode 100644 index 000000000..fd2dbf175 --- /dev/null +++ b/Service/DCEntityMapper/AddressRouteDC_AddressRoute.cs @@ -0,0 +1,70 @@ +using BeWo.Data.Entities; +using BS.Shared.DataContracts; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BeWo.Service.DCEntityMapper +{ + public class AddressRouteDC_AddressRoute : AbstractIDCEntityMapper + { + public override AddressRouteDC MergeWithDC(AddressRoute pEntity, AddressRouteDC pDataContract) + { + pDataContract.Oid = pEntity.Oid; + pDataContract.IsActive = pEntity.IsActive; + pDataContract.Notice = pEntity.Notice; + pDataContract.InsTs = pEntity.InsTs; + pDataContract.InsUser = pEntity.InsUser; + pDataContract.Version = pEntity.Version; + pDataContract.UdpUser = pEntity.UdpUser; + pDataContract.SystemEntryID = pEntity.SystemEntryID; + + pDataContract.Origin_Address_Oid = pEntity.Origin.Oid.Value; + pDataContract.Origin_Address_Version = pEntity.Origin_Version; + pDataContract.Destination_Address_Oid = pEntity.Destination.Oid.Value; + pDataContract.Destination_Address_Version = pEntity.Destination_Version; + + pDataContract.Distance_in_meter = pEntity.Distance_in_meter; + pDataContract.Distance_in_meter_txt = pEntity.Distance_in_meter_txt; + pDataContract.Time_in_sec = pEntity.Time_in_seconds; + pDataContract.Time_in_sec_txt = pEntity.Time_in_seconds_txt; + + return pDataContract; + } + + public override AddressRoute MergeWithEntity(AddressRouteDC pDataContract, AddressRoute pEntity) + { + throw new NotImplementedException("#84971983047130984"); + + //this.ConcurrencyCheck(pDataContract.Version, pEntity); + + //pEntity.Oid = pDataContract.Oid; + //pEntity.Notice = pDataContract.Notice; + //pEntity.SystemEntryID = pDataContract.SystemEntryID; + + //pEntity.Origin = pDataContract.Origin_Address_Oid; + //pEntity.Address1_Version = pDataContract.Origin_Address_Version; + //pEntity.Address2_Oid = pDataContract.Destination_Address_Oid; + //pEntity.Address2_Version = pDataContract.Destination_Address_Version; + + //pEntity.Distance_in_meter = pDataContract.Distance_in_meter; + //pEntity.Distance_in_meter_txt = pDataContract.Distance_in_meter_txt; + //pEntity.Time_in_seconds = pDataContract.Time_in_sec; + //pEntity.Time_in_seconds_txt = pDataContract.Time_in_sec_txt; + + return pEntity; + } + + protected override bool AreDCAndEntityEqual(AddressRouteDC pDC, AddressRoute pEntity) + { + if (pDC.Oid == null) + { + return false; + } + + return pDC.Oid == pEntity.Oid; + } + } +} diff --git a/Service/DCEntityMapper/MapperFactory.cs b/Service/DCEntityMapper/MapperFactory.cs index 76b3a0425..a34c246a7 100644 --- a/Service/DCEntityMapper/MapperFactory.cs +++ b/Service/DCEntityMapper/MapperFactory.cs @@ -288,6 +288,8 @@ namespace BeWo.Service.DCEntityMapper private static AbwesenheitsInformationPrintDC_AbwesenheitsInformationPrint _AbwesenheitsInformationPrintDC_AbwesenheitsInformationPrint; + private static AddressRouteDC_AddressRoute _AddressRouteDC_AddressRoute; + public static MedRecordDC_MedRecord MedRecordDC_MedRecord => _MedRecordDC_MedRecord ?? (_MedRecordDC_MedRecord = new MedRecordDC_MedRecord()); @@ -723,5 +725,8 @@ namespace BeWo.Service.DCEntityMapper public static AbwesenheitsInformationPrintDC_AbwesenheitsInformationPrint AbwesenheitsInformationPrintDC_AbwesenheitsInformationPrint => _AbwesenheitsInformationPrintDC_AbwesenheitsInformationPrint ?? (_AbwesenheitsInformationPrintDC_AbwesenheitsInformationPrint = new AbwesenheitsInformationPrintDC_AbwesenheitsInformationPrint()); + + public static AddressRouteDC_AddressRoute AddressRouteDC_AddressRoute => + _AddressRouteDC_AddressRoute ?? (_AddressRouteDC_AddressRoute = new AddressRouteDC_AddressRoute()); } } \ No newline at end of file diff --git a/Service/Security/SecurityContextInitializer.cs b/Service/Security/SecurityContextInitializer.cs index cb1558c77..3d6182154 100644 --- a/Service/Security/SecurityContextInitializer.cs +++ b/Service/Security/SecurityContextInitializer.cs @@ -37,10 +37,19 @@ namespace BeWo.Service.Security string lServiceInterface = lTemp[lTemp.Count - 2]; // TODO Hier kann man jetzt etwas bauen wer sich für welchen service autorisieren muss... - if (lMethodName == "IsUserValid" || lMethodName == "IsUserValidTwoFactor" || lMethodName == "ResetTenant" || lMethodName == "ResetAllTenants" || lMethodName == "GetEmailForUserName") + var skip = new string[] { "Download", "Download2", "DownloadInfo", "GetUpdatePlan", "GetUpdateFile" }; + if (lMethodName == "IsUserValid" || lMethodName == "IsUserValidTwoFactor" || lMethodName == "ResetTenant" || lMethodName == "ResetAllTenant" || lMethodName == "GetEmailForUserName") { return null; } + else if (skip.Contains(lMethodName)) + { + return null; + } + else + { + // Vergessen neue Methode einzutragen? + } string lUserName = null, lPassword = null; diff --git a/Service/Service.csproj b/Service/Service.csproj index c06ec4701..254a37113 100644 --- a/Service/Service.csproj +++ b/Service/Service.csproj @@ -106,24 +106,6 @@ ..\packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll - - ..\packages\Microsoft.CodeAnalysis.Common.3.11.0\lib\netstandard2.0\Microsoft.CodeAnalysis.dll - - - ..\packages\Microsoft.CodeAnalysis.CSharp.3.11.0\lib\netstandard2.0\Microsoft.CodeAnalysis.CSharp.dll - - - ..\packages\Microsoft.CodeAnalysis.CSharp.Workspaces.3.11.0\lib\netstandard2.0\Microsoft.CodeAnalysis.CSharp.Workspaces.dll - - - ..\packages\Microsoft.CodeAnalysis.VisualBasic.3.11.0\lib\netstandard2.0\Microsoft.CodeAnalysis.VisualBasic.dll - - - ..\packages\Microsoft.CodeAnalysis.VisualBasic.Workspaces.3.11.0\lib\netstandard2.0\Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll - - - ..\packages\Microsoft.CodeAnalysis.Workspaces.Common.3.11.0\lib\netstandard2.0\Microsoft.CodeAnalysis.Workspaces.dll - False ..\Lib\MySql.Data.dll @@ -187,6 +169,7 @@ ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll @@ -236,6 +219,7 @@ + @@ -489,6 +473,11 @@ + + + + + @@ -524,6 +513,8 @@ + + @@ -532,19 +523,7 @@ - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - -