diff --git a/Stundensheet.xlsx b/Stundensheet.xlsx index a58adaa0..71549f7a 100644 Binary files a/Stundensheet.xlsx and b/Stundensheet.xlsx differ diff --git a/nsw/Herberg/WSAPIFormData.wsdl b/nsw/Herberg/WSAPIFormData.wsdl new file mode 100644 index 00000000..10d96a00 --- /dev/null +++ b/nsw/Herberg/WSAPIFormData.wsdl @@ -0,0 +1,364 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The GUID of the folder template + + + + + + The GUID of the form template + + + + + + The GUID of the folder + + + + + The GUID of the form + + + + + The IMO number this form belongs to. + + + + + + The date of the latest revision. + + + + + + + + + + + + The value + + + + + + The optional unit + + + + + + The widget name this cell belongs to. + + + + + + The widget id the value belongs to. Note + that this entry is the id within the form template but NOT the database id of the widget! + + + + + + The optional row number. This is set if we + have a widget that is part of a table. + + + + + + + + + + + + + The date of the revision. + + + + + + The begin of the period this dataset is valid + for. + + + + + + The end of the period this row is valid for. + If startPeriod is not given, the endPeriod contains the sample + timestamp. + + + + + + + The values. + + + + + + + + + + + + + The reporting or requesting party. + + + + + + The optional time frame. If not set then all entries are returned. + + + + + + This is the Fleetform form template name (see + FolderTemplate.Template.TemplateName). + You have to either set + this or ffFolderTemplateTypeTag. + + + + + + This is the Fleetform folder template typeTag, + e.g. CREWLIST, PERFORMANCEREPORT, SHIPDETAILS, etc. See + FolderTemplate in fleetform.xsd + for possible values. + + + + + + + + + + + The request + + + + + A set of form data found in the database. + + + + + + + This flag is set to true if the route was + successfully stored. + Otherwise, result contains the error + message. + + + + + + + + + + + + + The reporting or requesting party. + + + + + + The GUID of the form. + + + + + + + + + + + + + The request belonging to this response. + + + + + + The IMO number of the vessel this form belongs + to. + + + + + + + The requested data. If not found then this + entry is null. Note that we may have several entries for one + form here since one form may contain several entries. + + + + + + + + + This flag is set to true if the route was + successfully stored. + Otherwise, result contains the error + message. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nsw/Herberg/auth.xsd b/nsw/Herberg/auth.xsd new file mode 100644 index 00000000..930d3e42 --- /dev/null +++ b/nsw/Herberg/auth.xsd @@ -0,0 +1,45 @@ + + + + + + This is the identifier the client has to report. + + + + + + The unique id of the company. This is a unique + GUID identifying the + company using the API. Only if the company is registered, they may use + the API. + + + + + + The unique id of the client. This is a unique + GUID identifying the + individual sender. E.g. each boat may have a unique id. + + + + + + The optional name of the sending client. This is only for helping us identifying the sending + party. + + + + + + + \ No newline at end of file diff --git a/nsw/Herberg/device.xsd b/nsw/Herberg/device.xsd new file mode 100644 index 00000000..8828701d --- /dev/null +++ b/nsw/Herberg/device.xsd @@ -0,0 +1,89 @@ + + + + + + This is the device ID. + + + + + The bearer key reference. We have several ways + to identify the device. + E.g. for inmarsatc, we use fleetID and vesselID (and mobile number, if + available). + For D+, we use the vesselID. Daily Report uses the IMO number. + + + + + + + + + + + + The callsign. For instance, Globewireless uses this. + + + + + + The Globalstar device id. Example: 0-545312 + + + + + + + The vesselID contains a unique GUID identifying the device. We use this e.g. for the API. + + + + + + IMEI - International Mobile Equipment Identity (e.g. BGAN) + + + + + + + + + + The inmarsat C mobile number. + + + + + This is the DNID for INMARSATC. + + + + + + This is the terminal, member number, GUID, MMSI, etc. + + + + + + This is the IMO number. + + + + + + \ No newline at end of file diff --git a/nsw/Herberg/geoarea.xsd b/nsw/Herberg/geoarea.xsd new file mode 100644 index 00000000..ac6d885f --- /dev/null +++ b/nsw/Herberg/geoarea.xsd @@ -0,0 +1,200 @@ + + + + + + + + This is a geographical area. It can be a polygon + or a bounding box. + + + + + + Geographical coverages of this area + + + + + + DB Area ID + + + + + + DB Area list ID + + + + + + DB Area name + + + + + + + + + + + This is a geographical coverage belonging to an area. + + + + + + Geographical positions + + + + + + The type of this coverage. Bounding boxes are + between the first 2 positions. + + + + + + + + + + + + DB Area coverage ID + + + + + + DB Area Coverage name + + + + + + + + + This is an event related to an area. + + + + + + Geographical position when the event happened. + + + + + + DB Area coverage ID + + + + + + + DB Area ID + + + + + + DB Area list ID + + + + + + DB Area name + + + + + + DB Area Coverage name + + + + + + This flag indicates that the event has been generated but + not yet been proven. Example: It is proven if the vessel is within the areas more than 1 minute. + + + + + + This flag indicates that the event has been reported ashore. + + + + + + The type of this event. + + + + + + + The vessel has entered the area + + + + + + The vessel has left the area + + + + + + The vessel has stopped in the area + + + + + + The vessel has started moving within the area + + + + + + + + + \ No newline at end of file diff --git a/nsw/Herberg/inlandPosition.xsd b/nsw/Herberg/inlandPosition.xsd new file mode 100644 index 00000000..4bb2acf3 --- /dev/null +++ b/nsw/Herberg/inlandPosition.xsd @@ -0,0 +1,231 @@ + + + + + + + + + This is the distance on a river. + + + + + This is the current value in the given unit. + + + + + + + + + + + + + + + + + + + This is the speed of a target. + + + + + This is the current value in the given unit. + + + + + + + + + + + + + + + + + + + This represents a river. + + + + + This is the river name. + + + + + + This is the river abbreviation. + + + + + + + + + This represents a miles marker entry. + + + + + + This is the river mile or kilometer. + + + + + + This is the unit of the miles. + + + + + + + + + + + + This is the river. + + + + + + + + + This represents a miles marker entry with a + geographic position. + + + + + + + + The geographic position of this miles marker + + + + + + + + + + + This represents a set of miles marker entry with a + geographic position. + + + + + + A set of miles marker entries with positions. + + + + + + + + + This represents a no passing zone. + + + + + + The mandatory unique id + + + + + + The optional name for identification. + + + + + + The begin of the no passing zone. This is always + the lower mile marker. + + + + + + The end of the no passing zone. This is always + the higher mile marker. + + + + + + + + + This represents a set of no passing zones + + + + + + A set of NoPassingZone objects. + + + + + + \ No newline at end of file diff --git a/nsw/Herberg/position.xsd b/nsw/Herberg/position.xsd new file mode 100644 index 00000000..cf35dfe6 --- /dev/null +++ b/nsw/Herberg/position.xsd @@ -0,0 +1,127 @@ + + + + + + This is a geographical position. + + + + + + Latitude in degrees x 60000, North > 0 + + + + + + Latitude in degrees x 60000, East > 0 + + + + + + + + + + + This is a geographical position with a timestamp. + + + + + + + + Timestamp when the position was made + + + + + + + + + + + This is a geographical position of a pasttrack. + + + + + + + + The order number of the pastttack. The + higher + the number, the older the position. + + + + + Rate of turn in deg/s, right > 0, left < + 0) + + + + + Speed over ground in knots + + + + + + Course over ground in degrees + + + + + + Heading in degrees + + + + + + ETA to next port + + + + + + ETB to next port + + + + + + Next port + + + + + + + + \ No newline at end of file diff --git a/nsw/Herberg/route.xsd b/nsw/Herberg/route.xsd new file mode 100644 index 00000000..6f900156 --- /dev/null +++ b/nsw/Herberg/route.xsd @@ -0,0 +1,97 @@ + + + + + + This represents a waypoint of a planned route. + + + + + This is a unique id of the waypoint within the route. + + + + + + This is an optional name of this waypoint. + + + + + + This is the unique id of the NEXT + waypoint within the route. This element is not set + for the last waypoint. + + + + + This is the latitude of this waypoint in minutes x 1000 (= degrees x 60000). + Positive = North, Negative = South. + Example: 12 deg 23.4 min North = (12 * 60 + 23.4) * 1000 = 743400 + + + + + + This is the longitude of this waypoint in minutes x 1000 (= degrees x 60000). + Positive = East, Negative = West. + Example: 122 deg 23.4 min West = -(122 * 60 + 23.4) * 1000 = -7343400 + + + + + + This is the planned speed over ground (SOG) in knots TO this waypoint. + So the ship will calculate to go from the previous waypoint to this + waypoint at this speed. + + + + + + + + + + This represents the planned ship route. + + + + + This is a unique id of the route. The ID has to be unique + for the vessel. + + + + + + This is the IMO number of the vessel this route belongs to. + + + + + This is the timestamp in UTC when the route has been created. + + + + + This is the ETA in local time when the ship is calculated to + reach the final waypoint of this route. + + + + + This is the list of waypoints. + + + + + \ No newline at end of file diff --git a/nsw/Herberg/schedule.xsd b/nsw/Herberg/schedule.xsd new file mode 100644 index 00000000..ce801948 --- /dev/null +++ b/nsw/Herberg/schedule.xsd @@ -0,0 +1,600 @@ + + + + + + + + + The type of agent. + + + + + + + This is the default agent, also called the Charterers agent. + + + + + + + This is the crewing agent. + + + + + + + This is the purchasing agent. + + + + + + + This is the owners agent. + + + + + + + + + + The destination type of the schedule entry. + + + + + + + This is a port where the ship can berth. + + + + + + + This is an anchorage area. + + + + + + + This is a drifting time. + + + + + + + This is a canal that the vessel may pass. + + + + + + + This is a range indicating a general direction. + + + + + + + + + + The type of a remark that may be attached to a schedule entry. + + + + + + + + + + + + + + + + + + This type is for all future arrivals of all + vessels to the same + destination. + + + + + + + + This type is for all future arrivals of the + specified vessel to the + same destination. + + + + + + + + This type is for the specified destination only. + + + + + + + + + + + + + + + + + + This is a destination remark. It refers either to + a particular + destination or a fixed object (i.e. a port). + + + + + + This is the date when the remark was created. + + + + + + + + + This is the optional remark type for user + remarks. If the + type is USER_REMARK then this entry defines how the + user remark should be displayed. + + + + + + + This is the optional user name who entered the + remarks. + + + + + + + This is the optional message (the remark). + + + + + + + + + + + + This id is given by the Daily Report. This is + NOT the database id. + + + + + + + + + + + + + + + + + + + + + + + + + + + + The entry was created at this time + in UTC. + + + + + + The entry was removed at this time + in UTC. + + + + + + + Indicates that this entry should not be used any more. Added 01/2015. + + + + + + + This is the unique GUID of this entry. Added 01/2015. + + + + + + + + + + This is a destination remark. It refers either to + a particular + destination or a fixed object (i.e. a port). + + + + + + + + This is the unique identifier (ident) created by + the Daily Report + tool. for historical reasons, this is + an integer + created based on the time stamp. The id is unique within + the + schedule. + + + + + + + This is the optional voyage number this + destination belongs to. It is + normally entered on board and is a + number or string. + + + + + + + + The name of the schedule entry. This may be the port name (e.g. Hamburg), the anchorage name etc. + + + + + + + + The type of this schedule entry. + + + + + + + + The state code (for US ports) + + + + + + + + The unique UN location code (3 letters, e.g. HAM for Hamburg) + + + + + + + + The ISO country code (e.g. DE for Germany, US for USA). + + + + + + + + This is the optional country name. + + + + + + + + This is the optional geographic position of + the + destination. + + + + + + + + The expected time of arrival (local time). + + + + + + + The expected time of departure (local time). + + + + + + + The expected time of berth (local time). + + + + + + + This is the optional arrival at pilot + station (local time). + + + + + + + This is the optional Finished with Engine (local time). + Only + if arrived. + + + + + + + This is the optional End of Sea Passage (local time). + Only + if + arrived. + + + + + + + This is the optional Actual time of Berth (local time). + Only if arrived. + Note: This is deprecated! + + + + + + + This is the optional Stand by Engine (local time). + Only if + departed. + + + + + + + This is the optional Actual time of + Departure (local time). + Only if departed. + Note: This is deprecated! + + + + + + + This is the optional Begin of Sea Passage. + Only + if departed. + + + + + + + If true, the vessel arrived at the destination. + + + + + + + If true, the vessel departed from the destination. + + + + + + + If true, this destination was canceled. + + + + + + + + Some remarks by the author responsible for the schedule. + + + + + + + + The port activity. This may be a set of the + following operations. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This optional value indicates that the + destination is preliminary. + + + + + + + + + + The agents responsible for the vessel at the destination. + + + + + + + + A set of remarks related to the destination. + + + + + + + + + + + + + An identifier for the schedule (not the database id). Note that several vessels may have schedules with identical SCHEDULE_IDs. + + + + + + + + Last modification time of the schedule. + + + + + + + This is the author, normally the captains name. + + + + + + + This is the optional chief engineers name. + + + + + + optional Chief officer name + + + + + + + The destinations of this schedule. These are the schedule entries. + + + + + + diff --git a/nsw/Herberg/ship.xsd b/nsw/Herberg/ship.xsd new file mode 100644 index 00000000..fec8224b --- /dev/null +++ b/nsw/Herberg/ship.xsd @@ -0,0 +1,127 @@ + + + + + + + + + This is how the ship is displayed. + + + + + This is the color for not selected ship. + + + + + + This is the color for selected ship. + + + + + + + + + This is the ship category. + + + + + This is the ship category number. + + + + + + The name of the category. + + + + + + + + + This is the abstract ship. + + + + + Database id + + + + + Ship name + + + + + Charter ship name + + + + + The past positions of the ship including the latest position. + + + + + + Optional ULR to photo image. + + + + + + This is the ship category. This attribute is used to group a fleet + into several parts. + + + + + + This contains optional individual settings for the ship appearence. + + + + + + + + + This is a Fleettracker Ship. + + + + + + + The IMO number of the ship. + + + + + The optional set of devices. + + + + + The optional route. + + + + + + + \ No newline at end of file diff --git a/nsw/Herberg/shipParams.xsd b/nsw/Herberg/shipParams.xsd new file mode 100644 index 00000000..282425db --- /dev/null +++ b/nsw/Herberg/shipParams.xsd @@ -0,0 +1,95 @@ + + + + + + The own ship parameter used for speed calculation. + + + + + + + This is the MMSI of the own ship. + + + + + + + + Minimal own speed we can achieve. + Unit: Meter per + second + + + + + + + Minimal own speed we can achieve. + Unit: Meter per + second + + + + + + + Optimal speed we would like to go. + Unit: Meter + per second + + + + + + + The maximal positive accelaration we can + achieve. + Unit: Meter per second^2 + + + + + + + The minimal negative accelaration we can + achieve. + Unit: Meter per second^2 + + + + + + + The optimal accelaration we would like to use if + we + want to go from current speed to optimal speed. This will be + applied + if we do not have any targets. + Example: We run 5 mph, our + optimal speed is 8 mph, then we use this + acceleration + to go from 5 + to 8. + Unit: Meter per second^2 + + + + + + + diff --git a/nsw/Herberg/target.xsd b/nsw/Herberg/target.xsd new file mode 100644 index 00000000..c19bba39 --- /dev/null +++ b/nsw/Herberg/target.xsd @@ -0,0 +1,59 @@ + + + + + + + + This represents a river. + + + + + This is the current miles marker + + + + + + + + + + + + + + + This is the current miles marker + + + + + + This is the name of the target + + + + + + This is the current speed + + + + + + \ No newline at end of file diff --git a/nsw/NSW Schnittstelle Meldetypen und Attribute.xlsx b/nsw/NSW Schnittstelle Meldetypen und Attribute.xlsx index 8cc45b9a..67f77c3c 100644 Binary files a/nsw/NSW Schnittstelle Meldetypen und Attribute.xlsx and b/nsw/NSW Schnittstelle Meldetypen und Attribute.xlsx differ diff --git a/nsw/Source/SendNSWMessageService/NSWSendService.cs b/nsw/Source/SendNSWMessageService/NSWSendService.cs index 00054eff..35cbe981 100644 --- a/nsw/Source/SendNSWMessageService/NSWSendService.cs +++ b/nsw/Source/SendNSWMessageService/NSWSendService.cs @@ -76,30 +76,30 @@ namespace SendNSWMessageService _log.InfoFormat("Sending CORE message for {0} application to {1}", message.MessageCore.IsTransit ? "TRANSIT" : "VISIT", message.MessageCore.InitialHIS.ToString()); + bool sendSucceeded = false; // switch über passendes HIS / Schnittstelle switch (message.MessageCore.InitialHIS) { case Message.NSWProvider.DBH: - bsmd.dbh.Request.SendMessage(message); - + sendSucceeded = bsmd.dbh.Request.SendMessage(message); break; case Message.NSWProvider.DAKOSY: - + _log.Warn("Cannot send via DAKOSY yet"); break; case Message.NSWProvider.DUDR: - + _log.Warn("Cannot send via Daten und Dienste HRO yet"); break; default: - + _log.WarnFormat("Initial HIS not specified for message {0}", message.Id); break; - - } - // senden - - // .. + if (sendSucceeded) + { + message.InternalStatus = Message.BSMDStatus.SENT; + DBManager.Instance.Save(message); + } } catch (Exception ex) diff --git a/nsw/Source/SendNSWMessageService/SendNSWMessageService.csproj b/nsw/Source/SendNSWMessageService/SendNSWMessageService.csproj index fbf29867..f201e0cf 100644 --- a/nsw/Source/SendNSWMessageService/SendNSWMessageService.csproj +++ b/nsw/Source/SendNSWMessageService/SendNSWMessageService.csproj @@ -68,7 +68,9 @@ - + + Designer + SettingsSingleFileGenerator diff --git a/nsw/Source/bsmd.database/DBManager.cs b/nsw/Source/bsmd.database/DBManager.cs index cb29dc35..ebd6c593 100644 --- a/nsw/Source/bsmd.database/DBManager.cs +++ b/nsw/Source/bsmd.database/DBManager.cs @@ -112,6 +112,24 @@ namespace bsmd.database return result; } + public void Save(Message message) + { + SqlCommand cmd = new SqlCommand(); + message.PrepareSave(cmd); + int queryResult = this.PerformNonQuery(cmd); + switch(queryResult) + { + case 1: + _log.InfoFormat("Message {0} saved", message.Id); break; + case 0: + _log.WarnFormat("Message {0} save affected no rows", message.Id); break; + case -1: + _log.WarnFormat("Message {0} save: error occurred", message.Id); break; + default: + _log.WarnFormat("Message {0} save affected {1} rows", message.Id, queryResult); break; + } + } + #endregion #region internal/private funcs @@ -132,24 +150,75 @@ namespace bsmd.database SqlCommand cmd = new SqlCommand(); - switch(message.MessageNotificationClass) - { - case Message.NotificationClass.STAT: - STAT stat = new STAT(); - stat.PrepareLoadCommand(cmd, Message.LoadFilter.MESSAGEHEADER, message.Id); - SqlDataReader reader = this.PerformCommand(cmd); - List statList = stat.LoadList(reader); - if (statList.Count > 0) - message.DerivedMessage = statList[0]; - ((STAT)statList[0]).MessageHeader = message; - break; - default: - break; + DatabaseEntity msgClass = DBManager.CreateMessage(message.MessageNotificationClass); + if (msgClass != null) + { + msgClass.PrepareLoadCommand(cmd, Message.LoadFilter.MESSAGEHEADER, message.Id); + SqlDataReader reader = this.PerformCommand(cmd); + List statList = msgClass.LoadList(reader); + if (statList.Count > 0) message.DerivedMessage = statList[0]; + ((IMessageClass)msgClass).MessageHeader = message; + } + else + { + _log.ErrorFormat("cannot create a message class for notification type {0}", message.MessageNotificationClass); } - } - + this.LoadDependingLists(message); + + } + } + + /// + /// factory method for messages by type + /// + internal static DatabaseEntity CreateMessage(Message.NotificationClass notificationClass) + { + DatabaseEntity result = null; + switch (notificationClass) + { + case Message.NotificationClass.STAT: result = new STAT(); break; + case Message.NotificationClass.NOA_NOD: result = new NOA_NOD(); break; + case Message.NotificationClass.MDH: result = new MDH(); break; + default: break; + } + return result; + } + + /// + /// Loads inner lists / collections + /// + internal void LoadDependingLists(DatabaseEntity databaseEntity) + { + SqlCommand cmd = new SqlCommand(); + + if(databaseEntity.GetType().IsAssignableFrom(typeof(MDH))) + { + MDH mdh = databaseEntity as MDH; + mdh.PrepareLoadCommand(cmd, Message.LoadFilter.MDH_ID); + SqlDataReader reader = this.PerformCommand(cmd); + List poc30s = mdh.LoadList(reader); + foreach (PortOfCallLast30Days poc30 in poc30s) + { + mdh.PortOfCallLast30Days.Add(poc30); + poc30.MDH = mdh; + this.LoadDependingLists(poc30); + } + } + + if(databaseEntity.GetType().IsAssignableFrom(typeof(PortOfCallLast30Days))) + { + PortOfCallLast30Days poc30 = databaseEntity as PortOfCallLast30Days; + poc30.PrepareLoadCommand(cmd, Message.LoadFilter.POC30_ID); + SqlDataReader reader = this.PerformCommand(cmd); + List poc30Names = poc30.LoadList(reader); + foreach (PortOfCallLast30DaysCrewJoinedShip poc30Name in poc30Names) + { + poc30.CrewJoinedShip.Add(poc30Name); + poc30Name.PortOfCallLast30Days = poc30; + } + } } internal void LoadErrorList(Message message) @@ -191,6 +260,22 @@ namespace bsmd.database } } + internal int PerformNonQuery(SqlCommand cmd) + { + try + { + cmd.Connection = this._con; + return cmd.ExecuteNonQuery(); + } + catch (SqlException ex) + { + System.Diagnostics.Trace.WriteLine("SQL Exception:" + ex.Message); + _log.Error("Error performing command", ex); + return -1; + } + } + + #endregion } diff --git a/nsw/Source/bsmd.database/DatabaseEntity.cs b/nsw/Source/bsmd.database/DatabaseEntity.cs index ba23c187..ced5ec69 100644 --- a/nsw/Source/bsmd.database/DatabaseEntity.cs +++ b/nsw/Source/bsmd.database/DatabaseEntity.cs @@ -36,7 +36,7 @@ namespace bsmd.database /// public bool IsNew { get { return !this.id.HasValue; } } - public virtual void PrepareSave(IDbCommand cmd) { } + public abstract void PrepareSave(IDbCommand cmd); public virtual void PrepareDelete(IDbCommand cmd) { @@ -47,6 +47,7 @@ namespace bsmd.database public abstract void PrepareLoadCommand(IDbCommand cmd, Message.LoadFilter filter, params object[] criteria); - public abstract List LoadList(IDataReader reader); + public abstract List LoadList(IDataReader reader); + } } diff --git a/nsw/Source/bsmd.database/IMessageClass.cs b/nsw/Source/bsmd.database/IMessageClass.cs new file mode 100644 index 00000000..ab1b13cb --- /dev/null +++ b/nsw/Source/bsmd.database/IMessageClass.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace bsmd.database +{ + interface IMessageClass + { + Message MessageHeader { get; set; } + } +} diff --git a/nsw/Source/bsmd.database/MDH.cs b/nsw/Source/bsmd.database/MDH.cs new file mode 100644 index 00000000..a43a06dc --- /dev/null +++ b/nsw/Source/bsmd.database/MDH.cs @@ -0,0 +1,210 @@ +// +// Class: MDH +// Current CLR: 4.0.30319.34209 +// System: Microsoft Visual Studio 10.0 +// Author: dani +// Created: 3/21/2015 10:56:30 AM +// +// Copyright (c) 2015 Informatikbüro Daniel Schick. All rights reserved. + +using System; +using System.Data; +using System.Data.SqlClient; +using System.Collections.Generic; + +namespace bsmd.database +{ + public class MDH : DatabaseEntity, IMessageClass + { + + private List portOfCallLast30Days = new List(); + + public MDH() + { + this.tablename = "[dbo].[MDH]"; + } + + #region Properties + + public Message MessageHeader { get; set; } + + public List PortOfCallLast30Days { get { return this.portOfCallLast30Days; } } + + public string MDHSimplification { get; set; } + + public string PortOfCallWhereCompleteMDHNotified { get; set; } + + public bool? NonAccidentalDeathsDuringVoyage { get; set; } + + public int? NonAccidentalDeathsDuringVoyageCount { get; set; } + + public bool? SuspisionInfectiousNature { get; set; } + + public bool? NumberOfIllPersonsHigherThanExpected { get; set; } + + public int? NumberOfIllPersons { get; set; } + + public bool? SickPersonsOnBoard { get; set; } + + public bool? MedicalConsulted { get; set; } + + public bool? AwareOfFurtherInfections { get; set; } + + public bool? SanitaryMeasuresApplied { get; set; } + + public string SanitaryMeasuresType { get; set; } + + public string SanitaryMeasuresLocation { get; set; } + + public DateTime? SanitaryMeasuresDate { get; set; } + + public bool? StowawaysDetected { get; set; } + + public string StowawaysJoiningLocation { get; set; } + + public bool? SickAnimalOrPetOnBoard { get; set; } + + public bool? ValidSanitaryControlExemptionOrCertificateOnBoard { get; set; } + + public string PlaceOfIssue { get; set; } + + public DateTime? DateOfIssue { get; set; } + + public bool? SanitaryControlReinspectionRequired { get; set; } + + public bool? InfectedAreaVisited { get; set; } + + public string InfectedAreaPort { get; set; } + + public DateTime? InfectedAreaDate { get; set; } + + #endregion + + #region abstract method implementation + + public override void PrepareSave(System.Data.IDbCommand cmd) + { + SqlCommand scmd = cmd as SqlCommand; + + scmd.Parameters.AddWithNullableValue("@P1", this.MessageHeader.Id); + scmd.Parameters.AddWithNullableValue("@P2", this.MDHSimplification); + scmd.Parameters.AddWithNullableValue("@P3", this.PortOfCallWhereCompleteMDHNotified); + scmd.Parameters.AddWithNullableValue("@P4", this.NonAccidentalDeathsDuringVoyage); + scmd.Parameters.AddWithNullableValue("@P5", this.NonAccidentalDeathsDuringVoyageCount); + scmd.Parameters.AddWithNullableValue("@P6", this.SuspisionInfectiousNature); + scmd.Parameters.AddWithNullableValue("@P7", this.NumberOfIllPersonsHigherThanExpected); + scmd.Parameters.AddWithNullableValue("@P8", this.NumberOfIllPersons); + scmd.Parameters.AddWithNullableValue("@P9", this.SickPersonsOnBoard); + scmd.Parameters.AddWithNullableValue("@P10", this.MedicalConsulted); + scmd.Parameters.AddWithNullableValue("@P11", this.AwareOfFurtherInfections); + scmd.Parameters.AddWithNullableValue("@P12", this.SanitaryMeasuresApplied); + scmd.Parameters.AddWithNullableValue("@P13", this.SanitaryMeasuresType); + scmd.Parameters.AddWithNullableValue("@P14", this.SanitaryMeasuresLocation); + scmd.Parameters.AddWithNullableValue("@P15", this.SanitaryMeasuresDate); + scmd.Parameters.AddWithNullableValue("@P16", this.StowawaysDetected); + scmd.Parameters.AddWithNullableValue("@P17", this.StowawaysJoiningLocation); + scmd.Parameters.AddWithNullableValue("@P18", this.SickAnimalOrPetOnBoard); + scmd.Parameters.AddWithNullableValue("@P19", this.ValidSanitaryControlExemptionOrCertificateOnBoard); + scmd.Parameters.AddWithNullableValue("@P20", this.PlaceOfIssue); + scmd.Parameters.AddWithNullableValue("@P21", this.DateOfIssue); + scmd.Parameters.AddWithNullableValue("@P22", this.SanitaryControlReinspectionRequired); + scmd.Parameters.AddWithNullableValue("@P23", this.InfectedAreaVisited); + scmd.Parameters.AddWithNullableValue("@P24", this.InfectedAreaPort); + scmd.Parameters.AddWithNullableValue("@P25", this.InfectedAreaDate); + + + if (this.IsNew) + { + scmd.CommandText = string.Format("INSERT INTO {0} MessageHeaderId, MDHSimplification, PortOfCallWhereCompleteMDHNotified, " + + "NonAccidentalDeathsDuringVoyage, NonAccidentalDeathsDuringVoyageCount, SuspisionInfectiousNature, NumberOfIllPersonsHigherThanExpected, " + + "NumberOfIllPersons, SickPersonsOnBoard, MedicalConsulted, AwareOfFurtherInfections, SanitaryMeasuresApplied, SanitaryMeasuresType, " + + "SanitaryMeasuresLocation, SanitaryMeasuresDate, StowawaysDetected, StowawaysJoiningLocation, SickAnimalOrPetOnBoard, " + + "ValidSanitaryControlExemptionOrCertificateOnBoard, PlaceOfIssue, DateOfIssue, SanitaryControlReinspectionRequired, " + + "InfectedAreaVisited, InfectedAreaPort, InfectedAreaDate) VALUES (@P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, @P12, " + + "@P13, @P14, @P15, @P16, @P17, @P18, @P19, @P20, @P21, @P22, @P23, @P24, @P25)", this.Tablename); + } + else + { + scmd.CommandText = string.Format("UPDATE {0} SET MDHSimplification = @P2, PortOfCallWhereCompleteMDHNotified = @P3, " + + "NonAccidentalDeathsDuringVoyage = @P4, NonAccidentalDeathsDuringVoyageCount = @P5, SuspisionInfectiousNature = @P6, " + + "NumberOfIllPersonsHigherThanExpected = @P7, NumberOfIllPersons = @P8, SickPersonsOnBoard = @P9, MedicalConsulted = @P10, " + + "AwareOfFurtherInfections = @P11, SanitaryMeasuresApplied = @P12, SanitaryMeasuresType = @P13, SanitaryMeasuresLocation = @P14, " + + "SanitaryMeasuresDate = @P15, StowawaysDetected = @P16, StowawaysJoiningLocation = @P17, SickAnimalOrPetOnBoard = @P18, " + + "ValidSanitaryControlExemptionOrCertificateOnBoard = @P19, PlaceofIssue = @P20, DateOfIssue = @P21, SanitaryControlReinspectionRequired = @P22, " + + "InfectedAreaVisited = @P23, InfectedAreaPort = @P24, InfectedAreaDate = @P25", this.Tablename); + scmd.Parameters.AddWithValue("@ID", this.Id); + } + } + + public override void PrepareLoadCommand(System.Data.IDbCommand cmd, Message.LoadFilter filter, params object[] criteria) + { + string query = string.Format("SELECT Id, MDHSimplification, PortOfCallWhereCompleteMDHNotified, " + + "NonAccidentalDeathsDuringVoyage, NonAccidentalDeathsDuringVoyageCount, SuspisionInfectiousNature, " + + "NumberOfIllPersonsHigherThanExpected, NumberOfIllPersons, SickPersonsOnBoard, MedicalConsulted, AwareOfFurtherInfections, " + + "SanitaryMeasuresApplied, SanitaryMeasuresType, SanitaryMeasuresLocation, SanitaryMeasuresDate, StowawaysDetected, " + + "StowawaysJoiningLocation, SickAnimalOrPetOnBoard, ValidSanitaryControlExemptionOrCertificateOnBoard, " + + "PlaceOfIssue, DateOfIssue, SanitaryControlReinspectionRequired, InfectedAreaVisited, InfectedAreaPort, InfectedAreaDate " + + "FROM {0}", this.Tablename); + + switch (filter) + { + case Message.LoadFilter.MESSAGEHEADER: + query += "WHERE MessageHeaderId = @MHID"; + ((SqlCommand)cmd).Parameters.AddWithValue("@MHID", criteria[0]); + break; + case Message.LoadFilter.ALL: + default: + + break; + } + cmd.CommandText = query; + } + + public override List LoadList(System.Data.IDataReader reader) + { + List result = new List(); + + while (reader.Read()) + { + MDH mdh = new MDH(); + + mdh.id = reader.GetGuid(0); + if (!reader.IsDBNull(1)) mdh.MDHSimplification = reader.GetString(1); + + this.id = reader.GetGuid(0); + if (!reader.IsDBNull(1)) mdh.MDHSimplification = reader.GetString(1); + if (!reader.IsDBNull(2)) mdh.PortOfCallWhereCompleteMDHNotified = reader.GetString(2); + if (!reader.IsDBNull(3)) mdh.NonAccidentalDeathsDuringVoyage = reader.GetBoolean(3); + if (!reader.IsDBNull(4)) mdh.NonAccidentalDeathsDuringVoyageCount = reader.GetInt32(4); + if (!reader.IsDBNull(5)) mdh.SuspisionInfectiousNature = reader.GetBoolean(5); + if (!reader.IsDBNull(6)) mdh.NumberOfIllPersonsHigherThanExpected = reader.GetBoolean(6); + if (!reader.IsDBNull(7)) mdh.NumberOfIllPersons = reader.GetInt32(7); + if (!reader.IsDBNull(8)) mdh.SickPersonsOnBoard = reader.GetBoolean(8); + if (!reader.IsDBNull(9)) mdh.MedicalConsulted = reader.GetBoolean(9); + if (!reader.IsDBNull(10)) mdh.AwareOfFurtherInfections = reader.GetBoolean(10); + if (!reader.IsDBNull(11)) mdh.SanitaryMeasuresApplied = reader.GetBoolean(11); + if (!reader.IsDBNull(12)) mdh.SanitaryMeasuresType = reader.GetString(12); + if (!reader.IsDBNull(13)) mdh.SanitaryMeasuresLocation = reader.GetString(13); + if (!reader.IsDBNull(14)) mdh.SanitaryMeasuresDate = reader.GetDateTime(14); + if (!reader.IsDBNull(15)) mdh.StowawaysDetected = reader.GetBoolean(15); + if (!reader.IsDBNull(16)) mdh.StowawaysJoiningLocation = reader.GetString(16); + if (!reader.IsDBNull(17)) mdh.SickAnimalOrPetOnBoard = reader.GetBoolean(17); + if (!reader.IsDBNull(18)) mdh.ValidSanitaryControlExemptionOrCertificateOnBoard = reader.GetBoolean(18); + if (!reader.IsDBNull(19)) mdh.PlaceOfIssue = reader.GetString(19); + if (!reader.IsDBNull(20)) mdh.DateOfIssue = reader.GetDateTime(20); + if (!reader.IsDBNull(21)) mdh.SanitaryControlReinspectionRequired = reader.GetBoolean(21); + if (!reader.IsDBNull(22)) mdh.InfectedAreaVisited = reader.GetBoolean(22); + if (!reader.IsDBNull(23)) mdh.InfectedAreaPort = reader.GetString(23); + if (!reader.IsDBNull(24)) mdh.InfectedAreaDate = reader.GetDateTime(24); + + result.Add(mdh); + } + + reader.Close(); + return result; + } + + #endregion + + } +} diff --git a/nsw/Source/bsmd.database/Message.cs b/nsw/Source/bsmd.database/Message.cs index 9de76727..74948672 100644 --- a/nsw/Source/bsmd.database/Message.cs +++ b/nsw/Source/bsmd.database/Message.cs @@ -46,7 +46,9 @@ namespace bsmd.database REPORTINGPARTY, MESSAGEHEADER, BSMDSTATUS, - WETRIS_SHIP_ID + WETRIS_SHIP_ID, + MDH_ID, + POC30_ID } /// diff --git a/nsw/Source/bsmd.database/NOA_NOD.cs b/nsw/Source/bsmd.database/NOA_NOD.cs new file mode 100644 index 00000000..85e8bba5 --- /dev/null +++ b/nsw/Source/bsmd.database/NOA_NOD.cs @@ -0,0 +1,132 @@ +// +// Class: NOA_NOD +// Current CLR: 4.0.30319.34209 +// System: Microsoft Visual Studio 10.0 +// Author: dani +// Created: 3/21/2015 8:56:24 AM +// +// Copyright (c) 2015 Informatikbüro Daniel Schick. All rights reserved. + +using System; +using System.Data; +using System.Data.SqlClient; +using System.Collections.Generic; + +namespace bsmd.database +{ + public class NOA_NOD : DatabaseEntity, IMessageClass + { + + public NOA_NOD() + { + this.tablename = "[dbo].[NOA_NOD]"; + } + + #region Properties + + public Message MessageHeader { get; set; } + + public DateTime? ETAToPortOfCall { get; set; } + + public DateTime? ETDFromPortOfCall { get; set; } + + public int? CallPurposeCode { get; set; } + + public string CallPurposeDescription { get; set; } + + public DateTime? ETAToKielCanal { get; set; } + + public DateTime? ETDFromKielCanal { get; set; } + + public string LastPort { get; set; } + + public DateTime? ETDFromLastPort { get; set; } + + public string NextPort { get; set; } + + public DateTime? ETAToNextPort { get; set; } + + #endregion + + #region abstract class implementation + + public override void PrepareLoadCommand(System.Data.IDbCommand cmd, Message.LoadFilter filter, params object[] criteria) + { + string query = string.Format("SELECT Id, ETAToPortOfCall, ETDFromPortOfCall, CallPurposeCode, CallPurposeDescription, " + + "ETAToKielCanal, ETDFromKielCanal, LastPort, ETDFromLastPort, NextPort, ETAToNextPort FROM {0}", this.Tablename); + + switch (filter) + { + case Message.LoadFilter.MESSAGEHEADER: + query += "WHERE MessageHeaderId = @MHID"; + ((SqlCommand)cmd).Parameters.AddWithValue("@MHID", criteria[0]); + break; + case Message.LoadFilter.ALL: + default: + + break; + } + + cmd.CommandText = query; + } + + public override List LoadList(System.Data.IDataReader reader) + { + List result = new List(); + while(reader.Read()) + { + NOA_NOD nn = new NOA_NOD(); + nn.id = reader.GetGuid(0); + if (!reader.IsDBNull(1)) nn.ETAToPortOfCall = reader.GetDateTime(1); + if (!reader.IsDBNull(2)) nn.ETDFromPortOfCall = reader.GetDateTime(2); + if (!reader.IsDBNull(3)) nn.CallPurposeCode = reader.GetInt32(3); + if (!reader.IsDBNull(4)) nn.CallPurposeDescription = reader.GetString(4); + if (!reader.IsDBNull(5)) nn.ETAToKielCanal = reader.GetDateTime(5); + if (!reader.IsDBNull(6)) nn.ETDFromKielCanal = reader.GetDateTime(6); + if (!reader.IsDBNull(7)) nn.LastPort = reader.GetString(7); + if (!reader.IsDBNull(8)) nn.ETDFromLastPort = reader.GetDateTime(8); + if (!reader.IsDBNull(9)) nn.NextPort = reader.GetString(9); + if (!reader.IsDBNull(10)) nn.ETAToNextPort = reader.GetDateTime(10); + result.Add(nn); + } + reader.Close(); + return result; + } + + public override void PrepareSave(IDbCommand cmd) + { + SqlCommand scmd = cmd as SqlCommand; + + scmd.Parameters.AddWithNullableValue("@P1", this.MessageHeader.Id); + scmd.Parameters.AddWithNullableValue("@P2", this.ETAToPortOfCall); + scmd.Parameters.AddWithNullableValue("@P3", this.ETDFromPortOfCall); + scmd.Parameters.AddWithNullableValue("@P4", this.CallPurposeCode.Value); + scmd.Parameters.AddWithNullableValue("@P5", this.CallPurposeDescription); + scmd.Parameters.AddWithNullableValue("@P6", this.ETAToKielCanal); + scmd.Parameters.AddWithNullableValue("@P7", this.ETDFromKielCanal); + scmd.Parameters.AddWithNullableValue("@P8", this.LastPort); + scmd.Parameters.AddWithNullableValue("@P9", this.ETDFromLastPort); + scmd.Parameters.AddWithNullableValue("@P10", this.NextPort); + scmd.Parameters.AddWithNullableValue("@P11", this.ETAToNextPort); + + if (this.IsNew) + { + cmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, ETAToPortOfCall, ETDFromPortOfCall, " + + "CallPurposeCode, CallPurposeDescription, ETAToKielCanal, ETDFromKielCanal, LastPort, ETDFromLastPort, " + + "NextPort, ETAToNextPort) VALUES (@P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11) ", this.Tablename); + } + else + { + ((SqlCommand)cmd).Parameters.AddWithValue("@ID", this.Id); + + cmd.CommandText = string.Format("UPDATE {0} SET ETAToPortOfCall = @P2, ETDFromPortOfCall = @P3, CallPurposeCode = @P4, " + + "CallPurposeDescription = @P5, ETAToKielCanal = @P6, ETDFromKielCanal = @P7, LastPort = @P8, ETDFromLastPort = @P9, " + + "NextPort = @P10, ETAToNextPort = @P11 WHERE Id = @ID", this.Tablename); + + } + } + + #endregion + + } +} diff --git a/nsw/Source/bsmd.database/POBA.cs b/nsw/Source/bsmd.database/POBA.cs new file mode 100644 index 00000000..4e2403ce --- /dev/null +++ b/nsw/Source/bsmd.database/POBA.cs @@ -0,0 +1,76 @@ +// +// Class: POBA - Personen an Bord beim Anlaufen +// Current CLR: 4.0.30319.34209 +// System: Microsoft Visual Studio 10.0 +// Author: dani +// Created: 3/25/2015 7:19:35 AM +// +// Copyright (c) 2015 Informatikbüro Daniel Schick. All rights reserved. + +using System; +using System.Data; +using System.Data.SqlClient; +using System.Collections.Generic; + +namespace bsmd.database +{ + public class POBA : DatabaseEntity, IMessageClass + { + + public POBA() + { + this.tablename = "[dbo].[POBA]"; + } + + #region Properties + + public Message MessageHeader { get; set; } + + public int? TotalPersonsOnBoardUponArrival { get; set; } + + public int? TotalCrewMembersOnBoardUponArrival { get; set; } + + public int? TotalPassengersOnBoardUponArrival { get; set; } + + public int? TotalStowawaysOnBoardUponArrival { get; set; } + + #endregion + + public override void PrepareSave(System.Data.IDbCommand cmd) + { + + SqlCommand scmd = cmd as SqlCommand; + + scmd.Parameters.AddWithValue("@P1", this.MessageHeader.Id); + scmd.Parameters.AddWithNullableValue("@P2", this.TotalPersonsOnBoardUponArrival); + scmd.Parameters.AddWithNullableValue("@P3", this.TotalCrewMembersOnBoardUponArrival); + scmd.Parameters.AddWithNullableValue("@P4", this.TotalPassengersOnBoardUponArrival); + scmd.Parameters.AddWithNullableValue("@P5", this.TotalStowawaysOnBoardUponArrival); + + if (this.IsNew) + { + scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, TotalPersonsOnBoardUponArrival, " + + "TotalCrewMembersonBoardUponArrival, TotalPassengersOnBoardUponArrival, " + + "TotalStowawaysOnBoardUponArrival) VALUES (@P1, @P2, @P3, @P4, @P5)", this.Tablename); + } + else + { + scmd.Parameters.AddWithValue(@"ID", this.Id); + scmd.CommandText = string.Format("UPDATE {0} SET TotalPersonsOnBoardUponArrival = @P2, " + + "TotalCrewMembersOnBoardUponArrival = @P3, TotalPassengersOnBoardUponArrival = @P4" + + "TotalStowawaysOnBoardUponArrival = @P5 WHERE Id = @ID", this.Tablename); + } + + } + + public override void PrepareLoadCommand(System.Data.IDbCommand cmd, Message.LoadFilter filter, params object[] criteria) + { + throw new NotImplementedException(); + } + + public override List LoadList(System.Data.IDataReader reader) + { + throw new NotImplementedException(); + } + } +} diff --git a/nsw/Source/bsmd.database/POBD.cs b/nsw/Source/bsmd.database/POBD.cs new file mode 100644 index 00000000..3aa66950 --- /dev/null +++ b/nsw/Source/bsmd.database/POBD.cs @@ -0,0 +1,75 @@ +// +// Class: POBD - Personen an Bord beim Auslaufen +// Current CLR: 4.0.30319.34209 +// System: Microsoft Visual Studio 10.0 +// Author: dani +// Created: 3/25/2015 7:19:51 AM +// +// Copyright (c) 2015 Informatikbüro Daniel Schick. All rights reserved. + +using System; +using System.Data; +using System.Data.SqlClient; +using System.Collections.Generic; + +namespace bsmd.database +{ + public class POBD : DatabaseEntity, IMessageClass + { + + public POBD() + { + this.tablename = "[dbo].[POBD]"; + } + + #region Properties + + public Message MessageHeader { get; set; } + + public int? TotalPersonsOnBoardUponDeparture { get; set; } + + public int? TotalCrewMembersOnBoardUponDeparture { get; set; } + + public int? TotalPassengersOnBoardUponDeparture { get; set; } + + public int? TotalStowawaysOnBoardUponDeparture { get; set; } + + #endregion + + public override void PrepareSave(System.Data.IDbCommand cmd) + { + + SqlCommand scmd = cmd as SqlCommand; + + scmd.Parameters.AddWithValue("@P1", this.MessageHeader.Id); + scmd.Parameters.AddWithNullableValue("@P2", this.TotalPersonsOnBoardUponDeparture); + scmd.Parameters.AddWithNullableValue("@P3", this.TotalCrewMembersOnBoardUponDeparture); + scmd.Parameters.AddWithNullableValue("@P4", this.TotalPassengersOnBoardUponDeparture); + scmd.Parameters.AddWithNullableValue("@P5", this.TotalStowawaysOnBoardUponDeparture); + + if (this.IsNew) + { + scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, TotalPersonsOnBoardUponDeparture, " + + "TotalCrewMembersonBoardUponDeparture, TotalPassengersOnBoardUponDeparture, " + + "TotalStowawaysOnBoardUponDeparture) VALUES (@P1, @P2, @P3, @P4, @P5)", this.Tablename); + } + else + { + scmd.Parameters.AddWithValue(@"ID", this.Id); + scmd.CommandText = string.Format("UPDATE {0} SET TotalPersonsOnBoardUponDeparture = @P2, " + + "TotalCrewMembersOnBoardUponDeparture = @P3, TotalPassengersOnBoardUponDeparture = @P4" + + "TotalStowawaysOnBoardUponDeparture = @P5 WHERE Id = @ID", this.Tablename); + } + } + + public override void PrepareLoadCommand(System.Data.IDbCommand cmd, Message.LoadFilter filter, params object[] criteria) + { + throw new NotImplementedException(); + } + + public override List LoadList(System.Data.IDataReader reader) + { + throw new NotImplementedException(); + } + } +} diff --git a/nsw/Source/bsmd.database/PortOfCallLast30Days.cs b/nsw/Source/bsmd.database/PortOfCallLast30Days.cs new file mode 100644 index 00000000..1340e2d9 --- /dev/null +++ b/nsw/Source/bsmd.database/PortOfCallLast30Days.cs @@ -0,0 +1,106 @@ +// +// Class: PortOfCallLast30Days +// Current CLR: 4.0.30319.34209 +// System: Microsoft Visual Studio 10.0 +// Author: dani +// Created: 3/22/2015 8:29:02 AM +// +// Copyright (c) 2015 Informatikbüro Daniel Schick. All rights reserved. + +using System; +using System.Data; +using System.Data.SqlClient; +using System.Collections.Generic; + +namespace bsmd.database +{ + public class PortOfCallLast30Days : DatabaseEntity + { + + private List poc30Crew = new List(); + + public PortOfCallLast30Days() + { + this.tablename = "[dbo].[PortOfCallLast30Days]"; + } + + #region Properties + + public MDH MDH { get; set; } + + public List CrewJoinedShip { get { return this.poc30Crew; } } + + public string PortOfCallLast30DaysLocode { get; set; } + + public DateTime? PortOfCallLast30DaysDateOfDeparture { get; set; } + + public bool? PortOfCallLast30DaysCrewMembersJoined { get; set; } + + #endregion + + #region abstract class implementation + + public override void PrepareSave(IDbCommand cmd) + { + SqlCommand scmd = cmd as SqlCommand; + + scmd.Parameters.AddWithNullableValue("@P1", this.MDH.Id); + scmd.Parameters.AddWithNullableValue("@P2", this.PortOfCallLast30DaysLocode); + scmd.Parameters.AddWithNullableValue("@P3", this.PortOfCallLast30DaysDateOfDeparture); + scmd.Parameters.AddWithNullableValue("@P4", this.PortOfCallLast30DaysCrewMembersJoined); + + if (this.IsNew) + { + scmd.CommandText = string.Format("INSERT INTO {0} (MDH_Id, PortOfCallLast30DaysLocode, PortOfCallLast30DaysDateOfDeparture, " + + "PortOfCallLast30DaysCrewMembersJoined) VALUES (@P1, @P2, @P3, @P4)", this.Tablename); + } + else + { + scmd.CommandText = string.Format("UPDATE {0} SET PortOfCallLast30DaysLocode = @P2, PortOfCallLast30DaysDateOfDeparture = @P3, " + + "PortOfCallLast30DaysCrewMembersJoined = @P4 WHERE Id = @ID", this.Tablename); + scmd.Parameters.AddWithNullableValue("@ID", this.Id); + } + } + + public override void PrepareLoadCommand(IDbCommand cmd, Message.LoadFilter filter, params object[] criteria) + { + + string query = string.Format("SELECT Id, PortOfCallLast30DaysLocode, PortOfCallLast30DaysDateOfDeparture, " + + "PortOfCallLast30DaysCrewMembersJoined FROM {0}", this.Tablename); + + switch (filter) + { + case Message.LoadFilter.MDH_ID: + query += "WHERE MDH_Id = @MDHID"; + ((SqlCommand)cmd).Parameters.AddWithValue("@MHID", criteria[0]); + break; + case Message.LoadFilter.ALL: + default: + + break; + } + cmd.CommandText = query; + } + + public override List LoadList(IDataReader reader) + { + List result = new List(); + + while (reader.Read()) + { + PortOfCallLast30Days poc = new PortOfCallLast30Days(); + poc.id = reader.GetGuid(0); + if (!reader.IsDBNull(1)) poc.PortOfCallLast30DaysLocode = reader.GetString(1); + if (!reader.IsDBNull(2)) poc.PortOfCallLast30DaysDateOfDeparture = reader.GetDateTime(2); + if (!reader.IsDBNull(3)) poc.PortOfCallLast30DaysCrewMembersJoined = reader.GetBoolean(3); + result.Add(poc); + } + + reader.Close(); + return result; + } + + #endregion + + } +} diff --git a/nsw/Source/bsmd.database/PortOfCallLast30DaysCrewJoinedShip.cs b/nsw/Source/bsmd.database/PortOfCallLast30DaysCrewJoinedShip.cs new file mode 100644 index 00000000..d98b5f49 --- /dev/null +++ b/nsw/Source/bsmd.database/PortOfCallLast30DaysCrewJoinedShip.cs @@ -0,0 +1,95 @@ +// +// Class: PortOfCallLast30DaysCrewJoinedShip +// Current CLR: 4.0.30319.34209 +// System: Microsoft Visual Studio 10.0 +// Author: dani +// Created: 3/22/2015 8:53:43 AM +// +// Copyright (c) 2015 Informatikbüro Daniel Schick. All rights reserved. + +using System; +using System.Data; +using System.Data.SqlClient; +using System.Collections.Generic; + +namespace bsmd.database +{ + public class PortOfCallLast30DaysCrewJoinedShip : DatabaseEntity + { + + public PortOfCallLast30DaysCrewJoinedShip() + { + this.tablename = "[dbo].[PortOfCallLast30DaysCrewJoinedShip]"; + } + + #region Properties + + public PortOfCallLast30Days PortOfCallLast30Days { get; set; } + + public string PortOfCallLast30DaysCrewJoinedShipName { get; set; } + + #endregion + + #region abstract class implementation + + public override void PrepareSave(IDbCommand cmd) + { + SqlCommand scmd = cmd as SqlCommand; + + scmd.Parameters.AddWithValue("@P1", this.PortOfCallLast30Days.Id); + scmd.Parameters.AddWithNullableValue("@P2", this.PortOfCallLast30DaysCrewJoinedShipName); + + if (this.IsNew) + { + cmd.CommandText = string.Format("INSERT INTO {0} (PortOfCallLast30DaysId = @P1, PortOfCallLast30DaysCrewJoinedShipName = @P2", + this.Tablename); + } + else + { + cmd.CommandText = string.Format("UPDATE {0} SET PortOfCallLast30DaysCrewJoinedShipName = @P2 WHERE Id = @ID", this.Tablename); + scmd.Parameters.AddWithValue("@ID", this.Id); + } + + } + + public override void PrepareLoadCommand(IDbCommand cmd, Message.LoadFilter filter, params object[] criteria) + { + + string query = string.Format("SELECT Id, PortOfCallLast30DaysCrewJoinedShipName FROM {0}"); + + switch (filter) + { + case Message.LoadFilter.POC30_ID: + query += "WHERE MDH_Id = @MDHID"; + ((SqlCommand)cmd).Parameters.AddWithValue("@MHID", criteria[0]); + break; + case Message.LoadFilter.ALL: + default: + + break; + } + + cmd.CommandText = query; + } + + public override List LoadList(IDataReader reader) + { + List result = new List(); + + while(reader.Read()) + { + PortOfCallLast30DaysCrewJoinedShip poc30 = new PortOfCallLast30DaysCrewJoinedShip(); + poc30.id = reader.GetGuid(0); + if (!reader.IsDBNull(1)) poc30.PortOfCallLast30DaysCrewJoinedShipName = reader.GetString(1); + result.Add(poc30); + } + + reader.Close(); + return result; + + } + + #endregion + + } +} diff --git a/nsw/Source/bsmd.database/STAT.cs b/nsw/Source/bsmd.database/STAT.cs index 5447ed5b..c5082298 100644 --- a/nsw/Source/bsmd.database/STAT.cs +++ b/nsw/Source/bsmd.database/STAT.cs @@ -14,7 +14,7 @@ using System.Collections.Generic; namespace bsmd.database { - public class STAT : DatabaseEntity + public class STAT : DatabaseEntity, IMessageClass { public STAT() @@ -60,7 +60,9 @@ namespace bsmd.database #endregion - public void PrepareLoadCommand(IDbCommand cmd, Message.LoadFilter filter, params object[] criteria) + #region abstract class implementation + + public override void PrepareLoadCommand(IDbCommand cmd, Message.LoadFilter filter, params object[] criteria) { string query = string.Format("SELECT Id, ShipName, Callsign, MMSINumber, Flag, LengthOverall_MTR, Beam_MTR, " + "GrossTonnage, PortOfRegistry, InmarsatCallNumber, ShipType, ISMCompanyName, ISMCompanyId, ISMCompanyStreetAndNumber, " + @@ -112,5 +114,65 @@ namespace bsmd.database reader.Close(); return result; } + + public override void PrepareSave(IDbCommand cmd) + { + SqlCommand scmd = cmd as SqlCommand; + + scmd.Parameters.AddWithValue("@P1", this.MessageHeader.Id); + if (this.ShipName != null) scmd.Parameters.AddWithValue("@P2", this.ShipName); + else scmd.Parameters.AddWithValue("@P2", DBNull.Value); + if (this.CallSign != null) scmd.Parameters.AddWithValue("@P3", DBNull.Value); + else scmd.Parameters.AddWithValue("@P3", DBNull.Value); + if (this.MMSINumber != null) scmd.Parameters.AddWithValue("@P4", this.MMSINumber); + else scmd.Parameters.AddWithValue("@P4", DBNull.Value); + if (this.Flag != null) scmd.Parameters.AddWithValue("@P5", this.Flag); + else scmd.Parameters.AddWithValue("@P5", DBNull.Value); + if (this.LengthOverall_MTR.HasValue) scmd.Parameters.AddWithValue("@P6", this.LengthOverall_MTR.Value); + else scmd.Parameters.AddWithValue("@P6", DBNull.Value); + if (this.Beam_MTR.HasValue) scmd.Parameters.AddWithValue("@P7", this.Beam_MTR.Value); + else scmd.Parameters.AddWithValue("@P7", DBNull.Value); + if (this.GrossTonnage.HasValue) scmd.Parameters.AddWithValue("@P8", this.GrossTonnage.Value); + else scmd.Parameters.AddWithValue("@P8", DBNull.Value); + if (this.PortOfRegistry != null) scmd.Parameters.AddWithValue("@P9", this.PortOfRegistry); + else scmd.Parameters.AddWithValue("@P9", DBNull.Value); + if (this.InmarsatCallNumber != null) scmd.Parameters.AddWithValue("@P10", this.InmarsatCallNumber); + else scmd.Parameters.AddWithValue("@P10", DBNull.Value); + if (this.ShipType != null) scmd.Parameters.AddWithValue("@P11", this.ShipType); + else scmd.Parameters.AddWithValue("@P11", DBNull.Value); + if (this.ISMCompanyName != null) scmd.Parameters.AddWithValue("@P12", this.ISMCompanyName); + else scmd.Parameters.AddWithValue("@P12", DBNull.Value); + if (this.ISMCompanyId != null) scmd.Parameters.AddWithValue("@P13", this.ISMCompanyId); + else scmd.Parameters.AddWithValue("@P13", DBNull.Value); + if (this.ISMCompanyStreetAndNumber != null) scmd.Parameters.AddWithValue("@P14", this.ISMCompanyStreetAndNumber); + else scmd.Parameters.AddWithValue("@P14", DBNull.Value); + if (this.ISMCompanyPostalCode != null) scmd.Parameters.AddWithValue("@P15", this.ISMCompanyPostalCode); + else scmd.Parameters.AddWithValue("@P15", DBNull.Value); + if (this.ISMCompanyCity != null) scmd.Parameters.AddWithValue("@P16", this.ISMCompanyCity); + else scmd.Parameters.AddWithValue("@P16", DBNull.Value); + if (this.ISMCompanyCountry != null) scmd.Parameters.AddWithValue("@P17", this.ISMCompanyCountry); + else scmd.Parameters.AddWithValue("@P17", DBNull.Value); + + if (this.IsNew) + { + cmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, ShipName, CallSign, MMSINumber, " + + "Flag, LengthOverall_MTR, Beam_MTR, GrossTonnage, PortOfRegistry, InmarsatCallNumber, ShiptType, " + + "ISMCompanyName, ISMCompanyId, ISMCompanyStreetAndNumber, ISMCompanyPostalAddress, ISMCompanyCity, " + + "ISMCompanyCountry) VALUES (@P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, @P12, @P13, @P14, " + + "@P15, @P16, @P17)", this.Tablename); + } + else + { + cmd.CommandText = string.Format("UPDATE {0} SET ShipName = @P2, CallSign = @P3, MMSINumber = @P4, Flag = @P5, " + + "LengthOverall_MTR = @P6, Beam_MTR = @P7, GrossTonnage = @P8, PortOfRegistry = @P9, InmarsatCallNumber = @P10, " + + "ShipType = @P11, ISMCompanyName = @P12, ISMCompanyId = @P13, ISMCompanyStreetAndNumber = @P14, " + + "ISMCompanyPostalAddress = @P15, ISMCompanyCity = @P16, ISMCompanyCountry = @P17 WHERE Id = @ID", this.Tablename); + scmd.Parameters.AddWithValue("@ID", this.Id); + } + + } + + #endregion + } } diff --git a/nsw/Source/bsmd.database/Util.cs b/nsw/Source/bsmd.database/Util.cs new file mode 100644 index 00000000..55b327d5 --- /dev/null +++ b/nsw/Source/bsmd.database/Util.cs @@ -0,0 +1,30 @@ +// +// Class: Util +// Current CLR: 4.0.30319.34209 +// System: Microsoft Visual Studio 10.0 +// Author: dani +// Created: 3/21/2015 10:36:56 AM +// +// Copyright (c) 2015 Informatikbüro Daniel Schick. All rights reserved. + +using System; +using System.Data.SqlClient; +using System.Collections.Generic; + +namespace bsmd.database +{ + public static class Util + { + /// + /// Extension helper to add values that can be null: + /// http://stackoverflow.com/questions/13451085/exception-when-addwithvalue-parameter-is-null + /// + public static SqlParameter AddWithNullableValue(this SqlParameterCollection collection, string parameterName, object value) + { + if (value == null) + return collection.AddWithValue(parameterName, DBNull.Value); + else + return collection.AddWithValue(parameterName, value); + } + } +} diff --git a/nsw/Source/bsmd.database/bsmd.database.csproj b/nsw/Source/bsmd.database/bsmd.database.csproj index 20a2404b..7c545cf9 100644 --- a/nsw/Source/bsmd.database/bsmd.database.csproj +++ b/nsw/Source/bsmd.database/bsmd.database.csproj @@ -47,13 +47,21 @@ + + + + + + + + diff --git a/nsw/Source/bsmd.dbh.ResponseService.v12.suo b/nsw/Source/bsmd.dbh.ResponseService.v12.suo index 0180dbea..44ba1f92 100644 Binary files a/nsw/Source/bsmd.dbh.ResponseService.v12.suo and b/nsw/Source/bsmd.dbh.ResponseService.v12.suo differ diff --git a/nsw/Source/bsmd.dbh.ResponseService/IService1.cs b/nsw/Source/bsmd.dbh.ResponseService/IResponseService.cs similarity index 71% rename from nsw/Source/bsmd.dbh.ResponseService/IService1.cs rename to nsw/Source/bsmd.dbh.ResponseService/IResponseService.cs index 04848399..7a9f7f77 100644 --- a/nsw/Source/bsmd.dbh.ResponseService/IService1.cs +++ b/nsw/Source/bsmd.dbh.ResponseService/IResponseService.cs @@ -10,16 +10,18 @@ namespace bsmd.dbh.ResponseService { // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together. [ServiceContract] - public interface IService1 + public interface IResponseService { [OperationContract] string GetData(int value); + /// + /// Da die Schnittstelle nur mit einem .xsd definiert war ist die Signatur der Methode fraglich + /// Sicher ist Void, weniger sicher der Namen und der Name des Parameters. Dessen Type allerdings schon. + /// [OperationContract] - CompositeType GetDataUsingDataContract(CompositeType composite); - - // TODO: Add your service operations here + void NSWResponse(bsmd.dbh.response.Root root); } diff --git a/nsw/Source/bsmd.dbh.ResponseService/Service1.svc b/nsw/Source/bsmd.dbh.ResponseService/ResponseService.svc similarity index 50% rename from nsw/Source/bsmd.dbh.ResponseService/Service1.svc rename to nsw/Source/bsmd.dbh.ResponseService/ResponseService.svc index 56d80ca2..1d8674d0 100644 --- a/nsw/Source/bsmd.dbh.ResponseService/Service1.svc +++ b/nsw/Source/bsmd.dbh.ResponseService/ResponseService.svc @@ -1 +1 @@ -<%@ ServiceHost Language="C#" Debug="true" Service="bsmd.dbh.ResponseService.Service1" CodeBehind="Service1.svc.cs" %> \ No newline at end of file +<%@ ServiceHost Language="C#" Debug="true" Service="bsmd.dbh.ResponseService.ResponseService" CodeBehind="Service1.svc.cs" %> \ No newline at end of file diff --git a/nsw/Source/bsmd.dbh.ResponseService/Service1.svc.cs b/nsw/Source/bsmd.dbh.ResponseService/ResponseService.svc.cs similarity index 62% rename from nsw/Source/bsmd.dbh.ResponseService/Service1.svc.cs rename to nsw/Source/bsmd.dbh.ResponseService/ResponseService.svc.cs index 3042f57b..b5ca7f4a 100644 --- a/nsw/Source/bsmd.dbh.ResponseService/Service1.svc.cs +++ b/nsw/Source/bsmd.dbh.ResponseService/ResponseService.svc.cs @@ -5,29 +5,26 @@ using System.Runtime.Serialization; using System.ServiceModel; using System.ServiceModel.Web; using System.Text; +using log4net; namespace bsmd.dbh.ResponseService { // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together. // NOTE: In order to launch WCF Test Client for testing this service, please select Service1.svc or Service1.svc.cs at the Solution Explorer and start debugging. - public class Service1 : IService1 + public class ResponseService : IResponseService { + private ILog _log = LogManager.GetLogger("dbh ResponseService"); + public string GetData(int value) { return string.Format("You entered: {0}", value); } - public CompositeType GetDataUsingDataContract(CompositeType composite) + public void NSWResponse(bsmd.dbh.response.Root root) { - if (composite == null) - { - throw new ArgumentNullException("composite"); - } - if (composite.BoolValue) - { - composite.StringValue += "Suffix"; - } - return composite; + _log.Info("response received!"); + Response.ProcessResponse(root); } + } } diff --git a/nsw/Source/bsmd.dbh.ResponseService/bsmd.dbh.ResponseService.csproj b/nsw/Source/bsmd.dbh.ResponseService/bsmd.dbh.ResponseService.csproj index ff8e72c5..62150741 100644 --- a/nsw/Source/bsmd.dbh.ResponseService/bsmd.dbh.ResponseService.csproj +++ b/nsw/Source/bsmd.dbh.ResponseService/bsmd.dbh.ResponseService.csproj @@ -39,6 +39,9 @@ 4 + + ..\packages\log4net.2.0.3\lib\net40-full\log4net.dll + @@ -59,20 +62,21 @@ - + - - Service1.svc + + ResponseService.svc - + + Web.config @@ -81,6 +85,10 @@ + + {19945af2-379b-46a5-b27a-303b5ec1d557} + bsmd.database + {df625ff0-2265-4686-9cb6-2a8511cb3b9d} bsmd.dbh diff --git a/nsw/Source/bsmd.dbh.ResponseService/packages.config b/nsw/Source/bsmd.dbh.ResponseService/packages.config new file mode 100644 index 00000000..981a91a1 --- /dev/null +++ b/nsw/Source/bsmd.dbh.ResponseService/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/nsw/Source/bsmd.dbh/Request.cs b/nsw/Source/bsmd.dbh/Request.cs index 4b2a333f..1cb48750 100644 --- a/nsw/Source/bsmd.dbh/Request.cs +++ b/nsw/Source/bsmd.dbh/Request.cs @@ -84,6 +84,7 @@ namespace bsmd.dbh break; case Message.NotificationClass.STAT: + break; diff --git a/nsw/Source/bsmd.dbh/Response.cs b/nsw/Source/bsmd.dbh/Response.cs index ec51bd3a..bd0faa62 100644 --- a/nsw/Source/bsmd.dbh/Response.cs +++ b/nsw/Source/bsmd.dbh/Response.cs @@ -9,10 +9,36 @@ using System; using System.Collections.Generic; +using bsmd.database; namespace bsmd.dbh { public class Response { + + public static void ProcessResponse(response.Root response) + { + + switch(response.Type) + { + case dbh.response.RootType.VISIT: + + break; + case dbh.response.RootType.TRANSIT: + + break; + case dbh.response.RootType.CANCEL: + + break; + case dbh.response.RootType.RESET: + + break; + case dbh.response.RootType.DATA: + + break; + } + + } + } } diff --git a/nsw/Source/bsmd.herberg.FormService.sln b/nsw/Source/bsmd.herberg.FormService.sln new file mode 100644 index 00000000..2cc72784 --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bsmd.herberg.FormService", "bsmd.herberg.FormService\bsmd.herberg.FormService.csproj", "{FD0E59E4-58C9-4DAF-8024-D6F67E6ECC03}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bsmd.database", "bsmd.database\bsmd.database.csproj", "{19945AF2-379B-46A5-B27A-303B5EC1D557}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FD0E59E4-58C9-4DAF-8024-D6F67E6ECC03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FD0E59E4-58C9-4DAF-8024-D6F67E6ECC03}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FD0E59E4-58C9-4DAF-8024-D6F67E6ECC03}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FD0E59E4-58C9-4DAF-8024-D6F67E6ECC03}.Release|Any CPU.Build.0 = Release|Any CPU + {19945AF2-379B-46A5-B27A-303B5EC1D557}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19945AF2-379B-46A5-B27A-303B5EC1D557}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19945AF2-379B-46A5-B27A-303B5EC1D557}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19945AF2-379B-46A5-B27A-303B5EC1D557}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/nsw/Source/bsmd.herberg.FormService/App.config b/nsw/Source/bsmd.herberg.FormService/App.config new file mode 100644 index 00000000..9532b204 --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/App.config @@ -0,0 +1,51 @@ + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + replace me! + + + https://www.fleettracker.de/api/1.0/WSAPIFormData.php + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nsw/Source/bsmd.herberg.FormService/FormService.Designer.cs b/nsw/Source/bsmd.herberg.FormService/FormService.Designer.cs new file mode 100644 index 00000000..b7053bbd --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/FormService.Designer.cs @@ -0,0 +1,37 @@ +namespace bsmd.herberg.FormService +{ + partial class FormService + { + /// + /// 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/bsmd.herberg.FormService/FormService.cs b/nsw/Source/bsmd.herberg.FormService/FormService.cs new file mode 100644 index 00000000..4ad6e5bc --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/FormService.cs @@ -0,0 +1,140 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Diagnostics; +using System.Linq; +using System.IO; +using System.ServiceProcess; +using System.Text; +using System.Timers; +using System.Threading.Tasks; + +using log4net; +using bsmd.database; +using bsmd.herberg.FormService.ServiceReferenceHerberg; + +namespace bsmd.herberg.FormService +{ + public partial class FormService : ServiceBase + { + private Timer _timer; + private object _timerlock = new object(); + private bool processRunning = false; + private ILog _log = LogManager.GetLogger(typeof(FormService)); + + public FormService() + { + Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory); + InitializeComponent(); + } + + protected override void OnStart(string[] args) + { + this.EventLog.Source = this.ServiceName; + this.EventLog.Log = "Application"; + this.EventLog.BeginInit(); + if (!EventLog.SourceExists(this.EventLog.Source, this.EventLog.Log)) + EventLog.CreateEventSource(this.EventLog.Source, this.EventLog.Log); + this.EventLog.EndInit(); + + this.Init(args); + + this.EventLog.WriteEntry("NSW Send Service started.", EventLogEntryType.Information); + } + + public void Init(string[] args) + { + this._timer = new Timer(); + this._timer.Interval = 5000; // 5 sec + this._timer.Elapsed += _timer_Elapsed; + this._timer.Enabled = true; + + } + + protected override void OnStop() + { + } + + void _timer_Elapsed(object sender, ElapsedEventArgs e) + { + lock (this._timerlock) + { + if (this.processRunning) return; + else this.processRunning = true; + } + + if (DBManager.Instance.Connect(Properties.Settings.Default.ConnectionString)) + { + + try + { + WSAPIFormDataPortTypeClient client = new WSAPIFormDataPortTypeClient(); + client.Endpoint.Address = new System.ServiceModel.EndpointAddress(Properties.Settings.Default.ServerAddress); + // client.Endpoint.Name = "Fleettracker Forms"; // TODO + + // Verbindung zu Herberg's Service aufnehmen und Formulare abfragen + GetFormDataInfoListRequestData body = new GetFormDataInfoListRequestData(); + body.apiIdentifier = new APIIdentifier(); + body.apiIdentifier.companyGuid = Guid.NewGuid().ToString(); // TODO + body.apiIdentifier.clientGuid = Guid.NewGuid().ToString(); // TODO + + body.ffFolderTemplateTypeTag = "NSWAP"; + body.timeFrameRequestFilter = new TimeFrameRequestFilter(); + body.timeFrameRequestFilter.startDate = DateTime.Now; // TODO + body.timeFrameRequestFilter.startDateSpecified = true; + + // Liste der verfügbaren Formulare abholen + GetFormDataInfoListResponseData listReponse = client.GetFormDataInfoList(body); + + if (listReponse.success) + { + for (int i = 0; i < listReponse.formDataInfoDatasets.Length; i++) + { + FormDataInfoDataset dataSet = listReponse.formDataInfoDatasets[i]; + + // prüfen, ob ich das Formular schon habe? -> RS Jan + + // Formular abholen + GetFormDataRequestData formBody = new GetFormDataRequestData(); + formBody.apiIdentifier = new APIIdentifier(); + formBody.apiIdentifier.companyGuid = Guid.NewGuid().ToString(); // TODO + formBody.apiIdentifier.clientGuid = Guid.NewGuid().ToString(); // TODO + + formBody.formGuid = dataSet.formGuid; + + GetFormDataResponseData formResponse = client.GetFormData(formBody); + if (formResponse.success) + { + // abgefragtes Formular in die DB speichern + + } + else + { + _log.ErrorFormat("Request of form {0} failed", dataSet.formGuid); + } + } + } + else + { + _log.Error("Request of form list failed"); + } + } + catch (Exception ex) + { + _log.ErrorFormat("Exception occurred: {0}", ex.ToString()); + } + } + else + { + this.EventLog.WriteEntry("FormService stopped: DB connection failed", EventLogEntryType.Error); + this.Stop(); + } + + lock (this._timerlock) + { + this.processRunning = false; + } + } + } +} diff --git a/nsw/Source/bsmd.herberg.FormService/Program.cs b/nsw/Source/bsmd.herberg.FormService/Program.cs new file mode 100644 index 00000000..ae5f7e85 --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/Program.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.ServiceProcess; +using System.Text; +using System.Threading.Tasks; + +namespace bsmd.herberg.FormService +{ + static class Program + { + /// + /// The main entry point for the application. + /// + static void Main() + { + ServiceBase[] ServicesToRun; + + log4net.Config.XmlConfigurator.Configure(); + + ServicesToRun = new ServiceBase[] + { + new FormService() + }; + + if (Debugger.IsAttached) + { + ((FormService)ServicesToRun[0]).Init(null); + while (true) ; + } + else + { + ServiceBase.Run(ServicesToRun); + } + } + } +} diff --git a/nsw/Source/bsmd.herberg.FormService/Properties/AssemblyInfo.cs b/nsw/Source/bsmd.herberg.FormService/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..4ff0d72e --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/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("bsmd.herberg.FormService")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("bsmd.herberg.FormService")] +[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("663d14d2-42ce-4efd-9915-82254b211d81")] + +// 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/bsmd.herberg.FormService/Properties/Settings.Designer.cs b/nsw/Source/bsmd.herberg.FormService/Properties/Settings.Designer.cs new file mode 100644 index 00000000..d0a86941 --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/Properties/Settings.Designer.cs @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34209 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace bsmd.herberg.FormService.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("replace me!")] + public string ConnectionString { + get { + return ((string)(this["ConnectionString"])); + } + set { + this["ConnectionString"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("https://www.fleettracker.de/api/1.0/WSAPIFormData.php")] + public string ServerAddress { + get { + return ((string)(this["ServerAddress"])); + } + set { + this["ServerAddress"] = value; + } + } + } +} diff --git a/nsw/Source/bsmd.herberg.FormService/Properties/Settings.settings b/nsw/Source/bsmd.herberg.FormService/Properties/Settings.settings new file mode 100644 index 00000000..0982edc7 --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/Properties/Settings.settings @@ -0,0 +1,12 @@ + + + + + + replace me! + + + https://www.fleettracker.de/api/1.0/WSAPIFormData.php + + + \ No newline at end of file diff --git a/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/Reference.cs b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/Reference.cs new file mode 100644 index 00000000..24ccd2c5 --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/Reference.cs @@ -0,0 +1,880 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34209 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace bsmd.herberg.FormService.ServiceReferenceHerberg { + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ServiceModel.ServiceContractAttribute(Namespace="http://www.fleettracker.de/api/1.0", ConfigurationName="ServiceReferenceHerberg.WSAPIFormDataPortType")] + public interface WSAPIFormDataPortType { + + [System.ServiceModel.OperationContractAttribute(Action="http://www.fleettracker.de/GetFormDataInfoList", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataInfoListResponse GetFormDataInfoList(bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataInfoListRequest request); + + // CODEGEN: Generating message contract since the operation has multiple return values. + [System.ServiceModel.OperationContractAttribute(Action="http://www.fleettracker.de/GetFormDataInfoList", ReplyAction="*")] + System.Threading.Tasks.Task GetFormDataInfoListAsync(bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataInfoListRequest request); + + [System.ServiceModel.OperationContractAttribute(Action="http://www.fleettracker.de/GetFormData", ReplyAction="*")] + [System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] + bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataResponse GetFormData(bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataRequest request); + + // CODEGEN: Generating message contract since the operation has multiple return values. + [System.ServiceModel.OperationContractAttribute(Action="http://www.fleettracker.de/GetFormData", ReplyAction="*")] + System.Threading.Tasks.Task GetFormDataAsync(bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataRequest request); + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34234")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.fleettracker.de/api/1.0")] + public partial class GetFormDataInfoListRequestData : object, System.ComponentModel.INotifyPropertyChanged { + + private APIIdentifier apiIdentifierField; + + private TimeFrameRequestFilter timeFrameRequestFilterField; + + private string ffTemplateNameField; + + private string ffFolderTemplateTypeTagField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public APIIdentifier apiIdentifier { + get { + return this.apiIdentifierField; + } + set { + this.apiIdentifierField = value; + this.RaisePropertyChanged("apiIdentifier"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public TimeFrameRequestFilter timeFrameRequestFilter { + get { + return this.timeFrameRequestFilterField; + } + set { + this.timeFrameRequestFilterField = value; + this.RaisePropertyChanged("timeFrameRequestFilter"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string ffTemplateName { + get { + return this.ffTemplateNameField; + } + set { + this.ffTemplateNameField = value; + this.RaisePropertyChanged("ffTemplateName"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string ffFolderTemplateTypeTag { + get { + return this.ffFolderTemplateTypeTagField; + } + set { + this.ffFolderTemplateTypeTagField = value; + this.RaisePropertyChanged("ffFolderTemplateTypeTag"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34234")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.fleettracker.de/api/1.0")] + public partial class APIIdentifier : object, System.ComponentModel.INotifyPropertyChanged { + + private string companyGuidField; + + private string clientGuidField; + + private string clientNameField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=0)] + public string companyGuid { + get { + return this.companyGuidField; + } + set { + this.companyGuidField = value; + this.RaisePropertyChanged("companyGuid"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=1)] + public string clientGuid { + get { + return this.clientGuidField; + } + set { + this.clientGuidField = value; + this.RaisePropertyChanged("clientGuid"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Order=2)] + public string clientName { + get { + return this.clientNameField; + } + set { + this.clientNameField = value; + this.RaisePropertyChanged("clientName"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34234")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.fleettracker.de/api/1.0")] + public partial class FormData : object, System.ComponentModel.INotifyPropertyChanged { + + private string valueField; + + private string unitField; + + private string nameField; + + private int widget_idField; + + private int rowNoField; + + private bool rowNoFieldSpecified; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string value { + get { + return this.valueField; + } + set { + this.valueField = value; + this.RaisePropertyChanged("value"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string unit { + get { + return this.unitField; + } + set { + this.unitField = value; + this.RaisePropertyChanged("unit"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string name { + get { + return this.nameField; + } + set { + this.nameField = value; + this.RaisePropertyChanged("name"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public int widget_id { + get { + return this.widget_idField; + } + set { + this.widget_idField = value; + this.RaisePropertyChanged("widget_id"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public int rowNo { + get { + return this.rowNoField; + } + set { + this.rowNoField = value; + this.RaisePropertyChanged("rowNo"); + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool rowNoSpecified { + get { + return this.rowNoFieldSpecified; + } + set { + this.rowNoFieldSpecified = value; + this.RaisePropertyChanged("rowNoSpecified"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34234")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.fleettracker.de/api/1.0")] + public partial class FormDataset : object, System.ComponentModel.INotifyPropertyChanged { + + private System.DateTime revisionDateField; + + private System.DateTime startPeriodField; + + private bool startPeriodFieldSpecified; + + private System.DateTime endPeriodField; + + private bool endPeriodFieldSpecified; + + private FormData[] formDataField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public System.DateTime revisionDate { + get { + return this.revisionDateField; + } + set { + this.revisionDateField = value; + this.RaisePropertyChanged("revisionDate"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public System.DateTime startPeriod { + get { + return this.startPeriodField; + } + set { + this.startPeriodField = value; + this.RaisePropertyChanged("startPeriod"); + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool startPeriodSpecified { + get { + return this.startPeriodFieldSpecified; + } + set { + this.startPeriodFieldSpecified = value; + this.RaisePropertyChanged("startPeriodSpecified"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public System.DateTime endPeriod { + get { + return this.endPeriodField; + } + set { + this.endPeriodField = value; + this.RaisePropertyChanged("endPeriod"); + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool endPeriodSpecified { + get { + return this.endPeriodFieldSpecified; + } + set { + this.endPeriodFieldSpecified = value; + this.RaisePropertyChanged("endPeriodSpecified"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("formData", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public FormData[] formData { + get { + return this.formDataField; + } + set { + this.formDataField = value; + this.RaisePropertyChanged("formData"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34234")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.fleettracker.de/api/1.0")] + public partial class GetFormDataResponseData : object, System.ComponentModel.INotifyPropertyChanged { + + private GetFormDataRequestData requestField; + + private int imoNumberField; + + private FormDataset[] formDatasetsField; + + private string resultField; + + private bool successField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public GetFormDataRequestData request { + get { + return this.requestField; + } + set { + this.requestField = value; + this.RaisePropertyChanged("request"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public int imoNumber { + get { + return this.imoNumberField; + } + set { + this.imoNumberField = value; + this.RaisePropertyChanged("imoNumber"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("formDatasets", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public FormDataset[] formDatasets { + get { + return this.formDatasetsField; + } + set { + this.formDatasetsField = value; + this.RaisePropertyChanged("formDatasets"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string result { + get { + return this.resultField; + } + set { + this.resultField = value; + this.RaisePropertyChanged("result"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public bool success { + get { + return this.successField; + } + set { + this.successField = value; + this.RaisePropertyChanged("success"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34234")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.fleettracker.de/api/1.0")] + public partial class GetFormDataRequestData : object, System.ComponentModel.INotifyPropertyChanged { + + private APIIdentifier apiIdentifierField; + + private string formGuidField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public APIIdentifier apiIdentifier { + get { + return this.apiIdentifierField; + } + set { + this.apiIdentifierField = value; + this.RaisePropertyChanged("apiIdentifier"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string formGuid { + get { + return this.formGuidField; + } + set { + this.formGuidField = value; + this.RaisePropertyChanged("formGuid"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34234")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.fleettracker.de/api/1.0")] + public partial class FormDataInfoDataset : object, System.ComponentModel.INotifyPropertyChanged { + + private string folderTemplateGuidField; + + private string formTemplateGuidField; + + private string folderGuidField; + + private string formGuidField; + + private int imoNumberField; + + private System.DateTime lastRevisionDateField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public string folderTemplateGuid { + get { + return this.folderTemplateGuidField; + } + set { + this.folderTemplateGuidField = value; + this.RaisePropertyChanged("folderTemplateGuid"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public string formTemplateGuid { + get { + return this.formTemplateGuidField; + } + set { + this.formTemplateGuidField = value; + this.RaisePropertyChanged("formTemplateGuid"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string folderGuid { + get { + return this.folderGuidField; + } + set { + this.folderGuidField = value; + this.RaisePropertyChanged("folderGuid"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public string formGuid { + get { + return this.formGuidField; + } + set { + this.formGuidField = value; + this.RaisePropertyChanged("formGuid"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=4)] + public int imoNumber { + get { + return this.imoNumberField; + } + set { + this.imoNumberField = value; + this.RaisePropertyChanged("imoNumber"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=5)] + public System.DateTime lastRevisionDate { + get { + return this.lastRevisionDateField; + } + set { + this.lastRevisionDateField = value; + this.RaisePropertyChanged("lastRevisionDate"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34234")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.fleettracker.de/api/1.0")] + public partial class GetFormDataInfoListResponseData : object, System.ComponentModel.INotifyPropertyChanged { + + private GetFormDataInfoListRequestData requestField; + + private FormDataInfoDataset[] formDataInfoDatasetsField; + + private string resultField; + + private bool successField; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public GetFormDataInfoListRequestData request { + get { + return this.requestField; + } + set { + this.requestField = value; + this.RaisePropertyChanged("request"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("formDataInfoDatasets", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public FormDataInfoDataset[] formDataInfoDatasets { + get { + return this.formDataInfoDatasetsField; + } + set { + this.formDataInfoDatasetsField = value; + this.RaisePropertyChanged("formDataInfoDatasets"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=2)] + public string result { + get { + return this.resultField; + } + set { + this.resultField = value; + this.RaisePropertyChanged("result"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=3)] + public bool success { + get { + return this.successField; + } + set { + this.successField = value; + this.RaisePropertyChanged("success"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34234")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.fleettracker.de/api/1.0")] + public partial class TimeFrameRequestFilter : object, System.ComponentModel.INotifyPropertyChanged { + + private System.DateTime startDateField; + + private bool startDateFieldSpecified; + + private System.DateTime endDateField; + + private bool endDateFieldSpecified; + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=0)] + public System.DateTime startDate { + get { + return this.startDateField; + } + set { + this.startDateField = value; + this.RaisePropertyChanged("startDate"); + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool startDateSpecified { + get { + return this.startDateFieldSpecified; + } + set { + this.startDateFieldSpecified = value; + this.RaisePropertyChanged("startDateSpecified"); + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, Order=1)] + public System.DateTime endDate { + get { + return this.endDateField; + } + set { + this.endDateField = value; + this.RaisePropertyChanged("endDate"); + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool endDateSpecified { + get { + return this.endDateFieldSpecified; + } + set { + this.endDateFieldSpecified = value; + this.RaisePropertyChanged("endDateSpecified"); + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ServiceModel.MessageContractAttribute(WrapperName="GetFormDataInfoList", WrapperNamespace="http://www.fleettracker.de/api/1.0", IsWrapped=true)] + public partial class GetFormDataInfoListRequest { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="", Order=0)] + public bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataInfoListRequestData body; + + public GetFormDataInfoListRequest() { + } + + public GetFormDataInfoListRequest(bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataInfoListRequestData body) { + this.body = body; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ServiceModel.MessageContractAttribute(WrapperName="GetFormDataInfoListResponse", WrapperNamespace="http://www.fleettracker.de/api/1.0", IsWrapped=true)] + public partial class GetFormDataInfoListResponse { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="", Order=0)] + public bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataInfoListResponseData body; + + public GetFormDataInfoListResponse() { + } + + public GetFormDataInfoListResponse(bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataInfoListResponseData body) { + this.body = body; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ServiceModel.MessageContractAttribute(WrapperName="GetFormData", WrapperNamespace="http://www.fleettracker.de/api/1.0", IsWrapped=true)] + public partial class GetFormDataRequest { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="", Order=0)] + public bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataRequestData body; + + public GetFormDataRequest() { + } + + public GetFormDataRequest(bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataRequestData body) { + this.body = body; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ServiceModel.MessageContractAttribute(WrapperName="GetFormDataResponse", WrapperNamespace="http://www.fleettracker.de/api/1.0", IsWrapped=true)] + public partial class GetFormDataResponse { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="", Order=0)] + public bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataResponseData body; + + public GetFormDataResponse() { + } + + public GetFormDataResponse(bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataResponseData body) { + this.body = body; + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public interface WSAPIFormDataPortTypeChannel : bsmd.herberg.FormService.ServiceReferenceHerberg.WSAPIFormDataPortType, System.ServiceModel.IClientChannel { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public partial class WSAPIFormDataPortTypeClient : System.ServiceModel.ClientBase, bsmd.herberg.FormService.ServiceReferenceHerberg.WSAPIFormDataPortType { + + public WSAPIFormDataPortTypeClient() { + } + + public WSAPIFormDataPortTypeClient(string endpointConfigurationName) : + base(endpointConfigurationName) { + } + + public WSAPIFormDataPortTypeClient(string endpointConfigurationName, string remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public WSAPIFormDataPortTypeClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public WSAPIFormDataPortTypeClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) { + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataInfoListResponse bsmd.herberg.FormService.ServiceReferenceHerberg.WSAPIFormDataPortType.GetFormDataInfoList(bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataInfoListRequest request) { + return base.Channel.GetFormDataInfoList(request); + } + + public bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataInfoListResponseData GetFormDataInfoList(bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataInfoListRequestData body) { + bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataInfoListRequest inValue = new bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataInfoListRequest(); + inValue.body = body; + bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataInfoListResponse retVal = ((bsmd.herberg.FormService.ServiceReferenceHerberg.WSAPIFormDataPortType)(this)).GetFormDataInfoList(inValue); + return retVal.body; + } + + public System.Threading.Tasks.Task GetFormDataInfoListAsync(bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataInfoListRequest request) { + return base.Channel.GetFormDataInfoListAsync(request); + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataResponse bsmd.herberg.FormService.ServiceReferenceHerberg.WSAPIFormDataPortType.GetFormData(bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataRequest request) { + return base.Channel.GetFormData(request); + } + + public bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataResponseData GetFormData(bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataRequestData body) { + bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataRequest inValue = new bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataRequest(); + inValue.body = body; + bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataResponse retVal = ((bsmd.herberg.FormService.ServiceReferenceHerberg.WSAPIFormDataPortType)(this)).GetFormData(inValue); + return retVal.body; + } + + public System.Threading.Tasks.Task GetFormDataAsync(bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataRequest request) { + return base.Channel.GetFormDataAsync(request); + } + } +} diff --git a/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/Reference.svcmap b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/Reference.svcmap new file mode 100644 index 00000000..3155ea34 --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/Reference.svcmap @@ -0,0 +1,40 @@ + + + + false + true + true + + false + false + false + + + true + Auto + true + true + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/WSAPIFormData.wsdl b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/WSAPIFormData.wsdl new file mode 100644 index 00000000..f2e270ad --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/WSAPIFormData.wsdl @@ -0,0 +1,289 @@ + + + + + + + + + + + + + + + + + + + + + + + + The GUID of the folder template + + + + + + The GUID of the form template + + + + + + The GUID of the folder + + + + + The GUID of the form + + + + + The IMO number this form belongs to. + + + + + + The date of the latest revision. + + + + + + + + + + The value + + + + + + The optional unit + + + + + + The widget name this cell belongs to. + + + + + + The widget id the value belongs to. Note + that this entry is the id within the form template but NOT the database id of the widget! + + + + + + The optional row number. This is set if we + have a widget that is part of a table. + + + + + + + + + + The date of the revision. + + + + + + The begin of the period this dataset is valid + for. + + + + + + The end of the period this row is valid for. + If startPeriod is not given, the endPeriod contains the sample + timestamp. + + + + + + The values. + + + + + + + + + + + The reporting or requesting party. + + + + + + The optional time frame. If not set then all entries are returned. + + + + + + This is the Fleetform form template name (see + FolderTemplate.Template.TemplateName). + You have to either set + this or ffFolderTemplateTypeTag. + + + + + + This is the Fleetform folder template typeTag, + e.g. CREWLIST, PERFORMANCEREPORT, SHIPDETAILS, etc. See + FolderTemplate in fleetform.xsd + for possible values. + + + + + + + + + + The request + + + + + A set of form data found in the database. + + + + + + + This flag is set to true if the route was + successfully stored. + Otherwise, result contains the error + message. + + + + + + + + + + + The reporting or requesting party. + + + + + + The GUID of the form. + + + + + + + + + + The request belonging to this response. + + + + + + The IMO number of the vessel this form belongs + to. + + + + + + + The requested data. If not found then this + entry is null. Note that we may have several entries for one + form here since one form may contain several entries. + + + + + + + + This flag is set to true if the route was + successfully stored. + Otherwise, result contains the error + message. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/auth.xsd b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/auth.xsd new file mode 100644 index 00000000..cc5d2155 --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/auth.xsd @@ -0,0 +1,35 @@ + + + + + This is the identifier the client has to report. + + + + + + The unique id of the company. This is a unique + GUID identifying the + company using the API. Only if the company is registered, they may use + the API. + + + + + + The unique id of the client. This is a unique + GUID identifying the + individual sender. E.g. each boat may have a unique id. + + + + + + The optional name of the sending client. This is only for helping us identifying the sending + party. + + + + + + \ No newline at end of file diff --git a/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataInfoListResponse.datasource b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataInfoListResponse.datasource new file mode 100644 index 00000000..ea1d54cc --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataInfoListResponse.datasource @@ -0,0 +1,10 @@ + + + + bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataInfoListResponse, Service References.ServiceReferenceHerberg.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataInfoListResponseData.datasource b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataInfoListResponseData.datasource new file mode 100644 index 00000000..c72ef981 --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataInfoListResponseData.datasource @@ -0,0 +1,10 @@ + + + + bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataInfoListResponseData, Service References.ServiceReferenceHerberg.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataResponse.datasource b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataResponse.datasource new file mode 100644 index 00000000..24025642 --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataResponse.datasource @@ -0,0 +1,10 @@ + + + + bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataResponse, Service References.ServiceReferenceHerberg.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataResponseData.datasource b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataResponseData.datasource new file mode 100644 index 00000000..780d914f --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataResponseData.datasource @@ -0,0 +1,10 @@ + + + + bsmd.herberg.FormService.ServiceReferenceHerberg.GetFormDataResponseData, Service References.ServiceReferenceHerberg.Reference.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/configuration.svcinfo b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/configuration.svcinfo new file mode 100644 index 00000000..e47f3248 --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/configuration.svcinfo @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/configuration91.svcinfo b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/configuration91.svcinfo new file mode 100644 index 00000000..494237db --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/configuration91.svcinfo @@ -0,0 +1,201 @@ + + + + + + + WSAPIFormDataBinding + + + + + + + + + + + + + + + + + + + + + StrongWildcard + + + + + + 65536 + + + + + + + + + System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + System.Text.UTF8Encoding + + + Buffered + + + + + + Text + + + System.ServiceModel.Configuration.BasicHttpSecurityElement + + + None + + + System.ServiceModel.Configuration.HttpTransportSecurityElement + + + None + + + None + + + System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement + + + Never + + + TransportSelected + + + (Collection) + + + + + + System.ServiceModel.Configuration.BasicHttpMessageSecurityElement + + + UserName + + + Default + + + + + + + + + http://www.fleettracker.de/api/1.0/WSAPIFormData.php + + + + + + basicHttpBinding + + + WSAPIFormDataBinding + + + ServiceReferenceHerberg.WSAPIFormDataPortType + + + System.ServiceModel.Configuration.AddressHeaderCollectionElement + + + <Header /> + + + System.ServiceModel.Configuration.IdentityElement + + + System.ServiceModel.Configuration.UserPrincipalNameElement + + + + + + System.ServiceModel.Configuration.ServicePrincipalNameElement + + + + + + System.ServiceModel.Configuration.DnsElement + + + + + + System.ServiceModel.Configuration.RsaElement + + + + + + System.ServiceModel.Configuration.CertificateElement + + + + + + System.ServiceModel.Configuration.CertificateReferenceElement + + + My + + + LocalMachine + + + FindBySubjectDistinguishedName + + + + + + False + + + WSAPIFormDataPort + + + + + + + + + + + \ No newline at end of file diff --git a/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/device.xsd b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/device.xsd new file mode 100644 index 00000000..ba1ea8ee --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/device.xsd @@ -0,0 +1,77 @@ + + + + + This is the device ID. + + + + + The bearer key reference. We have several ways + to identify the device. + E.g. for inmarsatc, we use fleetID and vesselID (and mobile number, if + available). + For D+, we use the vesselID. Daily Report uses the IMO number. + + + + + + + + + + + + The callsign. For instance, Globewireless uses this. + + + + + + The Globalstar device id. Example: 0-545312 + + + + + + + The vesselID contains a unique GUID identifying the device. We use this e.g. for the API. + + + + + + IMEI - International Mobile Equipment Identity (e.g. BGAN) + + + + + + + + + The inmarsat C mobile number. + + + + + This is the DNID for INMARSATC. + + + + + + This is the terminal, member number, GUID, MMSI, etc. + + + + + + This is the IMO number. + + + + + + \ No newline at end of file diff --git a/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/geoarea.xsd b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/geoarea.xsd new file mode 100644 index 00000000..10751204 --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/geoarea.xsd @@ -0,0 +1,167 @@ + + + + + + This is a geographical area. It can be a polygon + or a bounding box. + + + + + + Geographical coverages of this area + + + + + + DB Area ID + + + + + + DB Area list ID + + + + + + DB Area name + + + + + + + + This is a geographical coverage belonging to an area. + + + + + + Geographical positions + + + + + + The type of this coverage. Bounding boxes are + between the first 2 positions. + + + + + + + + + + + + DB Area coverage ID + + + + + + DB Area Coverage name + + + + + + + + This is an event related to an area. + + + + + + Geographical position when the event happened. + + + + + + DB Area coverage ID + + + + + + DB Area ID + + + + + + DB Area list ID + + + + + + DB Area name + + + + + + DB Area Coverage name + + + + + + This flag indicates that the event has been generated but + not yet been proven. Example: It is proven if the vessel is within the areas more than 1 minute. + + + + + + This flag indicates that the event has been reported ashore. + + + + + + The type of this event. + + + + + + + The vessel has entered the area + + + + + + The vessel has left the area + + + + + + The vessel has stopped in the area + + + + + + The vessel has started moving within the area + + + + + + + + + \ No newline at end of file diff --git a/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/inlandPosition.xsd b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/inlandPosition.xsd new file mode 100644 index 00000000..697caf27 --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/inlandPosition.xsd @@ -0,0 +1,183 @@ + + + + + + This is the distance on a river. + + + + + This is the current value in the given unit. + + + + + + + + + + + + + + + + + + This is the speed of a target. + + + + + This is the current value in the given unit. + + + + + + + + + + + + + + + + + + This represents a river. + + + + + This is the river name. + + + + + + This is the river abbreviation. + + + + + + + + This represents a miles marker entry. + + + + + + This is the river mile or kilometer. + + + + + + This is the unit of the miles. + + + + + + + + + + + + This is the river. + + + + + + + + This represents a miles marker entry with a + geographic position. + + + + + + + + The geographic position of this miles marker + + + + + + + + + + This represents a set of miles marker entry with a + geographic position. + + + + + + A set of miles marker entries with positions. + + + + + + + + This represents a no passing zone. + + + + + + The mandatory unique id + + + + + + The optional name for identification. + + + + + + The begin of the no passing zone. This is always + the lower mile marker. + + + + + + The end of the no passing zone. This is always + the higher mile marker. + + + + + + + + This represents a set of no passing zones + + + + + + A set of NoPassingZone objects. + + + + + + \ No newline at end of file diff --git a/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/position.xsd b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/position.xsd new file mode 100644 index 00000000..72f72cae --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/position.xsd @@ -0,0 +1,102 @@ + + + + + This is a geographical position. + + + + + + Latitude in degrees x 60000, North > 0 + + + + + + Latitude in degrees x 60000, East > 0 + + + + + + + + This is a geographical position with a timestamp. + + + + + + + + Timestamp when the position was made + + + + + + + + + + This is a geographical position of a pasttrack. + + + + + + + + The order number of the pastttack. The + higher + the number, the older the position. + + + + + Rate of turn in deg/s, right > 0, left < + 0) + + + + + Speed over ground in knots + + + + + + Course over ground in degrees + + + + + + Heading in degrees + + + + + + ETA to next port + + + + + + ETB to next port + + + + + + Next port + + + + + + + + \ No newline at end of file diff --git a/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/route.xsd b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/route.xsd new file mode 100644 index 00000000..b5f33747 --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/route.xsd @@ -0,0 +1,88 @@ + + + + + This represents a waypoint of a planned route. + + + + + This is a unique id of the waypoint within the route. + + + + + + This is an optional name of this waypoint. + + + + + + This is the unique id of the NEXT + waypoint within the route. This element is not set + for the last waypoint. + + + + + This is the latitude of this waypoint in minutes x 1000 (= degrees x 60000). + Positive = North, Negative = South. + Example: 12 deg 23.4 min North = (12 * 60 + 23.4) * 1000 = 743400 + + + + + + This is the longitude of this waypoint in minutes x 1000 (= degrees x 60000). + Positive = East, Negative = West. + Example: 122 deg 23.4 min West = -(122 * 60 + 23.4) * 1000 = -7343400 + + + + + + This is the planned speed over ground (SOG) in knots TO this waypoint. + So the ship will calculate to go from the previous waypoint to this + waypoint at this speed. + + + + + + + + This represents the planned ship route. + + + + + This is a unique id of the route. The ID has to be unique + for the vessel. + + + + + + This is the IMO number of the vessel this route belongs to. + + + + + This is the timestamp in UTC when the route has been created. + + + + + This is the ETA in local time when the ship is calculated to + reach the final waypoint of this route. + + + + + This is the list of waypoints. + + + + + \ No newline at end of file diff --git a/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/ship.xsd b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/ship.xsd new file mode 100644 index 00000000..7c018b3f --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/ship.xsd @@ -0,0 +1,117 @@ + + + + + + + + This is how the ship is displayed. + + + + + This is the color for not selected ship. + + + + + + This is the color for selected ship. + + + + + + + + This is the ship category. + + + + + This is the ship category number. + + + + + + The name of the category. + + + + + + + + This is the abstract ship. + + + + + Database id + + + + + Ship name + + + + + Charter ship name + + + + + The past positions of the ship including the latest position. + + + + + + Optional ULR to photo image. + + + + + + This is the ship category. This attribute is used to group a fleet + into several parts. + + + + + + This contains optional individual settings for the ship appearence. + + + + + + + + This is a Fleettracker Ship. + + + + + + + The IMO number of the ship. + + + + + The optional set of devices. + + + + + The optional route. + + + + + + + \ No newline at end of file diff --git a/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/shipParams.xsd b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/shipParams.xsd new file mode 100644 index 00000000..ea1de506 --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/shipParams.xsd @@ -0,0 +1,80 @@ + + + + + The own ship parameter used for speed calculation. + + + + + + + This is the MMSI of the own ship. + + + + + + + Minimal own speed we can achieve. + Unit: Meter per + second + + + + + + + Minimal own speed we can achieve. + Unit: Meter per + second + + + + + + + Optimal speed we would like to go. + Unit: Meter + per second + + + + + + + The maximal positive accelaration we can + achieve. + Unit: Meter per second^2 + + + + + + + The minimal negative accelaration we can + achieve. + Unit: Meter per second^2 + + + + + + + The optimal accelaration we would like to use if + we + want to go from current speed to optimal speed. This will be + applied + if we do not have any targets. + Example: We run 5 mph, our + optimal speed is 8 mph, then we use this + acceleration + to go from 5 + to 8. + Unit: Meter per second^2 + + + + + + \ No newline at end of file diff --git a/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/target.xsd b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/target.xsd new file mode 100644 index 00000000..65030d67 --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/Service References/ServiceReferenceHerberg/target.xsd @@ -0,0 +1,44 @@ + + + + + + This represents a river. + + + + + This is the current miles marker + + + + + + + + + + + + + + + This is the current miles marker + + + + + + This is the name of the target + + + + + + This is the current speed + + + + + + \ No newline at end of file diff --git a/nsw/Source/bsmd.herberg.FormService/bsmd.herberg.FormService.csproj b/nsw/Source/bsmd.herberg.FormService/bsmd.herberg.FormService.csproj new file mode 100644 index 00000000..d6004c91 --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/bsmd.herberg.FormService.csproj @@ -0,0 +1,149 @@ + + + + + Debug + AnyCPU + {FD0E59E4-58C9-4DAF-8024-D6F67E6ECC03} + WinExe + Properties + bsmd.herberg.FormService + bsmd.herberg.FormService + v4.5 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\log4net.2.0.3\lib\net40-full\log4net.dll + + + + + + + + + + + + + + + Component + + + FormService.cs + + + + + True + True + Settings.settings + + + True + True + Reference.svcmap + + + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + Designer + + + Reference.svcmap + + + Reference.svcmap + + + Reference.svcmap + + + Reference.svcmap + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + + + + {19945af2-379b-46a5-b27a-303b5ec1d557} + bsmd.database + + + + + + + + + + + + + + + + + WCF Proxy Generator + Reference.cs + + + + + \ No newline at end of file diff --git a/nsw/Source/bsmd.herberg.FormService/packages.config b/nsw/Source/bsmd.herberg.FormService/packages.config new file mode 100644 index 00000000..981a91a1 --- /dev/null +++ b/nsw/Source/bsmd.herberg.FormService/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/nsw/Source/packages/repositories.config b/nsw/Source/packages/repositories.config index f16003ee..d51a64ba 100644 --- a/nsw/Source/packages/repositories.config +++ b/nsw/Source/packages/repositories.config @@ -2,6 +2,8 @@ + + \ No newline at end of file diff --git a/nsw/dbh/answ-osis-extern.wsdl b/nsw/dbh/answ-osis-extern.wsdl new file mode 100644 index 00000000..c40ba53c --- /dev/null +++ b/nsw/dbh/answ-osis-extern.wsdl @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + Submit a new NSW Request (only one NSWRequest per Submit!) to DBH ANSW OSIS, giving the senderID, messageID, messageType, the message. The method returns the OsisOrderNr (Unique message identifier generated by OSIS). + + + + + + + + + + + + + + + + + + Dbh_Osis_Answ_Ws is used to send Message to the DBH ANSW OSIS Application. Message format is XML. + + + + +