MessageHistory Speichern fertig implementiert für Version 5.1.7
This commit is contained in:
parent
33edf3fd9b
commit
af0852f60d
@ -31,7 +31,7 @@
|
||||
</setting>
|
||||
<setting name="ConnectionString" serializeAs="String">
|
||||
<!--value>Data Source=192.168.2.12;Initial Catalog=nsw;Uid=dfuser;Pwd=dfpasswd;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False</value-->
|
||||
<value>Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=nsw;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False</value>
|
||||
<value>Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=E:\DATA\DB\NSW.MDF;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False</value>
|
||||
</setting>
|
||||
</ENI2.Properties.Settings>
|
||||
</applicationSettings>
|
||||
|
||||
@ -510,6 +510,7 @@ namespace ENI2
|
||||
this.busyIndicator.IsBusy = false;
|
||||
this.labelStatusBar.Text = string.Format("Rep.Party: {0} {1} [{2}]", this.userEntity.FirstName, this.userEntity.LastName, this.userEntity.Logon);
|
||||
App.UserId = this.userEntity.Id;
|
||||
ReportingParty.CurrentReportingParty = this.userEntity;
|
||||
if (this.userEntity.IsAdmin)
|
||||
{
|
||||
this.buttonUserAdmin.Visibility = Visibility.Visible;
|
||||
|
||||
Binary file not shown.
@ -11,6 +11,7 @@ using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
@ -24,6 +25,7 @@ namespace bsmd.database
|
||||
|
||||
#region Properties
|
||||
|
||||
[JsonIgnore]
|
||||
public NOA_NOD NOA_NOD { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
@ -38,6 +40,7 @@ namespace bsmd.database
|
||||
|
||||
public string Identifier { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string SublistCollectionKey { get { return "callpurpose"; } }
|
||||
|
||||
#endregion
|
||||
|
||||
@ -12,7 +12,9 @@ using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Diagnostics;
|
||||
using Newtonsoft.Json;
|
||||
using log4net;
|
||||
using System.Reflection;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
@ -29,6 +31,7 @@ namespace bsmd.database
|
||||
private readonly object _lock = new object();
|
||||
private bool _closeConnectionAfterUse = false;
|
||||
private readonly List<string> truncatedFieldCollection = new List<string>();
|
||||
private Dictionary<Type, string> messageHistoryTypeDict;
|
||||
|
||||
#endregion
|
||||
|
||||
@ -44,6 +47,15 @@ namespace bsmd.database
|
||||
|
||||
#endregion
|
||||
|
||||
#region Construction
|
||||
|
||||
public DBManager()
|
||||
{
|
||||
this.InitializeMessageHistoryTypes();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
public static DBManager Instance
|
||||
@ -329,8 +341,7 @@ namespace bsmd.database
|
||||
{
|
||||
result = (Message) messages[0]; // es kann nur eine sein
|
||||
result.MessageCore = core;
|
||||
List<Message> lm = new List<Message>();
|
||||
lm.Add(result);
|
||||
List<Message> lm = new List<Message> { result };
|
||||
this.LoadMessageDependencies(lm);
|
||||
}
|
||||
|
||||
@ -711,18 +722,80 @@ namespace bsmd.database
|
||||
}
|
||||
}
|
||||
|
||||
#region MessageHistory
|
||||
|
||||
/// <summary>
|
||||
/// Diskussion: Es wäre besser, wenn man hier nur Message serialisieren würde. Allerdings wird der "Inhalt" bei
|
||||
/// einer Neuanlage erst nach der Message gespeichert und wäre dann hier nicht vorhanden. Es muss daher ein Switch über alle Element
|
||||
/// Typen durchgeführt werden.
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
private void CreateEntityHistoryEntry(DatabaseEntity entity)
|
||||
{
|
||||
// switch(entity.)
|
||||
// sehr schöner Ansatz, den ich doch nicht verwendet habe;
|
||||
//var @switch = new Dictionary<Type, Action> {
|
||||
// { typeof(Type1), () => ... },
|
||||
// { typeof(Type2), () => ... },
|
||||
// { typeof(Type3), () => ... },
|
||||
//};
|
||||
|
||||
//@switch[typeof(MyType)]();
|
||||
|
||||
Type entityType = entity.GetType();
|
||||
// 1. prüfen ob für das Objekt ein Historieneintrag angelegt werden soll
|
||||
if (this.messageHistoryTypeDict.ContainsKey(entityType)) {
|
||||
|
||||
// 2. falls ja Objekt serialisieren
|
||||
MessageHistory mh = new MessageHistory();
|
||||
mh.EntityId = entity.MessageHeader.Id.Value;
|
||||
mh.EntityName = entityType.Name;
|
||||
mh.EntityType = entityType.ToString();
|
||||
mh.EntityValues = JsonConvert.SerializeObject(entity);
|
||||
if (ReportingParty.CurrentReportingParty != null)
|
||||
mh.ReportingPartyId = ReportingParty.CurrentReportingParty.Id.Value;
|
||||
|
||||
// 3. MessageHistory Element speichern
|
||||
// (das könnte auch in einem Background Thread passieren, da der Wert erst irgendwann gelesen wird und aktuell nicht relevant ist)
|
||||
|
||||
// TODO: das könnte auch in einem Background Thread passieren, da der Wert erst irgendwann gelesen wird und aktuell nicht relevant ist
|
||||
SqlCommand cmd = new SqlCommand();
|
||||
mh.PrepareSave(cmd);
|
||||
int queryResult = this.PerformNonQuery(cmd);
|
||||
this.LogNonQueryResult(cmd.CommandText, queryResult);
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeMessageHistoryTypes()
|
||||
{
|
||||
this.messageHistoryTypeDict = new Dictionary<Type, string>
|
||||
{
|
||||
{ typeof(AGNT), typeof(AGNT).Name },
|
||||
{ typeof(ATA), typeof(ATA).Name },
|
||||
{ typeof(ATD), typeof(ATD).Name },
|
||||
{ typeof(BRKA), typeof(BRKA).Name },
|
||||
{ typeof(BRKD), typeof(BRKD).Name },
|
||||
{ typeof(CREW), typeof(CREW).Name },
|
||||
{ typeof(HAZ), typeof(HAZ).Name },
|
||||
{ typeof(INFO), typeof(INFO).Name },
|
||||
{ typeof(LADG), typeof(LADG).Name },
|
||||
{ typeof(MDH), typeof(MDH).Name },
|
||||
{ typeof(NAME), typeof(NAME).Name },
|
||||
{ typeof(NOA_NOD), typeof(NOA_NOD).Name },
|
||||
{ typeof(PAS), typeof(PAS).Name },
|
||||
{ typeof(POBA), typeof(POBA).Name },
|
||||
{ typeof(POBD), typeof(POBD).Name },
|
||||
{ typeof(PRE72H), typeof(PRE72H).Name },
|
||||
{ typeof(SEC), typeof(SEC).Name },
|
||||
{ typeof(SERV), typeof(SERV).Name },
|
||||
{ typeof(STAT), typeof(STAT).Name },
|
||||
{ typeof(STO), typeof(STO).Name },
|
||||
{ typeof(TIEFA), typeof(TIEFA).Name },
|
||||
{ typeof(TIEFD), typeof(TIEFD).Name },
|
||||
{ typeof(TOWA), typeof(TOWA).Name },
|
||||
{ typeof(TOWD), typeof(TOWD).Name },
|
||||
{ typeof(WAS), typeof(WAS).Name }
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region CreateMessage()
|
||||
|
||||
|
||||
@ -16,6 +16,7 @@ using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml.Serialization;
|
||||
using System.IO;
|
||||
using Newtonsoft.Json;
|
||||
using log4net;
|
||||
|
||||
namespace bsmd.database
|
||||
@ -24,7 +25,7 @@ namespace bsmd.database
|
||||
[XmlInclude(typeof(Message))]
|
||||
[XmlInclude(typeof(MessageCore))]
|
||||
[XmlInclude(typeof(AGNT))]
|
||||
public abstract class DatabaseEntity : IMessageParagraph, IEquatable<DatabaseEntity>, ICloneable
|
||||
public abstract class DatabaseEntity : IDatabaseEntity, IMessageParagraph, IEquatable<DatabaseEntity>, ICloneable
|
||||
{
|
||||
protected Guid? id;
|
||||
protected string tablename;
|
||||
@ -53,8 +54,10 @@ namespace bsmd.database
|
||||
/// <summary>
|
||||
/// Nachrichtentyp der abgeleiteten Meldeklassen
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public Message.NotificationClass MessageNotificationClass { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string MessageNotificationClassDisplay
|
||||
{
|
||||
get
|
||||
@ -66,16 +69,19 @@ namespace bsmd.database
|
||||
/// <summary>
|
||||
/// Referenz zur eigentlichen Schiffankunft
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public MessageCore MessageCore { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// gemeinschaftliche Daten
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public Message MessageHeader { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// SQL Table name to construct queries
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public virtual string Tablename { get { return this.tablename; } }
|
||||
|
||||
/// <summary>
|
||||
@ -86,11 +92,13 @@ namespace bsmd.database
|
||||
/// <summary>
|
||||
/// IsNew Flag
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public bool IsNew { get { return !this.id.HasValue; } }
|
||||
|
||||
/// <summary>
|
||||
/// Flag zeigt an ob das Objekt geändert wurde
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public bool IsDirty { get; set; }
|
||||
|
||||
#endregion
|
||||
@ -114,6 +122,7 @@ namespace bsmd.database
|
||||
/// <summary>
|
||||
/// Ergebnismenge begrenzen: NULL = kein Limit. Abgeleitete Klassen *können* diesen Parameter berücksichtigen
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public int? ResultLimit { get; set; }
|
||||
|
||||
public abstract void PrepareLoadCommand(IDbCommand cmd, Message.LoadFilter filter, params object[] criteria);
|
||||
@ -271,6 +280,7 @@ namespace bsmd.database
|
||||
|
||||
#region IMessageParagraph implementation
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual string Title
|
||||
{
|
||||
get
|
||||
@ -280,11 +290,13 @@ namespace bsmd.database
|
||||
}
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual string Subtitle
|
||||
{
|
||||
get { return string.Empty; }
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual bool ShowChildrenAsTable
|
||||
{
|
||||
get { return false; }
|
||||
@ -293,6 +305,7 @@ namespace bsmd.database
|
||||
/// <summary>
|
||||
/// must be overridden if it must make sense
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public virtual List<KeyValuePair<string, string>> MessageText
|
||||
{
|
||||
get {
|
||||
@ -321,8 +334,8 @@ namespace bsmd.database
|
||||
|
||||
public virtual string GetDisplayValue(PropertyInfo property)
|
||||
{
|
||||
bool isDouble = (property.PropertyType == typeof(Nullable<double>));
|
||||
bool isDateTime = (property.PropertyType == typeof(Nullable<DateTime>));
|
||||
bool isDouble = (property.PropertyType == typeof(double?));
|
||||
bool isDateTime = (property.PropertyType == typeof(DateTime?));
|
||||
|
||||
object propValue = property.GetValue(this, null);
|
||||
if (propValue == null) return "";
|
||||
@ -352,6 +365,7 @@ namespace bsmd.database
|
||||
return value;
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual List<IMessageParagraph> ChildParagraphs { get { return null; } }
|
||||
|
||||
#endregion
|
||||
@ -367,33 +381,5 @@ namespace bsmd.database
|
||||
|
||||
#endregion
|
||||
|
||||
#region Serialization
|
||||
|
||||
public static DatabaseEntity Deserialize(string serializedClass)
|
||||
{
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public string Serialize()
|
||||
{
|
||||
using (StringWriter sw = new StringWriter())
|
||||
{
|
||||
try
|
||||
{
|
||||
XmlSerializer serializer = new XmlSerializer(this.GetType());
|
||||
serializer.Serialize(sw, this);
|
||||
return sw.ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_log.ErrorFormat("Serialization failed: {0}", ex.Message);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@ using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
@ -56,6 +57,7 @@ namespace bsmd.database
|
||||
|
||||
#region Properties
|
||||
|
||||
[JsonIgnore]
|
||||
public HAZ HAZ { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
@ -71,6 +73,7 @@ namespace bsmd.database
|
||||
|
||||
[ShowReport]
|
||||
[ReportDisplayName("PollutionCategory")]
|
||||
[JsonIgnore]
|
||||
public string PollutionCategoryDisplay
|
||||
{
|
||||
get
|
||||
@ -86,6 +89,7 @@ namespace bsmd.database
|
||||
|
||||
[ShowReport]
|
||||
[ReportDisplayName("Hazards")]
|
||||
[JsonIgnore]
|
||||
public string HazardsDisplay
|
||||
{
|
||||
get
|
||||
@ -102,6 +106,7 @@ namespace bsmd.database
|
||||
|
||||
[ShowReport]
|
||||
[ReportDisplayName("FlashpointInformation")]
|
||||
[JsonIgnore]
|
||||
public string FlashpointInformationDisplay
|
||||
{
|
||||
get
|
||||
@ -152,6 +157,7 @@ namespace bsmd.database
|
||||
|
||||
public string Identifier { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string SublistCollectionKey { get { return "ibc"; } }
|
||||
|
||||
#endregion
|
||||
|
||||
25
nsw/Source/bsmd.database/IDatabaseEntity.cs
Normal file
25
nsw/Source/bsmd.database/IDatabaseEntity.cs
Normal file
@ -0,0 +1,25 @@
|
||||
// Copyright (c) 2015-2017 schick Informatik
|
||||
// Description: Interface für DB Objekte, die nicht von DatabaseEntity erben
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
public interface IDatabaseEntity
|
||||
{
|
||||
|
||||
string Tablename { get; }
|
||||
|
||||
void PrepareSave(IDbCommand cmd);
|
||||
|
||||
void PrepareDelete(IDbCommand cmd);
|
||||
|
||||
List<DatabaseEntity> LoadList(IDataReader reader);
|
||||
|
||||
}
|
||||
}
|
||||
@ -11,6 +11,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
@ -24,6 +25,7 @@ namespace bsmd.database
|
||||
|
||||
#region Properties
|
||||
|
||||
[JsonIgnore]
|
||||
public HAZ HAZ { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
@ -72,6 +74,7 @@ namespace bsmd.database
|
||||
|
||||
public string Identifier { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string SublistCollectionKey { get { return "igc"; } }
|
||||
|
||||
#endregion
|
||||
|
||||
@ -13,14 +13,12 @@ using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
public class IMDGPosition : DatabaseEntity, ISublistElement
|
||||
{
|
||||
|
||||
private List<SubsidiaryRisks> subsidiaryRisksList = new List<SubsidiaryRisks>();
|
||||
|
||||
public IMDGPosition()
|
||||
{
|
||||
this.tablename = "[dbo].[IMDGPosition]";
|
||||
@ -28,6 +26,7 @@ namespace bsmd.database
|
||||
|
||||
#region Properties
|
||||
|
||||
[JsonIgnore]
|
||||
public HAZ HAZ { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
@ -190,22 +189,23 @@ namespace bsmd.database
|
||||
[ENI2Validation]
|
||||
public string Remarks { get; set; }
|
||||
|
||||
public List<SubsidiaryRisks> SubsidiaryRiskList { get { return this.subsidiaryRisksList; } }
|
||||
public List<SubsidiaryRisks> SubsidiaryRiskList { get; private set; } = new List<SubsidiaryRisks>();
|
||||
|
||||
/// <summary>
|
||||
/// Hilfsproperty, um subsidiary risks als kommaseparierte Liste anzuzeigen (ENI-2)
|
||||
/// </summary>
|
||||
[ENI2Validation]
|
||||
[JsonIgnore]
|
||||
public string SubsidiaryRiskText
|
||||
{
|
||||
get
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < this.subsidiaryRisksList.Count; i++)
|
||||
for (int i = 0; i < this.SubsidiaryRiskList.Count; i++)
|
||||
{
|
||||
if (i > 0)
|
||||
sb.Append(", ");
|
||||
sb.Append(this.subsidiaryRisksList[i].SubsidiaryRisk);
|
||||
sb.Append(this.SubsidiaryRiskList[i].SubsidiaryRisk);
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
@ -254,15 +254,16 @@ namespace bsmd.database
|
||||
// remove remaining risk (no longer valid)
|
||||
foreach (SubsidiaryRisks remainingRisk in this.SubsidiaryRiskList)
|
||||
DBManager.Instance.Delete(remainingRisk);
|
||||
this.subsidiaryRisksList.Clear();
|
||||
this.SubsidiaryRiskList.Clear();
|
||||
// add existing and new risk
|
||||
this.subsidiaryRisksList.AddRange(foundList);
|
||||
this.SubsidiaryRiskList.AddRange(foundList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string Identifier { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string SublistCollectionKey { get { return "imdg"; } }
|
||||
|
||||
#endregion
|
||||
@ -523,7 +524,7 @@ namespace bsmd.database
|
||||
{
|
||||
IMDGPosition imdg = this.MemberwiseClone() as IMDGPosition;
|
||||
imdg.id = null;
|
||||
imdg.subsidiaryRisksList = new List<SubsidiaryRisks>();
|
||||
imdg.SubsidiaryRiskList = new List<SubsidiaryRisks>();
|
||||
|
||||
foreach (SubsidiaryRisks sr in this.SubsidiaryRiskList)
|
||||
{
|
||||
|
||||
@ -11,6 +11,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
@ -24,6 +25,7 @@ namespace bsmd.database
|
||||
|
||||
#region Properties
|
||||
|
||||
[JsonIgnore]
|
||||
public HAZ HAZ { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
@ -77,6 +79,7 @@ namespace bsmd.database
|
||||
|
||||
public string Identifier { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string SublistCollectionKey { get { return "imsbc"; } }
|
||||
|
||||
#endregion
|
||||
|
||||
@ -11,6 +11,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
@ -24,6 +25,7 @@ namespace bsmd.database
|
||||
|
||||
#region Properties
|
||||
|
||||
[JsonIgnore]
|
||||
public MDH MDH { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
@ -37,6 +39,7 @@ namespace bsmd.database
|
||||
|
||||
public string Identifier { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string SublistCollectionKey { get { return "infectedarea"; } }
|
||||
|
||||
#endregion
|
||||
|
||||
@ -11,6 +11,7 @@ using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
@ -24,6 +25,7 @@ namespace bsmd.database
|
||||
|
||||
#region Properties
|
||||
|
||||
[JsonIgnore]
|
||||
public SEC SEC { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
@ -76,6 +78,7 @@ namespace bsmd.database
|
||||
|
||||
public string Identifier { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string SublistCollectionKey { get { return "l10pfc"; } }
|
||||
|
||||
#endregion
|
||||
@ -110,7 +113,7 @@ namespace bsmd.database
|
||||
}
|
||||
else
|
||||
{
|
||||
scmd.Parameters.AddWithValue(@"ID", this.Id);
|
||||
scmd.Parameters.AddWithValue("ID", this.Id);
|
||||
scmd.CommandText = string.Format("UPDATE {0} SET PortFacilityPortName = @P2, PortFacilityPortCountry = @P3, " +
|
||||
"PortFacilityPortLoCode = @P4, PortFacilityDateOfArrival = @P5, PortFacilityDateOfDeparture = @P6," +
|
||||
"PortFacilityShipSecurityLevel = @P7, PortFacilitySecurityMattersToReport = @P8, PortFacilityGISISCode = @P9, " +
|
||||
|
||||
@ -12,6 +12,7 @@ using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
@ -25,6 +26,7 @@ namespace bsmd.database
|
||||
|
||||
#region Properties
|
||||
|
||||
[JsonIgnore]
|
||||
public HAZ HAZ { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
@ -85,6 +87,7 @@ namespace bsmd.database
|
||||
|
||||
public string Identifier { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string SublistCollectionKey { get { return "marpol"; } }
|
||||
|
||||
#endregion
|
||||
@ -116,7 +119,7 @@ namespace bsmd.database
|
||||
}
|
||||
else
|
||||
{
|
||||
scmd.Parameters.AddWithValue(@"ID", this.Id);
|
||||
scmd.Parameters.AddWithValue("@ID", this.Id);
|
||||
scmd.CommandText = string.Format("UPDATE {0} SET Name = @P2, FlashpointInformation= @P3, Flashpoint_CEL = @P4, " +
|
||||
"Quantity_KGM = @P5, StowagePosition = @P6, PortOfLoading = @P7, PortOfDischarge = @P8, Remarks = @P9, " +
|
||||
"Identifier = @P10 WHERE Id = @ID", this.Tablename);
|
||||
@ -184,7 +187,7 @@ namespace bsmd.database
|
||||
|
||||
if (!this.Flashpoint_CEL.IsNullOrEmpty())
|
||||
{
|
||||
string pattern = @"^[<>]?\-?[0-9]+(\.[0-9]+)?$";
|
||||
const string pattern = @"^[<>]?\-?[0-9]+(\.[0-9]+)?$";
|
||||
Regex regex = new Regex(pattern);
|
||||
|
||||
if (!regex.IsMatch(this.Flashpoint_CEL))
|
||||
|
||||
@ -13,17 +13,8 @@ namespace bsmd.database
|
||||
public class Message : DatabaseEntity, ISublistContainer, IComparable<Message>
|
||||
{
|
||||
|
||||
#region Fields
|
||||
|
||||
private Guid? messageCoreId;
|
||||
private Guid? reportingPartyId;
|
||||
#region Fields
|
||||
private ReportingParty reportingParty;
|
||||
private DateTime? created;
|
||||
private DateTime? changed;
|
||||
private List<MessageError> errorList = new List<MessageError>();
|
||||
private List<MessageViolation> violationList = new List<MessageViolation>();
|
||||
private List<SystemError> systemErrorList = new List<SystemError>();
|
||||
private ObservableCollection<DatabaseEntity> elements = new ObservableCollection<DatabaseEntity>();
|
||||
|
||||
#endregion
|
||||
|
||||
@ -172,14 +163,20 @@ namespace bsmd.database
|
||||
{
|
||||
[Description("Unspecified")]
|
||||
UNDEFINED,
|
||||
|
||||
DBH,
|
||||
|
||||
DAKOSY,
|
||||
|
||||
[Description("HIS-Nord")]
|
||||
DUDR,
|
||||
|
||||
[Description("DBH Testsystem")]
|
||||
DBH_TEST,
|
||||
|
||||
[Description("Dakosy Testsystem")]
|
||||
DAKOSY_TEST,
|
||||
|
||||
[Description("HIS-Nord Testsystem")]
|
||||
DUDR_TEST
|
||||
}
|
||||
@ -204,7 +201,7 @@ namespace bsmd.database
|
||||
|
||||
public Guid? MessageId { get; set; }
|
||||
|
||||
public Guid? MessageCoreId { get { return this.messageCoreId; } set { this.messageCoreId = value; } }
|
||||
public Guid? MessageCoreId { get; set; }
|
||||
|
||||
public DateTime? SentAt { get; set; }
|
||||
|
||||
@ -221,7 +218,7 @@ namespace bsmd.database
|
||||
public MessageStatus? Status { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
public DateTime? Created { get { return this.created; } }
|
||||
public DateTime? Created { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Vorwärts-Referenzen auf die von diesem Header-Element abhängigen speziellen Nachrichten-Datensätzen
|
||||
@ -229,7 +226,7 @@ namespace bsmd.database
|
||||
/// BRKA, BRKD, LADG, CREW, PAS, SERV, TOWA, TOWD, STO, CREWD, PASD
|
||||
/// sonst hat die Liste immer ein Element
|
||||
/// </summary>
|
||||
public ObservableCollection<DatabaseEntity> Elements { get { return this.elements; } }
|
||||
public ObservableCollection<DatabaseEntity> Elements { get; } = new ObservableCollection<DatabaseEntity>();
|
||||
|
||||
/// <summary>
|
||||
/// Der Meldende
|
||||
@ -241,11 +238,11 @@ namespace bsmd.database
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
this.reportingPartyId = null;
|
||||
this.ReportingPartyId = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.reportingPartyId = value.Id;
|
||||
this.ReportingPartyId = value.Id;
|
||||
}
|
||||
this.reportingParty = value;
|
||||
}
|
||||
@ -274,22 +271,22 @@ namespace bsmd.database
|
||||
/// <summary>
|
||||
/// Fehlerliste (Rückgabe vom NSW)
|
||||
/// </summary>
|
||||
public List<MessageError> ErrorList { get { return this.errorList; } }
|
||||
public List<MessageError> ErrorList { get; } = new List<MessageError>();
|
||||
|
||||
/// <summary>
|
||||
/// Violation-Liste (Rückgabe vom NSW)
|
||||
/// </summary>
|
||||
public List<MessageViolation> ViolationList { get { return this.violationList; } }
|
||||
public List<MessageViolation> ViolationList { get; } = new List<MessageViolation>();
|
||||
|
||||
/// <summary>
|
||||
/// Liste mit "System"-Errors (HIS-Nord)
|
||||
/// </summary>
|
||||
public List<SystemError> SystemErrorList { get { return this.systemErrorList; } }
|
||||
public List<SystemError> SystemErrorList { get; } = new List<SystemError>();
|
||||
|
||||
/// <summary>
|
||||
/// Property to overwrite reporting party in certain circumstances (other melder meldet)
|
||||
/// </summary>
|
||||
public Guid? ReportingPartyId { get { return this.reportingPartyId; } set { this.reportingPartyId = value; } }
|
||||
public Guid? ReportingPartyId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Urheber der Nachricht (Excel oder HE)
|
||||
@ -304,7 +301,7 @@ namespace bsmd.database
|
||||
/// <summary>
|
||||
/// Database last "Changed" date display
|
||||
/// </summary>
|
||||
public DateTime? Changed { get { return this.changed; } }
|
||||
public DateTime? Changed { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// ENI-2 detail group text
|
||||
@ -357,7 +354,7 @@ namespace bsmd.database
|
||||
this.ViolationList.IsNullOrEmpty() &&
|
||||
this.ErrorList.IsNullOrEmpty() &&
|
||||
this.Status.HasValue &&
|
||||
!(this.Reset) &&
|
||||
!this.Reset &&
|
||||
(this.Status.Value == MessageStatus.ACCEPTED);
|
||||
}
|
||||
}
|
||||
@ -374,9 +371,9 @@ namespace bsmd.database
|
||||
|
||||
#region IDatabaseEntity implementation
|
||||
|
||||
public override void PrepareSave(IDbCommand cmdParam)
|
||||
public override void PrepareSave(IDbCommand dbCommand)
|
||||
{
|
||||
SqlCommand cmd = cmdParam as SqlCommand;
|
||||
SqlCommand cmd = dbCommand as SqlCommand;
|
||||
|
||||
if (this.ClientRequestId != null)
|
||||
cmd.Parameters.AddWithValue("@CLIENTREQUESTID", Guid.Parse(this.ClientRequestId));
|
||||
@ -407,7 +404,7 @@ namespace bsmd.database
|
||||
else
|
||||
cmd.Parameters.AddWithValue("@STATUS", DBNull.Value);
|
||||
|
||||
cmd.Parameters.AddWithNullableValue("@REPORTINGPARTYID", this.reportingPartyId);
|
||||
cmd.Parameters.AddWithNullableValue("@REPORTINGPARTYID", this.ReportingPartyId);
|
||||
cmd.Parameters.AddWithValue("@BSMDSTATUS", this.InternalStatus);
|
||||
cmd.Parameters.AddWithNullableValue("@LASTSTATUS", this.LastStatus);
|
||||
cmd.Parameters.AddWithValue("@HIS", this.HIS);
|
||||
@ -508,7 +505,7 @@ namespace bsmd.database
|
||||
Message msg = new Message();
|
||||
msg.id = reader.GetGuid(0);
|
||||
if (!reader.IsDBNull(1)) msg.ClientRequestId = reader.GetGuid(1).ToString();
|
||||
msg.messageCoreId = reader.GetGuid(2);
|
||||
msg.MessageCoreId = reader.GetGuid(2);
|
||||
if(!reader.IsDBNull(3)) msg.MessageId = reader.GetGuid(3);
|
||||
if (!reader.IsDBNull(4)) msg.SentAt = reader.GetDateTime(4);
|
||||
if (!reader.IsDBNull(5)) msg.ReceivedAt = reader.GetDateTime(5);
|
||||
@ -517,14 +514,14 @@ namespace bsmd.database
|
||||
if (!reader.IsDBNull(8)) msg.Reset = reader.GetBoolean(8);
|
||||
if (!reader.IsDBNull(9)) msg.Cancel = reader.GetBoolean(9);
|
||||
if (!reader.IsDBNull(10)) msg.Status = (MessageStatus)Enum.ToObject(typeof(MessageStatus), reader.GetByte(10));
|
||||
if (!reader.IsDBNull(11)) msg.reportingPartyId = reader.GetGuid(11);
|
||||
if (!reader.IsDBNull(11)) msg.ReportingPartyId = reader.GetGuid(11);
|
||||
if (!reader.IsDBNull(12)) msg.InternalStatus = (BSMDStatus)Enum.ToObject(typeof(BSMDStatus), reader.GetByte(12));
|
||||
if (!reader.IsDBNull(13)) msg.LastStatus = (BSMDStatus)Enum.ToObject(typeof(BSMDStatus), reader.GetByte(13));
|
||||
if (!reader.IsDBNull(14)) msg.HIS = (NSWProvider)Enum.ToObject(typeof(NSWProvider), reader.GetByte(14));
|
||||
if (!reader.IsDBNull(15)) msg.created = reader.GetDateTime(15);
|
||||
if (!reader.IsDBNull(15)) msg.Created = reader.GetDateTime(15);
|
||||
if (!reader.IsDBNull(16)) msg.CreatedBy = reader.GetString(16);
|
||||
if (!reader.IsDBNull(17)) msg.ChangedBy = reader.GetString(17);
|
||||
if (!reader.IsDBNull(18)) msg.changed = reader.GetDateTime(18);
|
||||
if (!reader.IsDBNull(18)) msg.Changed = reader.GetDateTime(18);
|
||||
if (!reader.IsDBNull(19)) msg.StatusInfo = reader.GetString(19);
|
||||
if (!reader.IsDBNull(20)) msg.SendSuccess = reader.GetBoolean(20);
|
||||
if (!reader.IsDBNull(21)) msg.SentBy = reader.GetString(21);
|
||||
@ -542,8 +539,8 @@ namespace bsmd.database
|
||||
{
|
||||
foreach (Message message in messages)
|
||||
{
|
||||
if (message.reportingPartyId.HasValue && reportingParties.ContainsKey(message.reportingPartyId.Value))
|
||||
message.reportingParty = reportingParties[message.reportingPartyId.Value];
|
||||
if (message.ReportingPartyId.HasValue && reportingParties.ContainsKey(message.ReportingPartyId.Value))
|
||||
message.reportingParty = reportingParties[message.ReportingPartyId.Value];
|
||||
}
|
||||
}
|
||||
|
||||
@ -551,14 +548,13 @@ namespace bsmd.database
|
||||
{
|
||||
foreach (Message message in messages)
|
||||
{
|
||||
if (message.messageCoreId.HasValue && messageCores.ContainsKey(message.messageCoreId.Value))
|
||||
message.MessageCore = messageCores[message.messageCoreId.Value];
|
||||
if (message.MessageCoreId.HasValue && messageCores.ContainsKey(message.MessageCoreId.Value))
|
||||
message.MessageCore = messageCores[message.MessageCoreId.Value];
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsListClass(NotificationClass notificationClass)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
switch(notificationClass)
|
||||
{
|
||||
@ -576,7 +572,7 @@ namespace bsmd.database
|
||||
return true;
|
||||
}
|
||||
|
||||
return result;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -624,7 +620,7 @@ namespace bsmd.database
|
||||
foreach (DatabaseEntity entity in this.Elements)
|
||||
{
|
||||
ISublistElement sublistElement = entity as ISublistElement;
|
||||
if ((sublistElement != null ) && (sublistElement.Identifier != null))
|
||||
if (sublistElement?.Identifier != null)
|
||||
{
|
||||
if (((ISublistElement)entity).Identifier.Equals(identifier))
|
||||
return entity as ISublistElement;
|
||||
@ -661,9 +657,9 @@ namespace bsmd.database
|
||||
foreach (DatabaseEntity dbEntity in this.Elements)
|
||||
{
|
||||
DBManager.Instance.Save(dbEntity);
|
||||
if (dbEntity is ISublistContainer)
|
||||
if (dbEntity is ISublistContainer sublistContainer)
|
||||
{
|
||||
((ISublistContainer)dbEntity).SaveElements();
|
||||
(sublistContainer).SaveElements();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -672,9 +668,9 @@ namespace bsmd.database
|
||||
{
|
||||
foreach (DatabaseEntity dbEntity in this.Elements)
|
||||
{
|
||||
if (dbEntity is ISublistContainer)
|
||||
if (dbEntity is ISublistContainer sublistContainer)
|
||||
{
|
||||
((ISublistContainer)dbEntity).DeleteElements();
|
||||
(sublistContainer).DeleteElements();
|
||||
}
|
||||
DBManager.Instance.Delete(dbEntity);
|
||||
}
|
||||
|
||||
@ -3,31 +3,94 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
public class MessageHistory
|
||||
public class MessageHistory : IDatabaseEntity
|
||||
{
|
||||
|
||||
private const string tableName = "[MessageHistory]";
|
||||
|
||||
#region Properties
|
||||
|
||||
public string Tablename { get { return tableName; } }
|
||||
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
public Guid? ReportingPartyId { get; set; }
|
||||
|
||||
ReportingParty CreatedBy { get; set; }
|
||||
public ReportingParty CreatedBy { get; set; }
|
||||
|
||||
public Guid EntityId { get; private set; }
|
||||
public Guid EntityId { get; internal set; }
|
||||
|
||||
public string EntityType { get; private set; }
|
||||
public string EntityType { get; internal set; }
|
||||
|
||||
public string EntityName { get; private set; }
|
||||
public string EntityName { get; internal set; }
|
||||
|
||||
public string EntityValues { get; private set; }
|
||||
public string EntityValues { get; internal set; }
|
||||
|
||||
public DateTime Created { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDatabaseEntity implementation
|
||||
|
||||
public void PrepareSave(IDbCommand cmd)
|
||||
{
|
||||
SqlCommand scmd = cmd as SqlCommand;
|
||||
|
||||
// es gibt nur insert
|
||||
this.Id = Guid.NewGuid();
|
||||
scmd.Parameters.AddWithValue("@ID", this.Id);
|
||||
scmd.Parameters.AddWithNullableValue("@P1", this.ReportingPartyId);
|
||||
scmd.Parameters.AddWithValue("@P2", this.EntityId);
|
||||
scmd.Parameters.AddWithValue("@P3", this.EntityType);
|
||||
scmd.Parameters.AddWithValue("@P4", this.EntityName);
|
||||
scmd.Parameters.AddWithValue("@P5", this.EntityValues);
|
||||
scmd.Parameters.AddWithValue("@P6", DateTime.Now);
|
||||
|
||||
cmd.CommandText = string.Format("INSERT INTO {0} (Id, ReportingPartyId, EntityId, EntityType, " +
|
||||
"EntityName, EntityValues, Timestamp) VALUES (@ID, @P1, @P2, @P3, @P4, @P5, @P6)", this.Tablename);
|
||||
}
|
||||
|
||||
public void PrepareDelete(IDbCommand cmd)
|
||||
{
|
||||
SqlCommand scmd = cmd as SqlCommand;
|
||||
scmd.CommandText = string.Format("DELETE FROM {0} WHERE Id = @ID", Tablename);
|
||||
scmd.Parameters.AddWithValue("@ID", this.Id);
|
||||
}
|
||||
|
||||
public List<MessageHistory> LoadList(IDataReader reader)
|
||||
{
|
||||
List<MessageHistory> result = new List<MessageHistory>();
|
||||
|
||||
while (reader.Read())
|
||||
{
|
||||
MessageHistory mh = new MessageHistory();
|
||||
mh.Id = reader.GetGuid(0);
|
||||
if (!reader.IsDBNull(1)) mh.ReportingPartyId = reader.GetGuid(1);
|
||||
if (!reader.IsDBNull(2)) mh.EntityId = reader.GetGuid(2);
|
||||
if (!reader.IsDBNull(3)) mh.EntityType = reader.GetString(3);
|
||||
if (!reader.IsDBNull(4)) mh.EntityName = reader.GetString(4);
|
||||
if (!reader.IsDBNull(5)) mh.EntityValues = reader.GetString(5);
|
||||
if (!reader.IsDBNull(6)) mh.Created = reader.GetDateTime(6);
|
||||
|
||||
result.Add(mh);
|
||||
}
|
||||
reader.Close();
|
||||
return result;
|
||||
}
|
||||
|
||||
List<DatabaseEntity> IDatabaseEntity.LoadList(IDataReader reader)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
using System;
|
||||
// Copyright (c) 2015-2017 schick Informatik
|
||||
// Description:
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
|
||||
@ -12,14 +12,12 @@ using System.Data;
|
||||
using System.Text;
|
||||
using System.Data.SqlClient;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
public class PortOfCallLast30Days : DatabaseEntity, ISublistElement, ISublistContainer
|
||||
{
|
||||
|
||||
private List<DatabaseEntity> poc30Crew = new List<DatabaseEntity>();
|
||||
|
||||
public PortOfCallLast30Days()
|
||||
{
|
||||
this.tablename = "[dbo].[PortOfCallLast30Days]";
|
||||
@ -27,9 +25,10 @@ namespace bsmd.database
|
||||
|
||||
#region Properties
|
||||
|
||||
[JsonIgnore]
|
||||
public MDH MDH { get; set; }
|
||||
|
||||
public List<DatabaseEntity> CrewJoinedShip { get { return this.poc30Crew; } }
|
||||
public List<DatabaseEntity> CrewJoinedShip { get; private set; } = new List<DatabaseEntity>();
|
||||
[ShowReport]
|
||||
[Validation2(ValidationCode.LOCODE)]
|
||||
[MaxLength(5)]
|
||||
@ -48,11 +47,13 @@ namespace bsmd.database
|
||||
|
||||
public string Identifier { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string SublistCollectionKey { get { return "pocl30d"; } }
|
||||
|
||||
/// <summary>
|
||||
/// Hilfsproperty, um eine kommaseparierte Liste von Crew (analog ANSW) im ENI-2 anzuzeigen,
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
[ENI2Validation]
|
||||
public string CrewMembersJoinedText
|
||||
{
|
||||
@ -272,7 +273,7 @@ namespace bsmd.database
|
||||
{
|
||||
PortOfCallLast30Days p30 = this.MemberwiseClone() as PortOfCallLast30Days;
|
||||
p30.id = null;
|
||||
p30.poc30Crew = new List<DatabaseEntity>();
|
||||
p30.CrewJoinedShip = new List<DatabaseEntity>();
|
||||
|
||||
foreach (PortOfCallLast30DaysCrewJoinedShip p30Crew in this.CrewJoinedShip)
|
||||
{
|
||||
|
||||
@ -11,6 +11,7 @@ using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
@ -24,6 +25,7 @@ namespace bsmd.database
|
||||
|
||||
#region Properties
|
||||
|
||||
[JsonIgnore]
|
||||
public PortOfCallLast30Days PortOfCallLast30Days { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
@ -34,6 +36,7 @@ namespace bsmd.database
|
||||
|
||||
public string Identifier { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string SublistCollectionKey { get { return "pocl30dcjs"; } }
|
||||
|
||||
#endregion
|
||||
|
||||
@ -11,6 +11,7 @@ using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
@ -24,6 +25,7 @@ namespace bsmd.database
|
||||
|
||||
#region Properties
|
||||
|
||||
[JsonIgnore]
|
||||
public BPOL BPOL { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
@ -43,6 +45,7 @@ namespace bsmd.database
|
||||
|
||||
public string Identifier { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string SublistCollectionKey { get { return "poi"; } }
|
||||
|
||||
#endregion
|
||||
|
||||
@ -11,7 +11,8 @@ namespace bsmd.database
|
||||
{
|
||||
public class ReportingParty : DatabaseEntity
|
||||
{
|
||||
private DateTime? _created, _changed;
|
||||
|
||||
#region Enums
|
||||
|
||||
public enum LogonResult
|
||||
{
|
||||
@ -20,8 +21,6 @@ namespace bsmd.database
|
||||
USERUKN
|
||||
}
|
||||
|
||||
#region enumerations
|
||||
|
||||
public enum ReportingPartyTypeEnum
|
||||
{ MASTER, SHIPOWNER, CHARTERER, AGENT, PORT_AUTHORITY, CARRIER, OTHERS }
|
||||
|
||||
@ -99,6 +98,11 @@ namespace bsmd.database
|
||||
|
||||
public ReportingPartyTypeEnum? ReportingPartyType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reference to current user (for data history)
|
||||
/// </summary>
|
||||
public static ReportingParty CurrentReportingParty { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region ENI Logon User Properties
|
||||
@ -124,9 +128,9 @@ namespace bsmd.database
|
||||
/// </summary>
|
||||
public string Salt { get; set; }
|
||||
|
||||
public DateTime? Created { get { return _created; } }
|
||||
public DateTime? Created { get; private set; }
|
||||
|
||||
public DateTime? Changed { get { return _changed; } }
|
||||
public DateTime? Changed { get; private set; }
|
||||
|
||||
public int Flags { get; set; }
|
||||
|
||||
@ -249,8 +253,8 @@ namespace bsmd.database
|
||||
if (!reader.IsDBNull(11)) rp.Logon = reader.GetString(11);
|
||||
if (!reader.IsDBNull(12)) rp.PasswordHash = reader.GetString(12);
|
||||
if (!reader.IsDBNull(13)) rp.Salt = reader.GetGuid(13).ToString();
|
||||
if (!reader.IsDBNull(14)) rp._created = reader.GetDateTime(14);
|
||||
if (!reader.IsDBNull(15)) rp._changed = reader.GetDateTime(15);
|
||||
if (!reader.IsDBNull(14)) rp.Created = reader.GetDateTime(14);
|
||||
if (!reader.IsDBNull(15)) rp.Changed = reader.GetDateTime(15);
|
||||
if (!reader.IsDBNull(16)) rp.Flags = reader.GetInt32(16);
|
||||
if (!reader.IsDBNull(17)) rp.Deleted = reader.GetInt32(17);
|
||||
if (!reader.IsDBNull(18)) rp.UserEMail = reader.GetString(18);
|
||||
|
||||
@ -12,6 +12,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
@ -25,6 +26,7 @@ namespace bsmd.database
|
||||
|
||||
#region Properties
|
||||
|
||||
[JsonIgnore]
|
||||
public MDH MDH { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
@ -45,6 +47,7 @@ namespace bsmd.database
|
||||
|
||||
public string Identifier { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string SublistCollectionKey { get { return "smd"; } }
|
||||
|
||||
#endregion
|
||||
|
||||
@ -11,6 +11,7 @@ using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
@ -24,6 +25,7 @@ namespace bsmd.database
|
||||
|
||||
#region Properties
|
||||
|
||||
[JsonIgnore]
|
||||
public SEC SEC { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
@ -71,6 +73,7 @@ namespace bsmd.database
|
||||
|
||||
public string Identifier { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string SublistCollectionKey { get { return "s2s"; } }
|
||||
|
||||
#endregion
|
||||
|
||||
@ -12,6 +12,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
@ -25,6 +26,7 @@ namespace bsmd.database
|
||||
|
||||
#region Properties
|
||||
|
||||
[JsonIgnore]
|
||||
public MDH MDH { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
@ -35,6 +37,7 @@ namespace bsmd.database
|
||||
|
||||
public string Identifier { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string SublistCollectionKey { get { return "stowaways"; } }
|
||||
|
||||
#endregion
|
||||
|
||||
@ -11,6 +11,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
@ -24,6 +25,7 @@ namespace bsmd.database
|
||||
|
||||
#region Properties
|
||||
|
||||
[JsonIgnore]
|
||||
public IMDGPosition IMDGPosition { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
@ -33,6 +35,7 @@ namespace bsmd.database
|
||||
|
||||
public string Identifier { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string SublistCollectionKey { get { return "subsidiaryrisks"; } }
|
||||
|
||||
#endregion
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
|
||||
using System.Data.SqlClient;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
@ -22,8 +23,10 @@ namespace bsmd.database
|
||||
|
||||
#region Properties
|
||||
|
||||
[JsonIgnore]
|
||||
public WAS WAS { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[ShowReport]
|
||||
public string WasteTypeDisplay
|
||||
{
|
||||
@ -47,6 +50,7 @@ namespace bsmd.database
|
||||
}
|
||||
|
||||
[ShowReport]
|
||||
[JsonIgnore]
|
||||
public string WasteTypeDisplayV4
|
||||
{
|
||||
get
|
||||
@ -75,6 +79,7 @@ namespace bsmd.database
|
||||
}
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public string WasteTypeDisplayGrid
|
||||
{
|
||||
get
|
||||
@ -122,8 +127,10 @@ namespace bsmd.database
|
||||
|
||||
public string Identifier { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string SublistCollectionKey { get { return "waste"; } }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool HasValidWasteCode
|
||||
{
|
||||
get
|
||||
|
||||
@ -11,6 +11,7 @@ using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
@ -24,6 +25,7 @@ namespace bsmd.database
|
||||
|
||||
#region Properties
|
||||
|
||||
[JsonIgnore]
|
||||
public WAS WAS { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
@ -33,10 +35,12 @@ namespace bsmd.database
|
||||
public string WasteDisposalServiceProviderName { get; set; }
|
||||
|
||||
[Obsolete]
|
||||
[JsonIgnore]
|
||||
public byte? WasteDisposalDelivery { get; set; }
|
||||
|
||||
public string Identifier { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string SublistCollectionKey { get { return "wdsp"; } }
|
||||
|
||||
#endregion
|
||||
|
||||
@ -44,6 +44,9 @@
|
||||
<HintPath>..\..\..\ENI-2\ENI2\ENI2\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\ENI-2\ENI2\ENI2\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
@ -65,6 +68,7 @@
|
||||
<Compile Include="Extensions.cs" />
|
||||
<Compile Include="HAZ.cs" />
|
||||
<Compile Include="IBCPosition.cs" />
|
||||
<Compile Include="IDatabaseEntity.cs" />
|
||||
<Compile Include="IGCPosition.cs" />
|
||||
<Compile Include="IMDGPosition.cs" />
|
||||
<Compile Include="IMessageParagraph.cs" />
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="log4net" version="2.0.8" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net45" />
|
||||
</packages>
|
||||
Loading…
Reference in New Issue
Block a user