6.0.9 deployed

This commit is contained in:
Daniel Schick 2020-12-16 20:10:24 +00:00
parent 7ce4a89386
commit 0852b3d47a
10 changed files with 78 additions and 54 deletions

View File

@ -26,12 +26,12 @@
<value>1000</value>
</setting>
<setting name="LockingServerAddress" serializeAs="String">
<!--value>http://192.168.2.24/LockingService/LockingService.svc</value-->
<value>http://heupferd/bsmd.LockingService/LockingService.svc</value>
<value>http://192.168.2.24/LockingService/LockingService.svc</value>
<!--value>http://heupferd/bsmd.LockingService/LockingService.svc</value-->
</setting>
<setting name="ConnectionString" serializeAs="String">
<!--value>Initial Catalog=nsw;Data Source=192.168.2.24\SQLEXPRESS;Uid=dfuser;pwd=dfpasswd;Persist Security Info=False;Connection Reset=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>
<value>Initial Catalog=nsw;Data Source=192.168.2.24\SQLEXPRESS;Uid=dfuser;pwd=dfpasswd;Persist Security Info=False;Connection Reset=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>

View File

@ -35,7 +35,7 @@
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>6.0.8.%2a</ApplicationVersion>
<ApplicationVersion>6.0.9.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted>

View File

@ -17,6 +17,7 @@
<Label Name="statusLabel" HorizontalAlignment="Center" Content="{x:Static p:Resources.textWaitForId}" Background="LemonChiffon"/>
<TextBox IsReadOnly="True" Name="textBoxId" MouseDown="textBoxId_MouseDown" FontWeight="Bold" HorizontalAlignment="Center" VerticalContentAlignment="Center" Margin="2" Grid.Row="1"/>
<Label Name="clickToCopyLabel" Content=" -> click to copy" HorizontalAlignment="Center" Grid.Row="2" MouseDown="textBoxId_MouseDown" Visibility="Hidden"/>
<Button Grid.Row="3" HorizontalAlignment="Right" Content="OK" Margin="2" Width="100" Click="Button_Click" />
<Button Grid.Row="3" HorizontalAlignment="Left" Content="Close and open Id" Margin="2" Width="100" Click="Button_Click_1" />
<Button Grid.Row="3" HorizontalAlignment="Right" Content="Close" Margin="2" Width="100" Click="Button_Click" />
</Grid>
</Window>

View File

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

View File

@ -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();

Binary file not shown.

View File

@ -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<MessageError> errors, List<MessageViolation> 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
}

View File

@ -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<MessageError> errors, List<MessageViolation> 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
}

View File

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

View File

@ -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);
}
}
}