diff --git a/ENI-2/ENI2/ENI2/App.config b/ENI-2/ENI2/ENI2/App.config
index 0b733dcc..bf37c193 100644
--- a/ENI-2/ENI2/ENI2/App.config
+++ b/ENI-2/ENI2/ENI2/App.config
@@ -26,12 +26,12 @@
1000
-
- http://heupferd/bsmd.LockingService/LockingService.svc
+ http://192.168.2.24/LockingService/LockingService.svc
+
-
- 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
+ Initial Catalog=nsw;Data Source=192.168.2.24\SQLEXPRESS;Uid=dfuser;pwd=dfpasswd;Persist Security Info=False;Connection Reset=false
+
diff --git a/ENI-2/ENI2/ENI2/ENI2.csproj b/ENI-2/ENI2/ENI2/ENI2.csproj
index 4019aa27..feb385b1 100644
--- a/ENI-2/ENI2/ENI2/ENI2.csproj
+++ b/ENI-2/ENI2/ENI2/ENI2.csproj
@@ -35,7 +35,7 @@
true
publish.html
1
- 6.0.8.%2a
+ 6.0.9.%2a
false
true
true
diff --git a/ENI-2/ENI2/ENI2/EditControls/ShowIdDialog.xaml b/ENI-2/ENI2/ENI2/EditControls/ShowIdDialog.xaml
index 0c9dcb1d..8be6508a 100644
--- a/ENI-2/ENI2/ENI2/EditControls/ShowIdDialog.xaml
+++ b/ENI-2/ENI2/ENI2/EditControls/ShowIdDialog.xaml
@@ -17,6 +17,7 @@
-
+
+
diff --git a/ENI-2/ENI2/ENI2/EditControls/ShowIdDialog.xaml.cs b/ENI-2/ENI2/ENI2/EditControls/ShowIdDialog.xaml.cs
index 6875b6c4..1337b3d2 100644
--- a/ENI-2/ENI2/ENI2/EditControls/ShowIdDialog.xaml.cs
+++ b/ENI-2/ENI2/ENI2/EditControls/ShowIdDialog.xaml.cs
@@ -3,18 +3,9 @@
//
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
namespace ENI2.EditControls
{
@@ -34,6 +25,8 @@ namespace ENI2.EditControls
get { return this.textBoxId.Text; }
}
+ public bool OpenCore { get; private set; }
+
public void UpdateId(string id)
{
this.Dispatcher.Invoke(new Action(() =>
@@ -54,5 +47,11 @@ namespace ENI2.EditControls
{
this.Close();
}
+
+ private void Button_Click_1(object sender, RoutedEventArgs e)
+ {
+ this.OpenCore = true;
+ this.Close();
+ }
}
}
diff --git a/ENI-2/ENI2/ENI2/MainWindow.xaml.cs b/ENI-2/ENI2/ENI2/MainWindow.xaml.cs
index 17d43785..4fa6e545 100644
--- a/ENI-2/ENI2/ENI2/MainWindow.xaml.cs
+++ b/ENI-2/ENI2/ENI2/MainWindow.xaml.cs
@@ -401,7 +401,7 @@ namespace ENI2
closedDialog.Core.DefaultReportingPartyId = this.userEntity.Id;
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(closedDialog.Core);
- // Meldeklassen für neuen Anlauf erzeugen:
+ // Meldeklassen für neuen Anlauf erzeugen:dam
bsmd.database.Util.CreateMessagesForCore(closedDialog.Core, null, userEntity);
// watchdog registrieren
@@ -410,13 +410,17 @@ namespace ENI2
// Wartedialog anzeigen
this.showIdDialog = new ShowIdDialog();
this.showIdDialog.Closed += (showIdDialog, showIdArgs) =>
- {
- // wenn der Dialog vorzeitig geschlossen wird erkennt man später dass man die Id dort nicht updaten braucht
- this.showIdDialog = null;
- this._dbWatchDog.UnRegister(closedDialog.Core);
+ {
+ if(this.showIdDialog.OpenCore)
+ this.AnmeldungenControl_MessageCoreSelected(closedDialog.Core); // in einem neuen Reiter öffnen
+ else
+ this._dbWatchDog.UnRegister(closedDialog.Core);
+
+ // wenn der Dialog vorzeitig geschlossen wird erkennt man später dass man die Id dort nicht updaten braucht
+ this.showIdDialog = null;
};
this.showIdDialog.ShowDialog();
- // this.AnmeldungenControl_MessageCoreSelected(closedDialog.Core); // in einem neuen Reiter öffnen
+ //
}
};
visitIdDialog.Show();
diff --git a/Stundensheet.xlsx b/Stundensheet.xlsx
index cba2f41d..e66ebc1b 100644
Binary files a/Stundensheet.xlsx and b/Stundensheet.xlsx differ
diff --git a/nsw/Source/bsmd.database/ATA.cs b/nsw/Source/bsmd.database/ATA.cs
index 772cd99b..0303ea71 100644
--- a/nsw/Source/bsmd.database/ATA.cs
+++ b/nsw/Source/bsmd.database/ATA.cs
@@ -24,7 +24,7 @@ namespace bsmd.database
#region Properties
[ShowReport]
- [Validation(ValidationCode.TIME_IMPLAUSIBLE)]
+ [Validation(ValidationCode.NOT_NULL)]
[LookupName("ATA.ATAPortOfCall")]
[ENI2Validation]
public DateTime? ATAPortOfCall { get; set; }
@@ -98,6 +98,15 @@ namespace bsmd.database
return result;
}
+ public override void Validate(List errors, List violations)
+ {
+ if (this.ATAPortOfCall.HasValue)
+ {
+ if ((this.ATAPortOfCall.Value > DateTime.Now.AddDays(14)) || (this.ATAPortOfCall.Value < DateTime.Now.AddDays(-14)))
+ violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "ATA implausible", this.ATAPortOfCall.Value.ToString(), this.Title, null, this.Tablename));
+ }
+ }
+
#endregion
}
diff --git a/nsw/Source/bsmd.database/ATD.cs b/nsw/Source/bsmd.database/ATD.cs
index ff5dd53d..b0dca8e3 100644
--- a/nsw/Source/bsmd.database/ATD.cs
+++ b/nsw/Source/bsmd.database/ATD.cs
@@ -24,7 +24,7 @@ namespace bsmd.database
#region Properties
[ShowReport]
- [Validation(ValidationCode.TIME_IMPLAUSIBLE)]
+ [Validation(ValidationCode.NOT_NULL)]
[LookupName("ATD.ATDPortOfCall")]
[ENI2Validation]
public DateTime? ATDPortOfCall { get; set; }
@@ -98,6 +98,15 @@ namespace bsmd.database
return result;
}
+ public override void Validate(List errors, List violations)
+ {
+ if(this.ATDPortOfCall.HasValue)
+ {
+ if((this.ATDPortOfCall.Value > DateTime.Now.AddDays(14)) || (this.ATDPortOfCall.Value < DateTime.Now.AddDays(-14)))
+ violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "ATD implausible", this.ATDPortOfCall.Value.ToString(), this.Title, null, this.Tablename));
+ }
+ }
+
#endregion
}
diff --git a/nsw/Source/bsmd.database/NOA_NOD.cs b/nsw/Source/bsmd.database/NOA_NOD.cs
index e0f7e947..88b2e8df 100644
--- a/nsw/Source/bsmd.database/NOA_NOD.cs
+++ b/nsw/Source/bsmd.database/NOA_NOD.cs
@@ -248,16 +248,16 @@ namespace bsmd.database
{
if(this.ETDFromPortOfCall.HasValue && this.ETAToPortOfCall.HasValue &&
(this.ETDFromPortOfCall < this.ETAToPortOfCall))
- errors.Add(RuleEngine.CreateError(ValidationCode.E121, "ETDFromPortOfCall", this.ETDFromPortOfCall.ToString(), this.Title, null, this.Tablename));
+ errors.Add(RuleEngine.CreateError(ValidationCode.E121, "ETDFromPortOfCall implausible", this.ETDFromPortOfCall.ToString(), this.Title, null, this.Tablename));
// 8.11.20 Validierung gegen ETA /ETD in der Vergangenheit
if(this.ETAToPortOfCall < DateTime.Now)
{
- violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "ETAToPortOfCall", this.ETAToPortOfCall.Value.ToString(), this.Title, null, this.Tablename));
+ violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "ETAToPortOfCall implausible", this.ETAToPortOfCall.Value.ToString(), this.Title, null, this.Tablename));
}
if(this.ETDFromLastPort < (DateTime.Now.AddDays(-14)))
{
- violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "ETDFromLastPort", this.ETDFromLastPort.Value.ToString(), this.Title, null, this.Tablename));
+ violations.Add(RuleEngine.CreateViolation(ValidationCode.TIME_IMPLAUSIBLE, "ETDFromLastPort implausible", this.ETDFromLastPort.Value.ToString(), this.Title, null, this.Tablename));
}
if (this.CallPurposes.IsNullOrEmpty())
@@ -279,14 +279,14 @@ namespace bsmd.database
{
if (this.ETDFromKielCanal.HasValue && this.ETAToKielCanal.HasValue &&
(this.ETDFromKielCanal < this.ETAToKielCanal))
- errors.Add(RuleEngine.CreateError(ValidationCode.E121, "ETDFromKielCanal", this.ETDFromKielCanal.ToString(), this.Title, null, this.Tablename));
+ errors.Add(RuleEngine.CreateError(ValidationCode.E121, "ETDFromKielCanal implausible", this.ETDFromKielCanal.ToString(), this.Title, null, this.Tablename));
}
if((this.LastPort?.Equals("ZZUKN") == false) && !this.ETDFromLastPort.HasValue)
- errors.Add(RuleEngine.CreateError(ValidationCode.NOT_NULL, "ETDFromLastPort", null, this.Title, null, this.Tablename));
+ errors.Add(RuleEngine.CreateError(ValidationCode.NOT_NULL, "ETDFromLastPort missing", null, this.Title, null, this.Tablename));
if((this.LastPort?.Equals("ZZUKN") == true) && this.ETDFromLastPort.HasValue)
- errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE_ZZUKN, "ETDFromLastPort", null, this.Title, null, this.Tablename));
+ errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE_ZZUKN, "ETDFromLastPort missing", null, this.Title, null, this.Tablename));
if (this.ETDFromPortOfCall.HasValue && this.ETAToNextPort.HasValue && (this.NextPort?.Equals("ZZUKN") == false) &&
(this.ETAToNextPort <= ETDFromPortOfCall))
diff --git a/nsw/Source/bsmd.email/BSMDMail.cs b/nsw/Source/bsmd.email/BSMDMail.cs
index a463c226..3c0087fe 100644
--- a/nsw/Source/bsmd.email/BSMDMail.cs
+++ b/nsw/Source/bsmd.email/BSMDMail.cs
@@ -145,33 +145,35 @@ namespace bsmd.email
public static void SendSystemInfo(string subject, string body, string recipient)
{
- using BSMDMail mailer = new BSMDMail();
- if(recipient.Equals(Properties.Settings.Default.POP3User, StringComparison.OrdinalIgnoreCase))
+ using (BSMDMail mailer = new BSMDMail())
{
- log.Warn("system info recipient is pop3 user, skipping send to avoid loops");
- return;
- }
- MailMessage message = new MailMessage();
- MailAddress fromAddress = new MailAddress(Properties.Settings.Default.Sender);
- message.From = fromAddress;
- message.Subject = subject;
- message.IsBodyHtml = false;
- message.Body = body;
+ if (recipient.Equals(Properties.Settings.Default.POP3User, StringComparison.OrdinalIgnoreCase))
+ {
+ log.Warn("system info recipient is pop3 user, skipping send to avoid loops");
+ return;
+ }
+ MailMessage message = new MailMessage();
+ MailAddress fromAddress = new MailAddress(Properties.Settings.Default.Sender);
+ message.From = fromAddress;
+ message.Subject = subject;
+ message.IsBodyHtml = false;
+ message.Body = body;
- message.To.Add(recipient);
- MailAddress adminAddress = new MailAddress(Properties.Settings.Default.AdminEmail);
- message.CC.Add(adminAddress);
- try
- {
- mailer.Send(message);
- }
- catch (SmtpException smtpException)
- {
- log.ErrorFormat("SMTP error while sending e-mail:{0}", smtpException.Message);
- }
- catch (Exception ex)
- {
- log.ErrorFormat("other error while sending e-mail:{0}", ex.Message);
+ message.To.Add(recipient);
+ MailAddress adminAddress = new MailAddress(Properties.Settings.Default.AdminEmail);
+ message.CC.Add(adminAddress);
+ try
+ {
+ mailer.Send(message);
+ }
+ catch (SmtpException smtpException)
+ {
+ log.ErrorFormat("SMTP error while sending e-mail:{0}", smtpException.Message);
+ }
+ catch (Exception ex)
+ {
+ log.ErrorFormat("other error while sending e-mail:{0}", ex.Message);
+ }
}
}