Version 3.8.3 mit einem ganzen Haufen Korrekturen und Verbesserungen

This commit is contained in:
Daniel Schick 2017-11-12 19:00:04 +00:00
parent fc92303439
commit 24f52940ba
45 changed files with 365 additions and 63 deletions

View File

@ -248,14 +248,21 @@
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textStatusInfo}" Binding="{Binding StatusInfo}" IsReadOnly="True" Width="0.3*">
<DataGridTextColumn Header="{x:Static p:Resources.textSentBy}" Binding="{Binding SentBy}" IsReadOnly="True" Width="0.1*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textChangedBy}" Binding="{Binding ChangedBy}" IsReadOnly="True" Width="0.3*">
<DataGridTextColumn Header="{x:Static p:Resources.textStatusInfo}" Binding="{Binding StatusInfo}" IsReadOnly="True" Width="0.2*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textChangedBy}" Binding="{Binding ChangedBy}" IsReadOnly="True" Width="0.2*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>

View File

@ -36,7 +36,7 @@
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>3.8.2.%2a</ApplicationVersion>
<ApplicationVersion>3.8.3.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted>
@ -93,8 +93,8 @@
<SignManifests>true</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="ExcelDataReader, Version=3.1.0.0, Culture=neutral, PublicKeyToken=93517dbe6a4012fa, processorArchitecture=MSIL">
<HintPath>packages\ExcelDataReader.3.1.0\lib\net45\ExcelDataReader.dll</HintPath>
<Reference Include="ExcelDataReader, Version=3.2.0.0, Culture=neutral, PublicKeyToken=93517dbe6a4012fa, processorArchitecture=MSIL">
<HintPath>packages\ExcelDataReader.3.2.0\lib\net45\ExcelDataReader.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
@ -103,11 +103,12 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Data.SQLite, Version=1.0.105.2, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>packages\System.Data.SQLite.Core.1.0.105.2\lib\net451\System.Data.SQLite.dll</HintPath>
<Reference Include="System.Data.SQLite, Version=1.0.106.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>packages\System.Data.SQLite.Core.1.0.106.0\lib\net451\System.Data.SQLite.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.ServiceModel.Web" />
@ -123,28 +124,28 @@
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="Xceed.Wpf.AvalonDock, Version=3.1.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.3.1\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
<Reference Include="Xceed.Wpf.AvalonDock, Version=3.2.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.3.2.0\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=3.1.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.3.1\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=3.2.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.3.2.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=3.1.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.3.1\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=3.2.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.3.2.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=3.1.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.3.1\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=3.2.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.3.2.0\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xceed.Wpf.DataGrid, Version=3.1.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.3.1\lib\net40\Xceed.Wpf.DataGrid.dll</HintPath>
<Reference Include="Xceed.Wpf.DataGrid, Version=3.2.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.3.2.0\lib\net40\Xceed.Wpf.DataGrid.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit, Version=3.1.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.3.1\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
<Reference Include="Xceed.Wpf.Toolkit, Version=3.2.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<HintPath>packages\Extended.Wpf.Toolkit.3.2.0\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
@ -337,6 +338,7 @@
<Compile Include="Util\HighlightService.cs" />
<Compile Include="Util\InverseBooleanConverter.cs" />
<Compile Include="Util\NullImageConverter.cs" />
<Compile Include="Util\UIHelper.cs" />
<Compile Include="Util\UtcToLocalDateTimeConverter.cs" />
<Compile Include="Util\ValidationContext.cs" />
<Compile Include="VorgaengeControl.xaml.cs">
@ -786,12 +788,12 @@
<WCFMetadataStorage Include="Service References\LockingServiceReference\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="packages\System.Data.SQLite.Core.1.0.105.2\build\net451\System.Data.SQLite.Core.targets" Condition="Exists('packages\System.Data.SQLite.Core.1.0.105.2\build\net451\System.Data.SQLite.Core.targets')" />
<Import Project="packages\System.Data.SQLite.Core.1.0.106.0\build\net451\System.Data.SQLite.Core.targets" Condition="Exists('packages\System.Data.SQLite.Core.1.0.106.0\build\net451\System.Data.SQLite.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('packages\System.Data.SQLite.Core.1.0.105.2\build\net451\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\System.Data.SQLite.Core.1.0.105.2\build\net451\System.Data.SQLite.Core.targets'))" />
<Error Condition="!Exists('packages\System.Data.SQLite.Core.1.0.106.0\build\net451\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\System.Data.SQLite.Core.1.0.106.0\build\net451\System.Data.SQLite.Core.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@ -3704,6 +3704,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Sent by.
/// </summary>
public static string textSentBy {
get {
return ResourceManager.GetString("textSentBy", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Ship services.
/// </summary>

View File

@ -1582,4 +1582,7 @@
<data name="document_pdf" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\document_pdf.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="textSentBy" xml:space="preserve">
<value>Sent by</value>
</data>
</root>

View File

@ -86,6 +86,9 @@ namespace ENI2
if ((expectedResultNum ?? 0) > 100)
resultLimit = 100;
Util.UIHelper.SetBusyState();
// suche auslösen
this.anmeldungen = DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).GetMessageCoresWithFilters(filterDict, resultLimit);
@ -152,6 +155,7 @@ namespace ENI2
{
if ((this.MessageCoreSelected != null) && (aMessageCore != null))
{
Util.UIHelper.SetBusyState();
this.MessageCoreSelected(aMessageCore);
}
}

View File

@ -0,0 +1,49 @@
// Copyright (c) 2017 schick Informatik
// Description: Extra methods needed sometimes. Das WaitCursor (fire- and forget) Verfahren gefällt mir sehr gut, ich hoffe
// es funktioniert unter den meisten Umständen ;-) Idee von hier:
// https://stackoverflow.com/a/7482321
using System;
using System.Windows;
using System.Windows.Input;
using System.Windows.Threading;
namespace ENI2.Util
{
public static class UIHelper
{
private static bool isBusy;
public static void SetBusyState()
{
SetBusyState(true);
}
private static void SetBusyState(bool busy)
{
if(busy != isBusy)
{
isBusy = busy;
Mouse.OverrideCursor = isBusy ? Cursors.Wait : null;
}
if(isBusy)
{
new DispatcherTimer(TimeSpan.FromSeconds(0), DispatcherPriority.ApplicationIdle, dispatcherTimer_Tick, Application.Current.Dispatcher);
}
}
private static void dispatcherTimer_Tick(object sender, EventArgs e)
{
DispatcherTimer timer = sender as DispatcherTimer;
if(timer != null)
{
SetBusyState(false);
timer.Stop();
}
}
}
}

View File

@ -3,8 +3,8 @@
Sample license text.
-->
<packages>
<package id="ExcelDataReader" version="3.1.0" targetFramework="net452" />
<package id="Extended.Wpf.Toolkit" version="3.1" targetFramework="net452" />
<package id="ExcelDataReader" version="3.2.0" targetFramework="net452" />
<package id="Extended.Wpf.Toolkit" version="3.2.0" targetFramework="net452" />
<package id="log4net" version="2.0.8" targetFramework="net452" />
<package id="System.Data.SQLite.Core" version="1.0.105.2" targetFramework="net452" />
<package id="System.Data.SQLite.Core" version="1.0.106.0" targetFramework="net452" />
</packages>

Binary file not shown.

View File

@ -206,6 +206,11 @@ namespace SendNSWMessageService
{
message.ChangedBy = ""; // Leeren nach RS mit CH: Sie möchte das Feld als Indikator "zu versenden" verwenden (ich war dagegen ;-)
message.InternalStatus = Message.BSMDStatus.SENT;
if(message.ReportingPartyId.HasValue && DBManager.Instance.GetReportingPartyDict().ContainsKey(message.ReportingPartyId.Value))
{
bsmd.database.ReportingParty rp = DBManager.Instance.GetReportingPartyDict()[message.ReportingPartyId.Value];
message.SentBy = rp.Logon;
}
}
else
{

View File

@ -232,6 +232,30 @@ namespace bsmd.ReportGenerator
#endregion
#region Label DB
static List<KeyValuePair<string, string>> ReplaceLabels(List<KeyValuePair<string, string>> messageText)
{
List<KeyValuePair<string, string>> result = new List<KeyValuePair<string, string>>();
foreach(KeyValuePair<string, string> field in messageText)
{
if (LabelStorage.FieldLabelDict.ContainsKey(field.Key))
result.Add(new KeyValuePair<string, string>(LabelStorage.FieldLabelDict[field.Key], field.Value));
else
result.Add(field);
}
return result;
}
static string ReplaceTitle(string title)
{
if (LabelStorage.CollectionLabelDict.ContainsKey(title))
return LabelStorage.CollectionLabelDict[title];
return title;
}
#endregion
#region "Neuer" EUREPORT Header Block für Einzelnachrichten
internal static void DefineSingleHeader(Document document, Dictionary<string, string> coverInfos, ReportingParty rp)
@ -245,7 +269,7 @@ namespace bsmd.ReportGenerator
table.Borders.Width = 0.25;
// Define Colums
Column col = table.AddColumn(80); // die Bildspalte
Column col = table.AddColumn(90); // die Bildspalte
col.Format.Alignment = ParagraphAlignment.Center;
col = table.AddColumn(70);
@ -321,7 +345,7 @@ namespace bsmd.ReportGenerator
section.PageSetup.OddAndEvenPagesHeaderFooter = false;
section.PageSetup.Orientation = Orientation.Portrait;
HeaderFooter header = section.Headers.Primary;
header.AddParagraph(string.Format("EUREPORT - created {0}", DateTime.Now.ToString()));
header.AddParagraph(string.Format("Bremer Schiffsmeldedienst - created {0}", DateTime.Now.ToString()));
Paragraph paragraph = new Paragraph();
paragraph.AddTab();
@ -369,14 +393,15 @@ namespace bsmd.ReportGenerator
{
Message message = messageParagraph as Message;
// Einzelne Seite in Landscape für CREW Meldung
#region Einzelne Seite in Landscape für CREW Meldung
if ((message != null) && (message.MessageNotificationClass == Message.NotificationClass.CREW))
{
// Landscape!
BSMDDocument.DefineContentSection(document, Orientation.Landscape, false);
document.LastSection.AddParagraph(messageParagraph.Title, "Heading2");
document.LastSection.AddParagraph(messageParagraph.Subtitle, "Heading3");
document.LastSection.AddParagraph(BSMDDocument.ReplaceTitle(messageParagraph.Title), "Heading2");
document.LastSection.AddParagraph(BSMDDocument.ReplaceTitle(messageParagraph.Subtitle), "Heading3");
BSMDDocument.CreateCrewTable(document, message);
@ -384,14 +409,17 @@ namespace bsmd.ReportGenerator
return;
}
// Einzelne Seite in Landscape für PAS Meldung
#endregion
#region Einzelne Seite in Landscape für PAS Meldung
if ((message != null) && (message.MessageNotificationClass == Message.NotificationClass.PAS))
{
// Landscape!
BSMDDocument.DefineContentSection(document, Orientation.Landscape, false);
document.LastSection.AddParagraph(messageParagraph.Title, "Heading2");
document.LastSection.AddParagraph(messageParagraph.Subtitle, "Heading3");
document.LastSection.AddParagraph(BSMDDocument.ReplaceTitle(messageParagraph.Title), "Heading2");
document.LastSection.AddParagraph(BSMDDocument.ReplaceTitle(messageParagraph.Subtitle), "Heading3");
BSMDDocument.CreatePassengerTable(document, message);
@ -399,36 +427,55 @@ namespace bsmd.ReportGenerator
return;
}
document.LastSection.AddParagraph(messageParagraph.Title, "Heading2");
document.LastSection.AddParagraph(messageParagraph.Subtitle, "Heading3");
#endregion
document.LastSection.AddParagraph(BSMDDocument.ReplaceTitle(messageParagraph.Title), "Heading2");
document.LastSection.AddParagraph(BSMDDocument.ReplaceTitle(messageParagraph.Subtitle), "Heading3");
#region Spezialbehandlung WAS Meldung
// Spezialbehandlung WAS Meldung
if ((message != null) && (message.MessageNotificationClass == Message.NotificationClass.WAS))
{
BSMDDocument.CreateWASTable(document, message);
return;
}
#endregion
#region BKRD
if((message != null) && (message.MessageNotificationClass == Message.NotificationClass.BKRD))
{
BSMDDocument.CreateBKRDTable(document, message);
return;
}
#endregion
#region BKRA
if ((message != null) && (message.MessageNotificationClass == Message.NotificationClass.BKRA))
{
BSMDDocument.CreateBKRATable(document, message);
return;
}
#endregion
#region LADG
if((message != null) && (message.MessageNotificationClass == Message.NotificationClass.LADG))
{
BSMDDocument.CreateLADGTable(document, message);
return;
}
#endregion
if (messageParagraph.MessageText != null) // komplette Nachricht (z.B. STAT)
BSMDDocument.AddActualTableParagraph(document, messageParagraph.MessageText, false);
BSMDDocument.AddActualTableParagraph(document, BSMDDocument.ReplaceLabels(messageParagraph.MessageText), false);
#region SEC
if((message != null) && (message.MessageNotificationClass == Message.NotificationClass.SEC))
{
@ -436,19 +483,30 @@ namespace bsmd.ReportGenerator
return;
}
#endregion
#region MDH
if((message != null) && (message.MessageNotificationClass == Message.NotificationClass.MDH))
{
BSMDDocument.CreatePoCLast30DaysTable(document, message);
return;
}
if (messageParagraph.ChildParagraphs != null) // 1:n message (CREW, PAS,..)
#endregion
#region Child paragraphs (1:n message CREW, PAS,..)
if (messageParagraph.ChildParagraphs != null)
{
foreach (IMessageParagraph childParagraph in messageParagraph.ChildParagraphs)
{
BSMDDocument.AddActualTableParagraph(document, childParagraph.MessageText, true);
BSMDDocument.AddActualTableParagraph(document, BSMDDocument.ReplaceLabels(childParagraph.MessageText), true);
}
}
#endregion
}
#region CREW
@ -925,11 +983,10 @@ namespace bsmd.ReportGenerator
private static void AddActualTableParagraph(Document document, List<KeyValuePair<string, string>> messageText, bool isSubTable)
{
Table table = document.LastSection.AddTable();
table.Borders.Color = Colors.LightGray;
// table.LeftPadding = new Unit(0.5, UnitType.Centimeter);
Column leadColumn = table.AddColumn(200);
leadColumn.Format.Alignment = ParagraphAlignment.Left;

View File

@ -0,0 +1,80 @@
// Copyright (c) 2015-2017 schick Informatik
// Zugriff auf SQLite Datenbank mit Report Überschriften
using System.Collections.Generic;
using System.Data;
using System.Data.SQLite;
namespace bsmd.ReportGenerator
{
/// <summary>
/// Zugriff auf SQLite Datenbank mit Report Überschriften
/// </summary>
public class LabelStorage
{
private static SQLiteConnection _con;
private const string _locode_DB_NAME = "report.db";
private static Dictionary<string, string> _collectionLabelDict = null;
private static Dictionary<string, string> _fieldLabelDict = null;
static LabelStorage()
{
_con = new SQLiteConnection(string.Format("data source={0}; Version=3;", _locode_DB_NAME));
_con.Open();
}
#region public static properties
public static Dictionary<string, string> CollectionLabelDict
{
get
{
if(_collectionLabelDict == null)
{
_collectionLabelDict = new Dictionary<string, string>();
string query = "SELECT Name, Value FROM CollectionLabel";
SQLiteCommand cmd = new SQLiteCommand(query, _con);
IDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
if (!reader.IsDBNull(0) && !reader.IsDBNull(1))
_collectionLabelDict[reader.GetString(0)] = reader.GetString(1);
}
reader.Close();
}
return _collectionLabelDict;
}
}
public static Dictionary<string, string> FieldLabelDict
{
get
{
if (_fieldLabelDict == null)
{
_fieldLabelDict = new Dictionary<string, string>();
string query = "SELECT Name, Value FROM FieldLabel";
SQLiteCommand cmd = new SQLiteCommand(query, _con);
IDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
if (!reader.IsDBNull(0) && !reader.IsDBNull(1))
_fieldLabelDict[reader.GetString(0)] = reader.GetString(1);
}
reader.Close();
}
return _fieldLabelDict;
}
}
public static void CloseDB()
{
_con.Close();
}
#endregion
}
}

View File

@ -225,6 +225,8 @@ namespace bsmd.ReportGenerator
}
}
#endregion
#region create (and send) "single" report (a report per message class)
internal void CreateSingleReport(MessageCore reportCore)
@ -243,7 +245,7 @@ namespace bsmd.ReportGenerator
aMessage.InternalStatus = Message.BSMDStatus.PREPARE;
DBManager.Instance.Save(aMessage);
sb.Append(aMessage.MessageNotificationClassDisplay);
sb.Append(" ");
sb.Append("_");
if (aMessage.ReportingPartyId.HasValue)
reportingPartyId = aMessage.ReportingPartyId.Value;
}
@ -274,14 +276,17 @@ namespace bsmd.ReportGenerator
}
// prepare and send E-Mail with generated attachment
string fullPath = string.Format("{0}\\{1}.pdf", Properties.Settings.Default.OutputDirectory, reportCore.Id);
// Schiffsname_ID_Meldeklassen.pdf
string shipName = DBManager.Instance.GetShipNameFromCore(reportCore);
shipName = shipName.Replace(' ', '_');
string fullPath = string.Format("{0}\\{1}_{2}_{3}.pdf", Properties.Settings.Default.OutputDirectory, shipName, reportCore.DisplayId, classes);
BSMDDocument.RenderDocument(migraDocument, fullPath);
_log.InfoFormat("Document created for MessageCoreId {0}, IMO {1}", reportCore.Id, reportCore.IMO);
List<string> attachments = new List<string>();
attachments.Add(fullPath);
BSMDMail.SendNSWReportWithAttachments(subject, attachments, rp.EMail);
// BSMDMail.SendNSWReportWithAttachments(subject, attachments, rp.EMail);
// remove
if (Properties.Settings.Default.DeleteFileAfterSend)
@ -313,7 +318,5 @@ namespace bsmd.ReportGenerator
#endregion
#endregion
}
}

View File

@ -13,6 +13,8 @@
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@ -63,6 +65,10 @@
<Reference Include="System" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Core" />
<Reference Include="System.Data.SQLite, Version=1.0.106.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\System.Data.SQLite.Core.1.0.106.0\lib\net45\System.Data.SQLite.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Management" />
<Reference Include="System.Xml.Linq" />
@ -85,6 +91,7 @@
<Compile Include="ANSWMessageComparer.cs" />
<Compile Include="BSMDDocument.cs" />
<Compile Include="CrewPasHelper.cs" />
<Compile Include="LabelStorage.cs" />
<Compile Include="ProjectInstaller.cs">
<SubType>Component</SubType>
</Compile>
@ -106,7 +113,13 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="..\misc\report.db">
<Link>report.db</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
<None Include="..\bsmdKey.snk" />
<None Include="bsmd.ReportGenerator.licenseheader" />
<None Include="packages.config" />
@ -138,6 +151,13 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Import Project="..\packages\System.Data.SQLite.Core.1.0.106.0\build\net45\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.106.0\build\net45\System.Data.SQLite.Core.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.106.0\build\net45\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.106.0\build\net45\System.Data.SQLite.Core.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

View File

@ -2,4 +2,5 @@
<packages>
<package id="log4net" version="2.0.8" targetFramework="net45" />
<package id="PDFsharp-MigraDoc-GDI" version="1.32.4334.0" targetFramework="net45" />
<package id="System.Data.SQLite.Core" version="1.0.106.0" targetFramework="net45" />
</packages>

View File

@ -37,6 +37,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "bkra"; } }
#endregion
#region DatabaseEntity implementation

View File

@ -37,6 +37,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "bkrd"; } }
#endregion
#region DatabaseEntity implementation

View File

@ -109,6 +109,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "crew"; } }
public static Dictionary<string, string> NationalityDict { get; set; }
#endregion

View File

@ -37,6 +37,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "callpurpose"; } }
#endregion
#region DatabaseEntity implementation

View File

@ -74,6 +74,11 @@ namespace bsmd.database
/// </summary>
public bool IsNew { get { return !this.id.HasValue; } }
/// <summary>
/// Flag zeigt an ob das Objekt geändert wurde
/// </summary>
public bool IsDirty { get; set; }
#endregion
#region public funcs

View File

@ -146,6 +146,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "ibc"; } }
#endregion
#region DatabaseEntity implementation

View File

@ -72,6 +72,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "igc"; } }
#endregion
#region DatabaseEntity implementation

View File

@ -259,6 +259,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "imdg"; } }
#endregion
#region DatabaseEntity implementation

View File

@ -77,6 +77,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "imsbc"; } }
#endregion
#region DatabaseEntity implementation

View File

@ -39,6 +39,14 @@ namespace bsmd.database
/// </summary>
public interface ISublistElement
{
/// <summary>
/// Mit diesem Schlüssel kann bei einem Report die richtige Beschriftung aus der SQLite Tabelle geholt werden
/// </summary>
string SublistCollectionKey { get; }
/// <summary>
/// Der "eindeutige" Schlüssel des Listenelements. Hier steht immer eine als String serialiserte Zahl drin
/// </summary>
string Identifier { get; set; }
}

View File

@ -37,6 +37,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "infectedarea"; } }
#endregion
#region abstract class implementation

View File

@ -110,6 +110,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "ladg"; } }
public static Dictionary<int, string> LACodes { get; set; }
public static Dictionary<string, string> CargoCodesNST { get; set; }

View File

@ -69,6 +69,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "l10pfc"; } }
#endregion
#region DatabaseEntity implementation

View File

@ -82,6 +82,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "marpol"; } }
#endregion
#region DatabaseEntity implementation

View File

@ -208,6 +208,8 @@ namespace bsmd.database
public DateTime? SentAt { get; set; }
public string SentBy { get; set; }
public DateTime? ReceivedAt { get; set; }
public DateTime? RequestedAt { get; set; }
@ -314,11 +316,6 @@ namespace bsmd.database
/// </summary>
public string ENINotificationIconString { get; set; }
/// <summary>
/// Flag zeigt an ob die Meldeklasse (oder ein untergeordnetes Objekt) geändert wurde
/// </summary>
public bool IsDirty { get; set; }
/// <summary>
/// ENI Display flag
/// </summary>
@ -412,13 +409,14 @@ namespace bsmd.database
cmd.Parameters.AddWithNullableValue("@CHANGEDBY", this.ChangedBy);
cmd.Parameters.AddWithNullableValue("@STATUSINFO", this.StatusInfo);
cmd.Parameters.AddWithNullableValue("@SENDSUCCESS", this.SendSuccess);
cmd.Parameters.AddWithNullableValue("@SENTBY", this.SentBy);
if (this.IsNew)
{
this.CreateId();
cmd.Parameters.AddWithValue("@ID", this.Id);
string query = string.Format("INSERT INTO {0} (Id, ClientRequestId, MessageCoreId, MessageId, SentAt, ReceivedAt, RequestedAt, NotificationClass, Reset, Cancel, Status, ReportingPartyId, BSMDStatus, HIS, CreatedBy, ChangedBy, StatusInfo, SendSuccess) " +
"VALUES (@ID, @CLIENTREQUESTID, @MESSAGECOREID, @MESSAGEID, @SENTAT, @RECEIVEDAT, @REQUESTEDAT, @NOTIFICATIONCLASS, @RESET, @CANCEL, @STATUS, @REPORTINGPARTYID, @BSMDSTATUS, @HIS, @CREATEDBY, @CHANGEDBY, @STATUSINFO, @SENDSUCCESS)",
string query = string.Format("INSERT INTO {0} (Id, ClientRequestId, MessageCoreId, MessageId, SentAt, ReceivedAt, RequestedAt, NotificationClass, Reset, Cancel, Status, ReportingPartyId, BSMDStatus, HIS, CreatedBy, ChangedBy, StatusInfo, SendSuccess, SentBy) " +
"VALUES (@ID, @CLIENTREQUESTID, @MESSAGECOREID, @MESSAGEID, @SENTAT, @RECEIVEDAT, @REQUESTEDAT, @NOTIFICATIONCLASS, @RESET, @CANCEL, @STATUS, @REPORTINGPARTYID, @BSMDSTATUS, @HIS, @CREATEDBY, @CHANGEDBY, @STATUSINFO, @SENDSUCCESS, @SENTBY)",
this.Tablename);
cmd.CommandText = query;
}
@ -427,7 +425,7 @@ namespace bsmd.database
cmd.Parameters.AddWithValue("@ID", this.Id);
cmd.CommandText = string.Format("UPDATE {0} SET ClientRequestId = @CLIENTREQUESTID, MessageId = @MESSAGEID, SentAt = @SENTAT, ReceivedAt = @RECEIVEDAT, RequestedAt = @REQUESTEDAT, " +
"NotificationClass = @NOTIFICATIONCLASS, Reset = @RESET, Cancel = @CANCEL, Status = @STATUS, ReportingPartyId = @REPORTINGPARTYID, BSMDStatus = @BSMDSTATUS, HIS = @HIS, " +
"CreatedBy = @CREATEDBY, ChangedBy = @CHANGEDBY, StatusInfo = @STATUSINFO, SendSuccess = @SENDSUCCESS WHERE Id = @ID", this.Tablename);
"CreatedBy = @CREATEDBY, ChangedBy = @CHANGEDBY, StatusInfo = @STATUSINFO, SendSuccess = @SENDSUCCESS, SentBy = @SENTBY WHERE Id = @ID", this.Tablename);
}
}
@ -435,7 +433,7 @@ namespace bsmd.database
public override void PrepareLoadCommand(IDbCommand cmd, LoadFilter filter, params object[] criteria )
{
string query = string.Format("SELECT Id, ClientRequestId, MessageCoreId, MessageId, SentAt, ReceivedAt, RequestedAt, NotificationClass, " +
"Reset, Cancel, Status, ReportingPartyId, BSMDStatus, HIS, Created, CreatedBy, ChangedBy, Changed, StatusInfo, SendSuccess FROM {0} ", this.Tablename);
"Reset, Cancel, Status, ReportingPartyId, BSMDStatus, HIS, Created, CreatedBy, ChangedBy, Changed, StatusInfo, SendSuccess, SentBy FROM {0} ", this.Tablename);
switch (filter)
{
@ -522,6 +520,7 @@ namespace bsmd.database
if (!reader.IsDBNull(17)) msg.changed = reader.GetDateTime(17);
if (!reader.IsDBNull(18)) msg.StatusInfo = reader.GetString(18);
if (!reader.IsDBNull(19)) msg.SendSuccess = reader.GetBoolean(19);
if (!reader.IsDBNull(20)) msg.SentBy = reader.GetString(20);
result.Add(msg);
}
reader.Close();

View File

@ -118,6 +118,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "pas"; } }
[ENI2Validation]
public bool IsDeparture { get; set; }

View File

@ -48,6 +48,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "pocl30d"; } }
/// <summary>
/// Hilfsproperty, um eine kommaseparierte Liste von Crew (analog ANSW) im ENI-2 anzuzeigen,
/// </summary>

View File

@ -34,6 +34,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "pocl30dcjs"; } }
#endregion
#region abstract class implementation

View File

@ -43,6 +43,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "poi"; } }
#endregion
#region DatabaseEntity implementation

View File

@ -2,6 +2,6 @@
[assembly: AssemblyCompany("schick Informatik")]
[assembly: AssemblyProduct("BSMD NSW interface")]
[assembly: AssemblyInformationalVersion("3.8.2")]
[assembly: AssemblyInformationalVersion("3.8.3")]
[assembly: AssemblyCopyright("Copyright © 2014-2017 schick Informatik")]
[assembly: AssemblyTrademark("")]

View File

@ -1,4 +1,4 @@
using System.Reflection;
[assembly: AssemblyVersion("3.8.2.*")]
[assembly: AssemblyVersion("3.8.3.*")]

View File

@ -45,6 +45,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "serv"; } }
public override string Subtitle
{
get

View File

@ -34,6 +34,8 @@ namespace bsmd.database
/// </summary>
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "sto"; } }
[LookupName("STO.Name")]
[MaxLength(255)]
[ENI2Validation]

View File

@ -43,6 +43,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "smd"; } }
#endregion
#region abstract class implementation

View File

@ -71,6 +71,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "s2s"; } }
#endregion
#region DatabaseEntity implementation

View File

@ -34,6 +34,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "stowaways"; } }
#endregion
#region abstract class implementation

View File

@ -33,6 +33,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "subsidiaryrisks"; } }
#endregion
#region DatabaseEntity implementation

View File

@ -109,6 +109,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "towa"; } }
public override string Subtitle
{
get

View File

@ -95,6 +95,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "towd"; } }
public override string Subtitle
{
get

View File

@ -120,6 +120,8 @@ namespace bsmd.database
public string Identifier { get; set; }
public string SublistCollectionKey { get { return "waste"; } }
#endregion
#region DatabaseEntity implementation

BIN
nsw/Source/misc/report.db Normal file

Binary file not shown.