..weiter in Arbeit!

This commit is contained in:
Daniel Schick 2015-03-08 19:30:59 +00:00
parent 45f8447afd
commit bbed52967d
15 changed files with 367 additions and 1 deletions

Binary file not shown.

BIN
nsw/Archiv/nsw_ohne_HAZA_V1 Normal file

Binary file not shown.

BIN
nsw/Screenflow.docx Normal file

Binary file not shown.

View File

@ -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

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>

View File

@ -0,0 +1,37 @@
namespace SendNSWMessageService
{
partial class NSWSendService
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
this.ServiceName = "Service1";
}
#endregion
}
}

View File

@ -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()
{
}
}
}

View File

@ -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
{
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main()
{
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new NSWSendService()
};
ServiceBase.Run(ServicesToRun);
}
}
}

View File

@ -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")]

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E6F8F110-77E7-4348-9875-CAD095BF8E24}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SendNSWMessageService</RootNamespace>
<AssemblyName>SendNSWMessageService</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="NSWSendService.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="NSWSendService.Designer.cs">
<DependentUpon>NSWSendService.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -19,6 +19,9 @@ namespace bsmd.database
#region Enumerations #region Enumerations
/// <summary>
/// NSW notification class
/// </summary>
public enum NotificationClass public enum NotificationClass
{ {
VISIT, TRANSIT, NOA_NOD, ATA, ATD, SEC, POBA, POBD, NAME, TIEFA, TIEFD, VISIT, TRANSIT, NOA_NOD, ATA, ATD, SEC, POBA, POBD, NAME, TIEFA, TIEFD,
@ -28,6 +31,41 @@ namespace bsmd.database
public enum MessageStatus public enum MessageStatus
{ ACCEPTED, REJECTED } { ACCEPTED, REJECTED }
/// <summary>
/// Anhand dieses Filters und den Parametern können die Klassen das passende LoadQuery generieren
/// </summary>
public enum LoadFilter
{
ALL,
MESSAGETYPE,
REPORTINGPARTY,
MESSAGEHEADER
}
/// <summary>
/// Dieser Status wird von den Services (MessageService, ResponseService) ausgewertet
/// </summary>
public enum BSMDStatus
{
PREPARE,
TOSEND,
SENT,
RESPONDED,
FAILURE,
REPORTREQUESTED,
ARCHIVED
}
/// <summary>
/// Spezifiziert das gewünschte HIS zur Übertragung der Daten
/// </summary>
public enum NSWProvider
{
DBH,
DAKOSY,
DUDR
}
#endregion #endregion
#region Properties #region Properties
@ -71,6 +109,16 @@ namespace bsmd.database
/// </summary> /// </summary>
public ReportingParty ReportingParty { get { return this.reportingParty; } } public ReportingParty ReportingParty { get { return this.reportingParty; } }
/// <summary>
/// Status für Services
/// </summary>
public BSMDStatus InternalStatus { get; set; }
/// <summary>
/// die zur Kommunikation zu verwendende HIS Schnittstelle
/// </summary>
public NSWProvider HIS { get; set; }
#endregion #endregion
#region public virtual methods #region public virtual methods
@ -132,6 +180,28 @@ namespace bsmd.database
throw new NotImplementedException(); 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 #endregion
} }

View File

@ -31,6 +31,8 @@ namespace bsmd.database
public bool IsTransit { get; set; } public bool IsTransit { get; set; }
public Message.BSMDStatus BSMDStatus { get; set; }
#endregion #endregion
} }

View File

@ -45,7 +45,7 @@ namespace bsmd.database
#endregion #endregion
#region overrides #region overrides
public override string ToString() public override string ToString()
{ {