C2025-027-AnnotationsTypeSelect #574

Open
plarsen wants to merge 4 commits from C2025-027-AnnotationsTypeSelect into Development
9 changed files with 58 additions and 252 deletions
Showing only changes of commit 7a0f56cad8 - Show all commits

View File

@ -12,20 +12,19 @@ using VEPROMS.CSLA.Library;
namespace VEPROMS
{
// C2025-027 Annotation Type Filtering
public partial class DlgAnnotationsSelect : Form
public partial class dlgAnnotationsSelect : Form
{
int AnnotationTypeID;
string AnnotationNameStr = "";
//int AnnotationTypeID;
mschill marked this conversation as resolved Outdated

just to check - is there a reason these 2 items (the id and NameStr) are global variables / should stay in memory while the form is open?

It looks like they are only used in 1 function - update?

just to check - is there a reason these 2 items (the id and NameStr) are global variables / should stay in memory while the form is open? It looks like they are only used in 1 function - update?

I moved them

I moved them
//string AnnotationNameStr = "";
public DlgAnnotationsSelect()
public dlgAnnotationsSelect()
{
InitializeComponent();
}
public DlgAnnotationsSelect(string userid)
public dlgAnnotationsSelect(string userid)
{
InitializeComponent();
//MyItemID = pi.ItemID;
UserID = userid;
mschill marked this conversation as resolved
Review

commented out code should be removed or reason given for why it is commented out / should be in the code long term.

commented out code should be removed or reason given for why it is commented out / should be in the code long term.
Review

Removed commented code

Removed commented code
}
@ -97,13 +96,13 @@ namespace VEPROMS
// Save selected list to DB.
private void btnUpdate_Click(object sender, EventArgs e)
{
int AnnotationTypeID;
string AnnotationNameStr = "";

I am not sure what this flag is?
I noticed it will be 1 on 1st iteration then 0 after that.

Can there be comments explaining why?

I am not sure what this flag is? I noticed it will be 1 on 1st iteration then 0 after that. Can there be comments explaining why?

Must be missing something .... Not sure I understand why we are deleting items and reentering them ...... wouldn't we lose history on when they were originally put in if we do that?

Must be missing something .... Not sure I understand why we are deleting items and reentering them ...... wouldn't we lose history on when they were originally put in if we do that?

Delete and reinsert works very well. Updates in this scenario are nightmares.

Delete and reinsert works very well. Updates in this scenario are nightmares.

not sure if this would help --- but just a thought - passing in a whole table of the annotationtypeselections instead of doing 1 update/insert at a time and then doing a merge with the current table?

In the end, as long as Devin and John are good with it, I am too --- just figured I would check in case we were losing any needed info by removing and re-adding...

not sure if this would help --- but just a thought - passing in a whole table of the annotationtypeselections instead of doing 1 update/insert at a time and then doing a merge with the current table? In the end, as long as Devin and John are good with it, I am too --- just figured I would check in case we were losing any needed info by removing and re-adding...
// dltFlg flag is used to notify SQL SP to deleted all the entries for the user before entering the annotation type selections.
int dltFlg = 1;
foreach (AnnotataionItem item in lstSelected.Items.OfType<AnnotataionItem>())
mschill marked this conversation as resolved
Review

just to double check --- Is there a reason we are updating the DisplayMember / ValueMember every time we go through the loop?

Wasn't this already set when the form loaded --- line 160ish?

just to double check --- Is there a reason we are updating the DisplayMember / ValueMember every time we go through the loop? Wasn't this already set when the form loaded --- line 160ish?
Review

I moved the variables

I moved the variables
{
lstSelected.DisplayMember = "NameStr";
lstSelected.ValueMember = "TypeID";
AnnotationTypeID = item.TypeID;
AnnotationNameStr = item.NameStr;

View File

@ -24134,8 +24134,6 @@ CREATE PROC [dbo].[getAnnotationstypeSelections]
@UsrID varchar(50)
)
AS
BEGIN
IF((SELECT count(TypeID) FROM AnnotationTypeSelections WHERE UsrID = @UsrID) > 0)
BEGIN
SELECT [ASTypeID]
,[TypeID]
@ -24148,20 +24146,6 @@ BEGIN
FROM [dbo].[AnnotationTypeSelections]
WHERE UsrID = @UsrID
END
ELSE
BEGIN
SELECT
[TypeID],
[Name],
[Config],
[DTS],
[UserID],
[LastChanged],
(SELECT COUNT(*) FROM [Annotations] WHERE [Annotations].[TypeID]=[AnnotationTypes].[TypeID]) [AnnotationCount],
[IsEPAnnotationType]
FROM [AnnotationTypes]
END
END
GO
-- C2025-027 Annotation Type Filtering
@ -24244,6 +24228,17 @@ CREATE TABLE [dbo].[AnnotationTypeSelections](
[IsEPAnnotationType] [bit] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [idx_AnnotationTypeSelections_Usrid] ON [dbo].[AnnotationTypeSelections]
(
[UsrID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
GO

Should this table have any other indexes?

Would think that there could be a lot of joins by TypeID and User...

Also, what is the difference between:
UsrID
and
UserID?

Should this table have any other indexes? Would think that there could be a lot of joins by TypeID and User... Also, what is the difference between: UsrID and UserID?

UsrID is the id of the PROMS user. Userid is the user id that created the annotation type.

UsrID is the id of the PROMS user. Userid is the user id that created the annotation type.

Added indexes

Added indexes

I would add them as 1 combined index as I don't think you would ever be providing one without the other ----- also, what should the included columns be for the index?

Should there be a unique index for UsrID, TypeID?

Also, should we check if Index exists before we create (i.e. if it already exists will this cause PROMSFixes to error)?

I would add them as 1 combined index as I don't think you would ever be providing one without the other ----- also, what should the included columns be for the index? Should there be a unique index for UsrID, TypeID? Also, should we check if Index exists before we create (i.e. if it already exists will this cause PROMSFixes to error)?

UsrID is the id of the PROMS user. Userid is the user id that created the annotation type.

can we either --- use something else like CreatedBy or add a comment in the SQL.

> UsrID is the id of the PROMS user. Userid is the user id that created the annotation type. can we either --- use something else like CreatedBy or add a comment in the SQL.

I would add them as 1 combined index as I don't think you would ever be providing one without the other ----- also, what should the included columns be for the index?

Should there be a unique index for UsrID, TypeID?

Also, should we check if Index exists before we create (i.e. if it already exists will this cause PROMSFixes to error)?

Would need to figure out what is needed in include columns first (review where selecting from AnnotationTypeSelections and determine/update to be the minimum columns needed) --- but index should be similar to:

CREATE UNIQUE INDEX [idx_AnnotationTypeSelections_UsridTypeID] ON [dbo].[AnnotationTypeSelections]
(
[UsrID] ASC,
[TypeID] ASC
)
INCLUDE (ASTypeID, ...)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]

> I would add them as 1 combined index as I don't think you would ever be providing one without the other ----- also, what should the included columns be for the index? > > Should there be a unique index for UsrID, TypeID? > > Also, should we check if Index exists before we create (i.e. if it already exists will this cause PROMSFixes to error)? Would need to figure out what is needed in include columns first (review where selecting from AnnotationTypeSelections and determine/update to be the minimum columns needed) --- but index should be similar to: CREATE UNIQUE INDEX [idx_AnnotationTypeSelections_UsridTypeID] ON [dbo].[AnnotationTypeSelections] ( [UsrID] ASC, [TypeID] ASC ) INCLUDE (ASTypeID, ...) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
CREATE NONCLUSTERED INDEX [idx_AnnotationTypeSelections_TypeID] ON [dbo].[AnnotationTypeSelections]
(
[TypeID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
GO
IF (@@Error = 0) PRINT 'Running vesp_UpdateEPFormat Succeeded'
ELSE PRINT 'Running vesp_UpdateEPFormat Failed to Execute'

View File

@ -152,11 +152,11 @@
<DependentUpon>AboutVEPROMS.cs</DependentUpon>
</Compile>
<Compile Include="BookMarks.cs" />
<Compile Include="DlgAnnotationsSelect.cs">
<Compile Include="dlgAnnotationsSelect.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="dlgAnnotationsSelect.Designer.cs">
<DependentUpon>DlgAnnotationsSelect.cs</DependentUpon>
<DependentUpon>dlgAnnotationsSelect.cs</DependentUpon>
</Compile>
<Compile Include="dlgApproveProcedure.cs">
<SubType>Form</SubType>
@ -343,10 +343,10 @@
<SubType>Designer</SubType>
<DependentUpon>AboutVEPROMS.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DlgAnnotationsSelect.resx">
<DependentUpon>DlgAnnotationsSelect.cs</DependentUpon>
<EmbeddedResource Include="dlgAnnotationsSelect.resx">
<DependentUpon>dlgAnnotationsSelect.cs</DependentUpon>
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>DlgAnnotationsSelect1.Designer.cs</LastGenOutput>
<LastGenOutput>dlgAnnotationsSelect2.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="dlgMSWordMessage.resx">
<DependentUpon>dlgMSWordMessage.cs</DependentUpon>

View File

@ -1,7 +1,7 @@

namespace VEPROMS
mschill marked this conversation as resolved
Review

Naming/casing should be consistent:
class is:
DlgAnnotationsSelect
but
designer is
dlgAnnotationsSelect?

Naming/casing should be consistent: class is: DlgAnnotationsSelect but designer is dlgAnnotationsSelect?
Review

Fixed

Fixed
{
partial class DlgAnnotationsSelect
partial class dlgAnnotationsSelect
{
/// <summary>
/// Required designer variable.
@ -38,6 +38,7 @@ namespace VEPROMS
this.btnUpdate = new System.Windows.Forms.Button();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.btnCancel = new System.Windows.Forms.Button();
this.lblMessage = new System.Windows.Forms.Label();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
@ -46,11 +47,12 @@ namespace VEPROMS
this.lstUnselected.Dock = System.Windows.Forms.DockStyle.Fill;
this.lstUnselected.FormattingEnabled = true;
this.lstUnselected.IntegralHeight = false;
this.lstUnselected.ItemHeight = 20;
this.lstUnselected.Location = new System.Drawing.Point(3, 3);
this.lstUnselected.Name = "lstUnselected";
this.tableLayoutPanel1.SetRowSpan(this.lstUnselected, 4);
this.lstUnselected.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended;
this.lstUnselected.Size = new System.Drawing.Size(287, 394);
this.lstUnselected.Size = new System.Drawing.Size(287, 359);
this.lstUnselected.TabIndex = 0;
this.lstUnselected.SelectedIndexChanged += new System.EventHandler(this.lst_SelectedIndexChanged);
//
@ -59,18 +61,19 @@ namespace VEPROMS
this.lstSelected.Dock = System.Windows.Forms.DockStyle.Fill;
this.lstSelected.FormattingEnabled = true;
this.lstSelected.IntegralHeight = false;
this.lstSelected.ItemHeight = 20;
this.lstSelected.Location = new System.Drawing.Point(334, 3);
this.lstSelected.Name = "lstSelected";
this.tableLayoutPanel1.SetRowSpan(this.lstSelected, 4);
this.lstSelected.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended;
this.lstSelected.Size = new System.Drawing.Size(288, 394);
this.lstSelected.Size = new System.Drawing.Size(288, 359);
this.lstSelected.TabIndex = 1;
this.lstSelected.SelectedIndexChanged += new System.EventHandler(this.lst_SelectedIndexChanged);
//
// btnSelect
//
this.btnSelect.Anchor = System.Windows.Forms.AnchorStyles.None;
this.btnSelect.Location = new System.Drawing.Point(298, 38);
this.btnSelect.Location = new System.Drawing.Point(298, 34);
this.btnSelect.Name = "btnSelect";
this.btnSelect.Size = new System.Drawing.Size(28, 23);
this.btnSelect.TabIndex = 2;
@ -81,7 +84,7 @@ namespace VEPROMS
// btnSelectAll
//
this.btnSelectAll.Anchor = System.Windows.Forms.AnchorStyles.None;
this.btnSelectAll.Location = new System.Drawing.Point(298, 138);
this.btnSelectAll.Location = new System.Drawing.Point(298, 125);
this.btnSelectAll.Name = "btnSelectAll";
this.btnSelectAll.Size = new System.Drawing.Size(28, 23);
this.btnSelectAll.TabIndex = 3;
@ -92,7 +95,7 @@ namespace VEPROMS
// btnDeselectAll
//
this.btnDeselectAll.Anchor = System.Windows.Forms.AnchorStyles.None;
this.btnDeselectAll.Location = new System.Drawing.Point(298, 238);
this.btnDeselectAll.Location = new System.Drawing.Point(298, 216);
this.btnDeselectAll.Name = "btnDeselectAll";
this.btnDeselectAll.Size = new System.Drawing.Size(28, 23);
this.btnDeselectAll.TabIndex = 5;
@ -103,7 +106,7 @@ namespace VEPROMS
// btnDeselect
//
this.btnDeselect.Anchor = System.Windows.Forms.AnchorStyles.None;
this.btnDeselect.Location = new System.Drawing.Point(298, 338);
this.btnDeselect.Location = new System.Drawing.Point(298, 307);
this.btnDeselect.Name = "btnDeselect";
this.btnDeselect.Size = new System.Drawing.Size(28, 23);
this.btnDeselect.TabIndex = 4;
@ -137,14 +140,14 @@ namespace VEPROMS
this.tableLayoutPanel1.Controls.Add(this.btnDeselectAll, 1, 2);
this.tableLayoutPanel1.Controls.Add(this.btnSelect, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.btnSelectAll, 1, 1);
this.tableLayoutPanel1.Location = new System.Drawing.Point(12, 12);
this.tableLayoutPanel1.Location = new System.Drawing.Point(12, 51);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 4;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(625, 400);
this.tableLayoutPanel1.Size = new System.Drawing.Size(625, 365);
this.tableLayoutPanel1.TabIndex = 6;
//
// btnCancel
@ -157,14 +160,25 @@ namespace VEPROMS
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click_1);
//
// lblMessage
//
this.lblMessage.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblMessage.Location = new System.Drawing.Point(50, 18);
this.lblMessage.Name = "lblMessage";
this.lblMessage.Size = new System.Drawing.Size(317, 28);
this.lblMessage.TabIndex = 10;
this.lblMessage.Text = "Updates will appear when PROMS is restarted.";
//
// DlgAnnotationsSelect
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(653, 466);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.tableLayoutPanel1);
this.Controls.Add(this.btnUpdate);
this.Controls.Add(this.lblMessage);
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "DlgAnnotationsSelect";
this.Text = "Select Annotation Types";
@ -185,6 +199,7 @@ namespace VEPROMS
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Label lblMessage;
}
}

View File

@ -1306,7 +1306,7 @@ namespace VEPROMS
this.cbShwAnnoFilter.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.cbShwAnnoFilter.TabIndex = 0;
this.cbShwAnnoFilter.Text = "Select";
this.cbShwAnnoFilter.Click += new System.EventHandler(this.buttonX1_Click);
this.cbShwAnnoFilter.Click += new System.EventHandler(this.cbShwAnnoFilter_Click);
//
// frmSysOptions
//
@ -1404,7 +1404,6 @@ namespace VEPROMS
private DevComponents.DotNetBar.Controls.CheckBoxX cbOTRemember;
private DevComponents.DotNetBar.Controls.CheckBoxX cbOTAutoOpen;
private DevComponents.DotNetBar.Controls.CheckBoxX cbShwRplWrdsColor;
//private DevComponents.DotNetBar.ButtonItem cbShwAnnoFilter;
private DevComponents.DotNetBar.Controls.GroupPanel gpMSWordSum;
mschill marked this conversation as resolved Outdated

commented out code should be removed or reason given for why it is commented out / should be in the code long term.

may be other places in this file as well - this is just where I noticed it.

commented out code should be removed or reason given for why it is commented out / should be in the code long term. may be other places in this file as well - this is just where I noticed it.

removed comments

removed comments
private DevComponents.DotNetBar.Controls.CheckBoxX cbMSWordPrompt;
private DevComponents.DotNetBar.ButtonX cbShwAnnoFilter;

View File

@ -365,24 +365,11 @@ namespace VEPROMS
Properties.Settings.Default.cbShwRplWrdsColor = cbShwRplWrdsColor.Checked; // update setting value
Properties.Settings.Default.Save(); // save settings
}
mschill marked this conversation as resolved
Review

unless reason for keeping the commented out code (should be explained in the comments) --- commented out code shouldn't be checked in?

(this would be throughout this file)

unless reason for keeping the commented out code (should be explained in the comments) --- commented out code shouldn't be checked in? (this would be throughout this file)
Review

Now, this is a method with everything inside commented out --- if no code is to execute, should the method be removed?

Now, this is a method with everything inside commented out --- if no code is to execute, should the method be removed?
private void cbShwAnnoFilter_Click(object sender, EventArgs e)
{
//OnSelectAnnotations(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0));
//Settings.Default.cbShwAnnoFilter = cbShwAnnoFilter.Checked;
//VlnSettings.cbShwAnnoFilter = cbShwAnnoFilter.Checked;
//Properties.Settings.Default.cbShwAnnoFilter = cbShwAnnoFilter.Checked; // update setting value
//Properties.Settings.Default.Save(); // save settings
}
private void buttonX1_Click(object sender, EventArgs e)
{
frmVEPROMS.tv_SelectAnnotations();
}
//private void OnSelectAnnotations(object sender, vlnTreeEventArgs args)
//{
// if (SelectAnnotations != null) SelectAnnotations(sender, args);
//}
}
}

View File

@ -543,7 +543,6 @@ namespace VEPROMS
tv.RefreshCheckedOutProcedures += new vlnTreeViewEvent(tv_RefreshCheckedOutProcedures);
tv.ProcedureCheckedOutTo += new vlnTreeViewEvent(tv_ProcedureCheckedOutTo);
tv.ViewPDF += new vlnTreeViewPdfEvent(tv_ViewPDF);
//tv.SelectAnnotations += new (tv_SelectAnnotations);
displayApplicability.ApplicabilityViewModeChanged += new DisplayApplicability.DisplayApplicabilityEvent(displayApplicability_ApplicabilityViewModeChanged);
mschill marked this conversation as resolved Outdated

unless reason for keeping the commented out code (should be explained in the comments) --- commented out code shouldn't be checked in?

unless reason for keeping the commented out code (should be explained in the comments) --- commented out code shouldn't be checked in?
tv.ExportImportProcedureSets += new vlnTreeViewEvent(tv_ExportImportProcedureSets);
@ -1298,7 +1297,7 @@ namespace VEPROMS
}
public static void tv_SelectAnnotations()
{
mschill marked this conversation as resolved
Review

unless reason for keeping the commented out code (should be explained in the comments) --- commented out code shouldn't be checked in?

(this would be throughout this file)

unless reason for keeping the commented out code (should be explained in the comments) --- commented out code shouldn't be checked in? (this would be throughout this file)
DlgAnnotationsSelect sannoDlg = new DlgAnnotationsSelect(VlnSettings.UserID);
dlgAnnotationsSelect sannoDlg = new dlgAnnotationsSelect(VlnSettings.UserID);
sannoDlg.ShowDialog(); // RHM 20120925 - Center dialog over PROMS window
}
void tv_CreateTimeCriticalActionSummary(object sender, vlnTreeEventArgs args)

View File

@ -171,187 +171,6 @@ namespace VEPROMS.CSLA.Library
}
}
private int _TypeID;
[System.ComponentModel.DataObjectField(true, true)]
public int TypeID
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _TypeID;
}
}
private int _ItemID;
[System.ComponentModel.DataObjectField(true, true)]
public int ItemID
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _ItemID;
}
}
private string _Name = string.Empty;
public string Name
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _Name;
}
}
private string _Config = string.Empty;
public string Config
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _Config;
}
}
private DateTime _DTS = new DateTime();
public DateTime DTS
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _DTS;
}
}
private string _UserID = string.Empty;
public string UserID
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _UserID;
}
}
private int _AnnotationTypeAnnotationCount = 0;
public int AnnotationTypeAnnotationCount
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _AnnotationTypeAnnotationCount;
}
}
//C2025-023 - Electronic Procedures - Modifications to PROMS
// Is Annotation Type an EP Annotation?
private bool _IsEPAnnotationType = false;
public bool IsEPAnnotationType
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
return _IsEPAnnotationType;
}
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
set
{
if (_IsEPAnnotationType != value)
{
_IsEPAnnotationType = value;
//PropertyHasChanged();
}
}
}
#region Log4Net
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion
private string _ErrorMessage = string.Empty;
public string ErrorMessage
{
get { return _ErrorMessage; }
}
[Serializable()]
protected class retrieveAnnotSelections
{
private int _itemID;
public int itemID { get { return _itemID; } }
public retrieveAnnotSelections(int itemID)
{
_itemID = itemID;
}
}
[Serializable()]
public class retrieveAnnotSelectionsList
{
private int _TypeID;
public int TypeID
{
get { return _TypeID; }
set { _TypeID = value; }
}
private int _ItemID;
public int ItemID
{
get { return _ItemID; }
set { _ItemID = value; }
}
private string _Name;
public string Name
{
get { return _Name; }
set { _Name = value; }
}
private string _Config;
public string Config
{
get { return _Config; }
set { _Config = value; }
}
private DateTime _DTS;
public DateTime DTS
{
get { return _DTS; }
set { _DTS = value; }
}
private string _UserID;
public string UserID
{
get { return _UserID; }
set { _UserID = value; }
}
private bool _IsEPAnnotationType;
public bool IsEPAnnotationType
{
get { return _IsEPAnnotationType; }
set { _IsEPAnnotationType = value; }
}
private string _ErrorMessage = string.Empty;
public string ErrorMessage
{
get { return _ErrorMessage; }
}
}
private void ReadData(SafeDataReader dr)
{
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] retrieveAnnotSelectionsList.ReadData", GetHashCode());
try
{
_TypeID = dr.GetInt32("TypeID");
_ItemID = dr.GetInt32("ItemID");
_Name = dr.GetString("Name");
_Config = dr.GetString("Config");
_DTS = dr.GetDateTime("DTS");
_UserID = dr.GetString("UserID");
_AnnotationTypeAnnotationCount = dr.GetInt32("AnnotationCount");
if (dr.GetSchemaTable().Rows.OfType<DataRow>().Any(row => row["ColumnName"].ToString() == "IsEPAnnotationType"))
_IsEPAnnotationType = (bool)dr.GetValue("IsEPAnnotationType");
}
catch (Exception ex)
{
if (_MyLog.IsErrorEnabled) _MyLog.Error("retrieveAnnotSelectionsList.ReadData", ex);
_ErrorMessage = ex.Message;
throw new DbCslaException("retrieveAnnotSelectionsList.ReadData", ex);
}
}
}
}

View File

@ -120,11 +120,6 @@ namespace Volian.Controls.Library
if (CurrentItem.MyDocVersion.DocVersionAssociationCount > 0)
_ROPath = CurrentItem.MyDocVersion.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath;
//ProcItem = CurrentItem.MyProcedure;
// C2025-027 Annotation Type Filtering
//cbGridAnnoType.WatermarkText = "Select Annotation Type";
//cbGridAnnoType.DataSource = VEPROMS.CSLA.Library.AnnotationstypeSelections.Get(MyUserInfo.UserID);
}
mschill marked this conversation as resolved
Review

just to double check - was this intended to be commented out?

just to double check - was this intended to be commented out?
Review

was this (ProcItem = CurrentItem.MyProcedure;) intended to be removed?

was this (ProcItem = CurrentItem.MyProcedure;) intended to be removed?
Review

Yes it did not work where I moved the code to retrieve selected anno types for the annotation details. Also it was not needed any more.

Yes it did not work where I moved the code to retrieve selected anno types for the annotation details. Also it was not needed any more.
Review

sounds good. Just wanted to double check since this existed before your changes that removing it wasn't going to impact something else.

sounds good. Just wanted to double check since this existed before your changes that removing it wasn't going to impact something else.
public AnnotationInfo FirstExeAnnotation(ItemInfo ii)
{
mschill marked this conversation as resolved Outdated

this is set to a different DataSource in:
public void SetupAnnotations(DisplaySearch annosrch)

should this be there/replace that?

DisplayMember / ValueMember / etc... is set there - are they the same?

which should be the driving DataSource / (what would happen if a discrepancy between the two - for example if all annotation types were filtered out)?

this is set to a different DataSource in: public void SetupAnnotations(DisplaySearch annosrch) should this be there/replace that? DisplayMember / ValueMember / etc... is set there - are they the same? which should be the driving DataSource / (what would happen if a discrepancy between the two - for example if all annotation types were filtered out)?
@ -369,9 +364,7 @@ namespace Volian.Controls.Library
cbGridAnnoType.DisplayMember = "Name";
cbGridAnnoType.ValueMember = "TypeId";
cbGridAnnoType.DataSource = AnnotationTypeInfoList.Get().Clone();
//ProcItem = CurrentItem.MyProcedure;
//C2025 - 027 Annotation Type Filtering
cbGridAnnoType.WatermarkText = "Select Annotation Type";
cbGridAnnoType.DataSource = VEPROMS.CSLA.Library.AnnotationstypeSelections.Get(MyUserInfo.UserID);