Merge branch 'release/eni_7.4'

This commit is contained in:
Daniel Schick 2022-09-30 12:11:26 +02:00
commit f68613c48a
15 changed files with 84 additions and 18 deletions

View File

@ -6,7 +6,7 @@
</sectionGroup> </sectionGroup>
</configSections> </configSections>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup> </startup>
<userSettings> <userSettings>
<CoreDeleteTool.Properties.Settings> <CoreDeleteTool.Properties.Settings>

View File

@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CoreDeleteTool</RootNamespace> <RootNamespace>CoreDeleteTool</RootNamespace>
<AssemblyName>CoreDeleteTool</AssemblyName> <AssemblyName>CoreDeleteTool</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
@ -80,6 +80,7 @@
<Compile Include="Properties\Resources.Designer.cs"> <Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon> <DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile> </Compile>
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>

View File

@ -8,7 +8,8 @@ namespace CoreDeleteTool
{ {
public partial class Main : Form public partial class Main : Form
{ {
SortableBindingList<MessageCore> messageCores = new SortableBindingList<MessageCore>();
private readonly SortableBindingList<MessageCore> messageCores = new SortableBindingList<MessageCore>();
public Main() public Main()
{ {
@ -49,8 +50,7 @@ namespace CoreDeleteTool
for (int i = 0; i < this.dataGridView.SelectedRows.Count; i++) for (int i = 0; i < this.dataGridView.SelectedRows.Count; i++)
{ {
MessageCore selectedCore = this.dataGridView.SelectedRows[i].DataBoundItem as MessageCore; if (this.dataGridView.SelectedRows[i].DataBoundItem is MessageCore selectedCore)
if (selectedCore != null)
{ {
DBManager.Instance.DeleteCore(selectedCore); DBManager.Instance.DeleteCore(selectedCore);
this.messageCores.Remove(selectedCore); this.messageCores.Remove(selectedCore);

View File

@ -19,7 +19,7 @@ namespace CoreDeleteTool.Properties {
// class via a tool like ResGen or Visual Studio. // class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen // To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project. // with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources { internal class Resources {

View File

@ -12,7 +12,7 @@ namespace CoreDeleteTool.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

View File

@ -14,6 +14,7 @@ using ENI2.DetailViewControls;
using ENI2.Util; using ENI2.Util;
using ENI2.EditControls; using ENI2.EditControls;
using System.Windows.Input;
namespace ENI2 namespace ENI2
{ {
@ -135,14 +136,31 @@ namespace ENI2
this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textTowage, MessageGroupControlType = typeof(TowageDetailControl), ImagePath = "Resources/ship2.png" }); this._listBoxList.Add(new MessageGroup() { MessageGroupName = Properties.Resources.textTowage, MessageGroupControlType = typeof(TowageDetailControl), ImagePath = "Resources/ship2.png" });
this.listBoxMessages.ItemsSource = this._listBoxList; this.listBoxMessages.ItemsSource = this._listBoxList;
_messages = DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).GetMessagesForCore(Core, DBManager.MessageLoad.ALL); _messages = DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).GetMessagesForCore(Core, DBManager.MessageLoad.ALL);
List<Message> missingMessages = bsmd.database.Util.CreateMessagesForCore(Core, _messages, this.LockedBy); List<Message> missingMessages = bsmd.database.Util.CreateMessagesForCore(Core, _messages, this.LockedBy);
_messages.AddRange(missingMessages); _messages.AddRange(missingMessages);
BindingOperations.EnableCollectionSynchronization(_messages, this.messageListLock); BindingOperations.EnableCollectionSynchronization(_messages, this.messageListLock);
Dispatcher.BeginInvoke((Action)(() => this.listBoxMessages.SelectedIndex = 0)); Dispatcher.BeginInvoke((Action)(() => this.listBoxMessages.SelectedIndex = 0));
RoutedCommand saveCmd = new RoutedCommand();
saveCmd.InputGestures.Add(new KeyGesture(Key.S, ModifierKeys.Control));
CommandBindings.Add(new CommandBinding(saveCmd, this.buttonSave_Click));
RoutedCommand saveAllCmd = new RoutedCommand();
saveAllCmd.InputGestures.Add(new KeyGesture(Key.A, ModifierKeys.Control));
CommandBindings.Add(new CommandBinding(saveAllCmd, this.buttonSaveAll_Click));
RoutedCommand reloadCmd = new RoutedCommand();
reloadCmd.InputGestures.Add(new KeyGesture(Key.R, ModifierKeys.Control));
CommandBindings.Add(new CommandBinding(reloadCmd, this.ShortCutReload));
RoutedCommand validateCmd = new RoutedCommand();
validateCmd.InputGestures.Add(new KeyGesture(Key.F, ModifierKeys.Control));
CommandBindings.Add(new CommandBinding(validateCmd, this.ShortCutValidate));
} }
#endregion #endregion
@ -541,6 +559,16 @@ namespace ENI2
} }
*/ */
private void ShortCutReload(object sender, ExecutedRoutedEventArgs e)
{
this.DetailControl_RequestReload(this.Core.Id.Value);
}
private void ShortCutValidate(object sender, ExecutedRoutedEventArgs e)
{
this.DetailControl_RequestValidate();
}
private void DetailControl_RequestReload(Guid id) private void DetailControl_RequestReload(Guid id)
{ {
/// core und messages neu laden /// core und messages neu laden

View File

@ -36,8 +36,8 @@
<MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion> <MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish> <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage> <WebPage>publish.html</WebPage>
<ApplicationRevision>3</ApplicationRevision> <ApplicationRevision>2</ApplicationRevision>
<ApplicationVersion>7.3.0.3</ApplicationVersion> <ApplicationVersion>7.4.0.2</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut> <CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted> <PublishWizardCompleted>true</PublishWizardCompleted>
@ -84,7 +84,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup /> <PropertyGroup />
<PropertyGroup> <PropertyGroup>
<ManifestCertificateThumbprint>9B5725EAD90F2E06094631407417EB2554E88941</ManifestCertificateThumbprint> <ManifestCertificateThumbprint>62DE8527C377957850DB503DA52FF66F664BD459</ManifestCertificateThumbprint>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<SignManifests>true</SignManifests> <SignManifests>true</SignManifests>

View File

@ -27,11 +27,20 @@ namespace ENI2.Excel
{ {
try try
{ {
// sheet.Columns.ClearFormats();
// sheet.Rows.ClearFormats();
Range usedRange = sheet.UsedRange;
lastUsedRow = usedRange.Rows.Count;
lastUsedColumn = usedRange.Columns.Count;
/*
Range last = sheet.Cells.SpecialCells(XlCellType.xlCellTypeLastCell, Type.Missing); Range last = sheet.Cells.SpecialCells(XlCellType.xlCellTypeLastCell, Type.Missing);
Range range = sheet.get_Range("A1", last); Range range = sheet.get_Range("A1", last);
lastUsedRow = last.Row; lastUsedRow = last.Row;
lastUsedColumn = last.Column; lastUsedColumn = last.Column;
*/
return true; return true;
} }
catch(Exception) catch(Exception)

View File

@ -982,6 +982,9 @@ namespace ENI2.Excel
} }
} }
if (!stat.Flag.IsNullOrEmpty()) stat.Flag = stat.Flag.ToUpper();
if (!stat.PortOfRegistry.IsNullOrEmpty()) stat.PortOfRegistry = stat.PortOfRegistry.ToUpper();
stat.MMSINumber = reader.ReadTextNoWhitespace("STAT.MMSINumber"); stat.MMSINumber = reader.ReadTextNoWhitespace("STAT.MMSINumber");
stat.CallSign = reader.ReadTextNoWhitespace("STAT.CallSign"); stat.CallSign = reader.ReadTextNoWhitespace("STAT.CallSign");
stat.ISMCompanyId = reader.ReadTextNoWhitespace("STAT.ISMCompanyId"); stat.ISMCompanyId = reader.ReadTextNoWhitespace("STAT.ISMCompanyId");

View File

@ -135,7 +135,7 @@ namespace ENI2
{ {
Dispatcher.BeginInvoke((Action)(() => this.mainFrame.SelectedItem = openTabs[aMessageCore.Id.Value])); Dispatcher.BeginInvoke((Action)(() => this.mainFrame.SelectedItem = openTabs[aMessageCore.Id.Value]));
} }
} }
} }
private void Drc_ReloadCoreRequested(Guid obj) private void Drc_ReloadCoreRequested(Guid obj)

View File

@ -792,6 +792,31 @@ namespace bsmd.database
} }
} }
} }
// Stupid workaround to find HAZA's that are attached to a HAZD message header
if(message.MessageNotificationClass == Message.NotificationClass.HAZD)
{
using (SqlCommand cmd2 = new SqlCommand())
{
DatabaseEntity dummyHAZA = DBManager.CreateMessage(Message.NotificationClass.HAZA);
if (dummyHAZA != null)
{
dummyHAZA.PrepareLoadCommand(cmd2, Message.LoadFilter.MESSAGEHEADER, message.Id);
SqlDataReader reader = this.PerformCommand(cmd2);
if (reader != null)
{
List<DatabaseEntity> statList = dummyHAZA.LoadList(reader);
foreach (DatabaseEntity derivedMessage in statList)
{
message.Elements.Add(derivedMessage);
derivedMessage.MessageHeader = message;
this.LoadDependingLists(derivedMessage);
}
}
}
}
}
} }
} }
} }

View File

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

View File

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

View File

@ -356,11 +356,11 @@ namespace bsmd.database
break; break;
case ValidationCode.PAST_DATE: case ValidationCode.PAST_DATE:
{ {
if (value.Length == 0) errors.Add(RuleEngine.CreateError(ValidationCode.NOT_NULL, property.Name, value, entity.Title, identifier, entity.Tablename)); if (value.Length == 0) violations.Add(RuleEngine.CreateViolation(ValidationCode.NOT_NULL, property.Name, value, entity.Title, identifier, entity.Tablename));
if (DateTime.TryParse(value, out DateTime aTime)) if (DateTime.TryParse(value, out DateTime aTime))
{ {
if (aTime < DateTime.UtcNow) if (aTime < DateTime.UtcNow)
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename)); violations.Add(RuleEngine.CreateViolation(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
} }
} }
break; break;