C2024-016-Write-Info-to-Results-Window-Delete-Annotations

This commit is contained in:
Paul Larsen 2024-07-26 09:20:50 -04:00
parent 10ecad47b2
commit ff940005f9
5 changed files with 365 additions and 6 deletions

View File

@ -223,6 +223,12 @@
<Compile Include="dlgUCFDetail.Designer.cs">
<DependentUpon>dlgUCFDetail.cs</DependentUpon>
</Compile>
<Compile Include="frmAnnotationResults.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmAnnotationResults.Designer.cs">
<DependentUpon>frmAnnotationResults.cs</DependentUpon>
</Compile>
<Compile Include="frmAnnotationsCleanup.cs">
<SubType>Form</SubType>
</Compile>
@ -340,6 +346,9 @@
<EmbeddedResource Include="dlgUCFDetail.resx">
<DependentUpon>dlgUCFDetail.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmAnnotationResults.resx">
<DependentUpon>frmAnnotationResults.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmAnnotationsCleanup.resx">
<DependentUpon>frmAnnotationsCleanup.cs</DependentUpon>
</EmbeddedResource>
@ -626,4 +635,4 @@
<PropertyGroup>
<PreBuildEvent>cmd /c "$(ProjectDir)FixRev.bat"</PreBuildEvent>
</PropertyGroup>
</Project>
</Project>

View File

@ -0,0 +1,158 @@

namespace VEPROMS
{
partial class frmAnnotationResults
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.lblAnnotationResults = new System.Windows.Forms.Label();
this.lblResultTotal = new System.Windows.Forms.Label();
this.lblTotal = new System.Windows.Forms.Label();
this.lblType = new System.Windows.Forms.Label();
this.lblTypeTxt = new System.Windows.Forms.Label();
this.lblPlace1 = new System.Windows.Forms.Label();
this.lblPlace1Txt = new System.Windows.Forms.Label();
this.lblPlace2 = new System.Windows.Forms.Label();
this.lblPlace2Txt = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// lblAnnotationResults
//
this.lblAnnotationResults.AutoSize = true;
this.lblAnnotationResults.Location = new System.Drawing.Point(63, 9);
this.lblAnnotationResults.Name = "lblAnnotationResults";
this.lblAnnotationResults.Size = new System.Drawing.Size(138, 13);
this.lblAnnotationResults.TabIndex = 0;
this.lblAnnotationResults.Text = "Annotation Cleanup Results";
this.lblAnnotationResults.Click += new System.EventHandler(this.label1_Click);
//
// lblResultTotal
//
this.lblResultTotal.AutoSize = true;
this.lblResultTotal.Location = new System.Drawing.Point(159, 37);
this.lblResultTotal.Name = "lblResultTotal";
this.lblResultTotal.Size = new System.Drawing.Size(27, 13);
this.lblResultTotal.TabIndex = 1;
this.lblResultTotal.Text = "*****";
//
// lblTotal
//
this.lblTotal.AutoSize = true;
this.lblTotal.Location = new System.Drawing.Point(66, 37);
this.lblTotal.Name = "lblTotal";
this.lblTotal.Size = new System.Drawing.Size(69, 13);
this.lblTotal.TabIndex = 2;
this.lblTotal.Text = "Total remved";
//
// lblType
//
this.lblType.AutoSize = true;
this.lblType.Location = new System.Drawing.Point(66, 60);
this.lblType.Name = "lblType";
this.lblType.Size = new System.Drawing.Size(85, 13);
this.lblType.TabIndex = 3;
this.lblType.Text = "Annotation Type";
//
// lblTypeTxt
//
this.lblTypeTxt.AutoSize = true;
this.lblTypeTxt.Location = new System.Drawing.Point(159, 60);
this.lblTypeTxt.Name = "lblTypeTxt";
this.lblTypeTxt.Size = new System.Drawing.Size(27, 13);
this.lblTypeTxt.TabIndex = 4;
this.lblTypeTxt.Text = "*****";
//
// lblPlace1
//
this.lblPlace1.AutoSize = true;
this.lblPlace1.Location = new System.Drawing.Point(66, 87);
this.lblPlace1.Name = "lblPlace1";
this.lblPlace1.Size = new System.Drawing.Size(43, 13);
this.lblPlace1.TabIndex = 5;
this.lblPlace1.Text = "Place 1";
//
// lblPlace1Txt
//
this.lblPlace1Txt.AutoSize = true;
this.lblPlace1Txt.Location = new System.Drawing.Point(159, 87);
this.lblPlace1Txt.Name = "lblPlace1Txt";
this.lblPlace1Txt.Size = new System.Drawing.Size(27, 13);
this.lblPlace1Txt.TabIndex = 6;
this.lblPlace1Txt.Text = "*****";
//
// lblPlace2
//
this.lblPlace2.AutoSize = true;
this.lblPlace2.Location = new System.Drawing.Point(66, 115);
this.lblPlace2.Name = "lblPlace2";
this.lblPlace2.Size = new System.Drawing.Size(43, 13);
this.lblPlace2.TabIndex = 7;
this.lblPlace2.Text = "Place 2";
//
// lblPlace2Txt
//
this.lblPlace2Txt.AutoSize = true;
this.lblPlace2Txt.Location = new System.Drawing.Point(159, 115);
this.lblPlace2Txt.Name = "lblPlace2Txt";
this.lblPlace2Txt.Size = new System.Drawing.Size(27, 13);
this.lblPlace2Txt.TabIndex = 8;
this.lblPlace2Txt.Text = "*****";
//
// frmAnnotationResults
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(253, 157);
this.Controls.Add(this.lblPlace2Txt);
this.Controls.Add(this.lblPlace2);
this.Controls.Add(this.lblPlace1Txt);
this.Controls.Add(this.lblPlace1);
this.Controls.Add(this.lblTypeTxt);
this.Controls.Add(this.lblType);
this.Controls.Add(this.lblTotal);
this.Controls.Add(this.lblResultTotal);
this.Controls.Add(this.lblAnnotationResults);
this.Name = "frmAnnotationResults";
this.Text = "frmAnnotationResults";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lblAnnotationResults;
private System.Windows.Forms.Label lblResultTotal;
private System.Windows.Forms.Label lblTotal;
private System.Windows.Forms.Label lblType;
private System.Windows.Forms.Label lblTypeTxt;
private System.Windows.Forms.Label lblPlace1;
private System.Windows.Forms.Label lblPlace1Txt;
private System.Windows.Forms.Label lblPlace2;
private System.Windows.Forms.Label lblPlace2Txt;
}
}

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace VEPROMS
{
public partial class frmAnnotationResults : Form
{
public frmAnnotationResults()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
}
}
}

View File

@ -0,0 +1,150 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="lblAnnotationResults.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="lblResultTotal.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="lblTotal.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="lblType.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="lblTypeTxt.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="lblPlace1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="lblPlace1Txt.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="lblPlace2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="lblPlace2Txt.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View File

@ -22,6 +22,7 @@ namespace VEPROMS
string procList = "";
string docvList = "";
int AnnotationTyp;
string AnnotationName = "";
List<ProcedureInfo> pil2 = new List<ProcedureInfo>();
List<DocVersionInfo> dvil2 = new List<DocVersionInfo>();
private frmBatchRefresh mainForm = null;
@ -102,13 +103,25 @@ namespace VEPROMS
// Process used to cleanup annotations "(Proceed?" button)
private void button1_Click(object sender, EventArgs e)
{
TextBox frm2 = mainForm.GettxtProcess();
TextBox frm3 = mainForm.GettxtResults();
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
AnnotationName = System.Convert.ToString(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Value);
frm3.AppendText("Deleting Annotations: Annotation Type: " + '"' + AnnotationName + '"');
int deletecountProc = 0;
int deletecountDocv = 0;
foreach (var p in pil2)
{
if (p.IsProcedure)
{
TextBox frm2 = mainForm.GettxtProcess();
frm2.AppendText(p.DisplayNumber + ' ' + p.DisplayText + Environment.NewLine);
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
//AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
//AnnotationName = System.Convert.ToString(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Value);
//deletecountProc = Annotation.getAnnotationProcCnt(AnnotationTyp, getAnnotationProcItems(p));
deletecountProc = Annotation.getAnnotationProcCnt(AnnotationTyp, p.ItemID.ToString());
frm2.AppendText(Environment.NewLine + p.DisplayNumber + ' ' + p.DisplayText);
//frm3.AppendText(Environment.NewLine + "P: " + p.DisplayNumber + '"' + p.DisplayText + '"' + " Type: " + '"' + AnnotationName + '"' + " count: " + deletecountProc);
frm3.AppendText(Environment.NewLine + "P: " + p.DisplayNumber + '"' + p.DisplayText + '"' + " Delete count: " + deletecountProc);
Annotation.DeleteAnnotationProcByType(AnnotationTyp, p.ItemID.ToString());
lblCountNumber.Text = "0";
}
@ -118,10 +131,14 @@ namespace VEPROMS
{
if (d.IsDocVersion)
{
TextBox frm2 = mainForm.GettxtProcess();
frm2.AppendText(d.ActiveParent.ToString() + Environment.NewLine);
//AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
//AnnotationName = System.Convert.ToString(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Value);
deletecountDocv = Annotation.getAnnotationCountDocv(AnnotationTyp, d.VersionID.ToString());
frm2.AppendText(Environment.NewLine + d.ActiveParent.ToString());
frm3.AppendText(Environment.NewLine + "F: " + '"' + d.ActiveParent.ToString() + '"' + " Delete count: " + deletecountDocv);
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
Annotation.DeleteAnnotationDocvByType(AnnotationTyp, d.VersionID.ToString());
lblCountNumber.Text = "0";
}
}