Merge branch 'feature/fix_core_delete_tool' into develop
This commit is contained in:
commit
1032766317
@ -6,7 +6,7 @@
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
|
||||
</startup>
|
||||
<userSettings>
|
||||
<CoreDeleteTool.Properties.Settings>
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CoreDeleteTool</RootNamespace>
|
||||
<AssemblyName>CoreDeleteTool</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<TargetFrameworkProfile />
|
||||
@ -80,6 +80,7 @@
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
|
||||
@ -8,7 +8,8 @@ namespace CoreDeleteTool
|
||||
{
|
||||
public partial class Main : Form
|
||||
{
|
||||
SortableBindingList<MessageCore> messageCores = new SortableBindingList<MessageCore>();
|
||||
|
||||
private readonly SortableBindingList<MessageCore> messageCores = new SortableBindingList<MessageCore>();
|
||||
|
||||
public Main()
|
||||
{
|
||||
@ -49,8 +50,7 @@ namespace CoreDeleteTool
|
||||
|
||||
for (int i = 0; i < this.dataGridView.SelectedRows.Count; i++)
|
||||
{
|
||||
MessageCore selectedCore = this.dataGridView.SelectedRows[i].DataBoundItem as MessageCore;
|
||||
if (selectedCore != null)
|
||||
if (this.dataGridView.SelectedRows[i].DataBoundItem is MessageCore selectedCore)
|
||||
{
|
||||
DBManager.Instance.DeleteCore(selectedCore);
|
||||
this.messageCores.Remove(selectedCore);
|
||||
|
||||
2
CoreDeleteTool/Properties/Resources.Designer.cs
generated
2
CoreDeleteTool/Properties/Resources.Designer.cs
generated
@ -19,7 +19,7 @@ namespace CoreDeleteTool.Properties {
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// 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.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
2
CoreDeleteTool/Properties/Settings.Designer.cs
generated
2
CoreDeleteTool/Properties/Settings.Designer.cs
generated
@ -12,7 +12,7 @@ namespace CoreDeleteTool.Properties {
|
||||
|
||||
|
||||
[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 {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
BIN
CoreDeleteTool/application_delete.ico
Normal file
BIN
CoreDeleteTool/application_delete.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 95 KiB |
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user