Merge branch 'feature/fix_core_delete_tool' into develop

This commit is contained in:
Daniel Schick 2022-07-18 07:16:04 +02:00
commit 1032766317
7 changed files with 33 additions and 7 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

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