diff --git a/Stundensheet.xlsx b/Stundensheet.xlsx index a161dfd0..208023f2 100644 Binary files a/Stundensheet.xlsx and b/Stundensheet.xlsx differ diff --git a/nsw/Archiv/nsw_ohne_HAZA_V1 b/nsw/Archiv/nsw_ohne_HAZA_V1 new file mode 100644 index 00000000..aeefea9c Binary files /dev/null and b/nsw/Archiv/nsw_ohne_HAZA_V1 differ diff --git a/nsw/NSW Schnittstelle Leitgrundsätze und Definitionen.pdf b/nsw/NSW Schnittstelle Leitgrundsätze und Definitionen.pdf new file mode 100644 index 00000000..1b45ee3b Binary files /dev/null and b/nsw/NSW Schnittstelle Leitgrundsätze und Definitionen.pdf differ diff --git a/nsw/Screenflow.docx b/nsw/Screenflow.docx new file mode 100644 index 00000000..7ee5adb3 Binary files /dev/null and b/nsw/Screenflow.docx differ diff --git a/nsw/Source/SQL/Update_1.0_To_1.1.sql b/nsw/Source/SQL/Update_1.0_To_1.1.sql new file mode 100644 index 00000000..f5e2d076 --- /dev/null +++ b/nsw/Source/SQL/Update_1.0_To_1.1.sql @@ -0,0 +1,97 @@ + +BEGIN TRANSACTION +GO +PRINT N'Altering [dbo].[MessageHeader]...'; + + +GO +ALTER TABLE [dbo].[MessageHeader] + ADD [BSMDStatus] TINYINT NULL; + +GO + +ALTER TABLE [dbo].[MessageHeader] + ADD [HIS] TINYINT NULL; + +GO + +PRINT N'Altering [dbo].[MessageCore]...'; + +GO +ALTER TABLE [dbo].[MessageCore] + ADD [Wetris_zz_56_datensatz_id] INT NULL; + +GO + +ALTER TABLE [dbo].[MessageCore] + ADD [BSMDStatus] TINYINT NULL; + +GO + +ALTER TABLE MessageCore ADD [Created] [smalldatetime] NULL +ALTER TABLE MessageCore ADD [Changed] [smalldatetime] NULL + + +ALTER TABLE MessageHeader ADD [Created] [smalldatetime] NULL +ALTER TABLE MessageHeader ADD [Changed] [smalldatetime] NULL + + +ALTER TABLE MessageCore Add + CONSTRAINT [DF_MessageCore_Created] DEFAULT (getdate()) FOR [Created] +GO + +CREATE TRIGGER MessageCore_Trigger_Change_Log +ON + dbo.MessageCore + FOR UPDATE + AS + SET NOCOUNT ON + IF NOT UPDATE([Changed]) + UPDATE MessageCore SET [Changed] = GETDATE() WHERE Id IN (SELECT Id FROM [inserted]) +GO + +ALTER TABLE MessageHeader Add + CONSTRAINT [DF_MessageHeader_Created] DEFAULT (getdate()) FOR [Created] +GO + +CREATE TRIGGER MessageHeader_Trigger_Change_Log +ON + dbo.MessageHeader + FOR UPDATE + AS + SET NOCOUNT ON + IF NOT UPDATE([Changed]) + UPDATE MessageHeader SET [Changed] = GETDATE() WHERE Id IN (SELECT Id FROM [inserted]) +GO + + +IF @@ERROR <> 0 + AND @@TRANCOUNT > 0 + BEGIN + ROLLBACK; + END + +IF @@TRANCOUNT = 0 + BEGIN + INSERT INTO #tmpErrors (Error) + VALUES (1); + BEGIN TRANSACTION; + END + + +GO + +IF EXISTS (SELECT * FROM #tmpErrors) ROLLBACK TRANSACTION +GO +IF @@TRANCOUNT>0 BEGIN +PRINT N'The transacted portion of the database update succeeded.' +COMMIT TRANSACTION +END +ELSE PRINT N'The transacted portion of the database update failed.' +GO +DROP TABLE #tmpErrors +GO +PRINT N'Update complete.'; + + +GO diff --git a/nsw/Source/SendNSWMessageService/App.config b/nsw/Source/SendNSWMessageService/App.config new file mode 100644 index 00000000..fad249e4 --- /dev/null +++ b/nsw/Source/SendNSWMessageService/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/nsw/Source/SendNSWMessageService/NSWSendService.Designer.cs b/nsw/Source/SendNSWMessageService/NSWSendService.Designer.cs new file mode 100644 index 00000000..095b2cd5 --- /dev/null +++ b/nsw/Source/SendNSWMessageService/NSWSendService.Designer.cs @@ -0,0 +1,37 @@ +namespace SendNSWMessageService +{ + partial class NSWSendService + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + this.ServiceName = "Service1"; + } + + #endregion + } +} diff --git a/nsw/Source/SendNSWMessageService/NSWSendService.cs b/nsw/Source/SendNSWMessageService/NSWSendService.cs new file mode 100644 index 00000000..e84723cf --- /dev/null +++ b/nsw/Source/SendNSWMessageService/NSWSendService.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Diagnostics; +using System.Linq; +using System.ServiceProcess; +using System.Text; +using System.Threading.Tasks; + +namespace SendNSWMessageService +{ + public partial class NSWSendService : ServiceBase + { + public NSWSendService() + { + InitializeComponent(); + } + + protected override void OnStart(string[] args) + { + } + + protected override void OnStop() + { + } + } +} diff --git a/nsw/Source/SendNSWMessageService/Program.cs b/nsw/Source/SendNSWMessageService/Program.cs new file mode 100644 index 00000000..c81cf08e --- /dev/null +++ b/nsw/Source/SendNSWMessageService/Program.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.ServiceProcess; +using System.Text; +using System.Threading.Tasks; + +namespace SendNSWMessageService +{ + static class Program + { + /// + /// The main entry point for the application. + /// + static void Main() + { + ServiceBase[] ServicesToRun; + ServicesToRun = new ServiceBase[] + { + new NSWSendService() + }; + ServiceBase.Run(ServicesToRun); + } + } +} diff --git a/nsw/Source/SendNSWMessageService/Properties/AssemblyInfo.cs b/nsw/Source/SendNSWMessageService/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..41f175ce --- /dev/null +++ b/nsw/Source/SendNSWMessageService/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("SendNSWMessageService")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SendNSWMessageService")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("5c3f7fda-d841-4b58-892c-7b84fe150b22")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/nsw/Source/SendNSWMessageService/SendNSWMessageService.csproj b/nsw/Source/SendNSWMessageService/SendNSWMessageService.csproj new file mode 100644 index 00000000..800e8fb2 --- /dev/null +++ b/nsw/Source/SendNSWMessageService/SendNSWMessageService.csproj @@ -0,0 +1,65 @@ + + + + + Debug + AnyCPU + {E6F8F110-77E7-4348-9875-CAD095BF8E24} + WinExe + Properties + SendNSWMessageService + SendNSWMessageService + v4.5 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + Component + + + NSWSendService.cs + + + + + + + + + + \ No newline at end of file diff --git a/nsw/Source/bsmd.database/Message.cs b/nsw/Source/bsmd.database/Message.cs index 1acd6752..2cc12476 100644 --- a/nsw/Source/bsmd.database/Message.cs +++ b/nsw/Source/bsmd.database/Message.cs @@ -19,6 +19,9 @@ namespace bsmd.database #region Enumerations + /// + /// NSW notification class + /// public enum NotificationClass { VISIT, TRANSIT, NOA_NOD, ATA, ATD, SEC, POBA, POBD, NAME, TIEFA, TIEFD, @@ -28,6 +31,41 @@ namespace bsmd.database public enum MessageStatus { ACCEPTED, REJECTED } + /// + /// Anhand dieses Filters und den Parametern können die Klassen das passende LoadQuery generieren + /// + public enum LoadFilter + { + ALL, + MESSAGETYPE, + REPORTINGPARTY, + MESSAGEHEADER + } + + /// + /// Dieser Status wird von den Services (MessageService, ResponseService) ausgewertet + /// + public enum BSMDStatus + { + PREPARE, + TOSEND, + SENT, + RESPONDED, + FAILURE, + REPORTREQUESTED, + ARCHIVED + } + + /// + /// Spezifiziert das gewünschte HIS zur Übertragung der Daten + /// + public enum NSWProvider + { + DBH, + DAKOSY, + DUDR + } + #endregion #region Properties @@ -71,6 +109,16 @@ namespace bsmd.database /// public ReportingParty ReportingParty { get { return this.reportingParty; } } + /// + /// Status für Services + /// + public BSMDStatus InternalStatus { get; set; } + + /// + /// die zur Kommunikation zu verwendende HIS Schnittstelle + /// + public NSWProvider HIS { get; set; } + #endregion #region public virtual methods @@ -132,6 +180,28 @@ namespace bsmd.database throw new NotImplementedException(); } + public void PrepareLoadCommand(IDbCommand cmd, LoadFilter filter, params object[] criteria ) + { + string query = "SELECT Id, ClientRequestId, MessageCoreId, MessageId, SentAt, ReceivedAt, NotificationClass, " + + "Reset, Cancel, Status, ReportingPartyId FROM MessageHeader "; + + switch (filter) + { + case LoadFilter.REPORTINGPARTY: + { + query += "WHERE ReportingPartyId = @RPID"; + ((SqlCommand)cmd).Parameters.AddWithValue("RPID", criteria[0]); + break; + } + case LoadFilter.ALL: + default: + break; + } + + cmd.CommandText = query; + } + + #endregion } diff --git a/nsw/Source/bsmd.database/MessageCore.cs b/nsw/Source/bsmd.database/MessageCore.cs index 50554320..23e466d6 100644 --- a/nsw/Source/bsmd.database/MessageCore.cs +++ b/nsw/Source/bsmd.database/MessageCore.cs @@ -31,6 +31,8 @@ namespace bsmd.database public bool IsTransit { get; set; } + public Message.BSMDStatus BSMDStatus { get; set; } + #endregion } diff --git a/nsw/Source/bsmd.database/ReportingParty.cs b/nsw/Source/bsmd.database/ReportingParty.cs index 25098a0e..0454f850 100644 --- a/nsw/Source/bsmd.database/ReportingParty.cs +++ b/nsw/Source/bsmd.database/ReportingParty.cs @@ -45,7 +45,7 @@ namespace bsmd.database #endregion - #region overrides + #region overrides public override string ToString() { diff --git a/nsw/Source/bsmd.dbh.ResponseService.v12.suo b/nsw/Source/bsmd.dbh.ResponseService.v12.suo index df5635d2..0180dbea 100644 Binary files a/nsw/Source/bsmd.dbh.ResponseService.v12.suo and b/nsw/Source/bsmd.dbh.ResponseService.v12.suo differ