C2025-027-AnnotationsTypeSelect #574
Open
plarsen
wants to merge 3 commits from
C2025-027-AnnotationsTypeSelect
into Development
pull from: C2025-027-AnnotationsTypeSelect
merge into: Volian:Development
Volian:master
Volian:C2025-024
Volian:Development
Volian:General_Debugging
Volian:C2025-038_EventCalls
Volian:F2025-016
Volian:B2025-035-Hold-Procedure-Set-Bug
Volian:C2025-023
Volian:C2025-036_CleanupTabCode
Volian:B2025-034-Add-error-message-documents-2
Volian:B2025-034-Add-error-message-documents
Volian:F2025-015_SharonHarris
Volian:B2025-024-Document-Unit-Print
Volian:C2025-021
Volian:C2025-023-New-EP-Format-File
Volian:F2024-089_BNPP_LOGO
Volian:C2025-013
Volian:C2025-028_B2025-032
Volian:DemoFormats
Volian:B2025-028
Volian:C2025_031_OptionsTooltips_Cleanup
Volian:B2025-031
Volian:B2025-030
Volian:C2025-032
Volian:F2025-012
Volian:B2025-026_B2025-027
Volian:C2025-027-Develop-a-way-to-filter-annotations-so-the-user-can-view-only-the-types-they-want-to-see-EP
Volian:F2025-011
Volian:B2025-010
Volian:B2022-031-Add-filtering-for-Proc-and-Section-name-from-Global-Search-2
Volian:B2022-031-Add-filtering-for-Proc-and-Section-name-from-Global-Search
Volian:ACME_formats
Volian:C2024-041-Disable-UCF-(User-Control-of-Format)-options-3
Volian:C2024-041-Disable-UCF-(User-Control-of-Format)-options-2
Volian:C2024-041-Disable-UCF-(User-Control-of-Format)-options
Volian:F2025-004_Ginna
Volian:B2025-017-Print-Section-Sub-Section-v2
Volian:DeveloperToolUpdate
Volian:B2025-020_UpdateTransitions
Volian:B2025-018
Volian:C2025-019
Volian:B2025-015
Volian:C2025-014_PDF_Step_BckMrk_Zoom
Volian:B2025-019
Volian:C2024-038_v2
Volian:F2025-002_Farley
Volian:B2025-016
Volian:C2024-038
Volian:OrgDotNetBar
Volian:B2025-013
Volian:B2025-011-Global-search-is-not-finding-question-marks
Volian:DotNetBar_net4.8.1
Volian:CLSA481Build
Volian:B2025-014
Volian:B2025-012
Volian:C2025-011
Volian:F2025-001_BNPP
Volian:C2019-025_Ability-to-Toggle-Replace-Words-3
Volian:C2025-005
Volian:C2019-025_Ability-to-Toggle-Replace-Words-2
Volian:C2019-025_Ability-to-Toggle-Replace-Words
Volian:B2025-005
Volian:C2025-008
Volian:B2025-008
Volian:B2025-007
Volian:C2025-007
Volian:B2025-009
Volian:B2025-004_v2
Volian:B2025-004
Volian:C2025-006_B2025-006
Volian:C2025-003
Volian:B2025-003
Volian:C2020-049-Add-the-ability-for-PROMS-to-remember-the-procedure-tabs-that-were-open-when-you-closed-PROMS-6
Volian:F2024-074-Farley_TOC
Volian:C2020-049-Add-the-ability-for-PROMS-to-remember-the-procedure-tabs-that-were-open-when-you-closed-PROMS
Volian:B2024-063-Invalid-Format-message-box-displays-when-rev-date-empty
Volian:B2024-062_EmptyProcedure
Volian:B2024-068-VCS-Deviation-Format
Volian:C2024-005
Volian:C2024-016-Write-Info-to-Results-Window-Delete-Annotations
Volian:B2024-046-Set-Default-Tab-In-Admin-Tools
Volian:C2024-005-Annotations-Cleanup
Volian:B2024-041
Volian:C2024-004_fix
Volian:C2021-059
Volian:B2024-032-Fix-Quick-Print
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
No description provided.
Delete Branch "C2025-027-AnnotationsTypeSelect"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Develop a way to filter annotations so the user can view only the types they want to see.
@ -206,7 +206,7 @@ namespace VEPROMS.CSLA.Library
public partial class AnnotationAuditInfoListPropertyDescriptor : vlnListPropertyDescriptor
{
private AnnotationAuditInfo Item { get { return (AnnotationAuditInfo)_Item; } }
public AnnotationAuditInfoListPropertyDescriptor(AnnotationAuditInfoList collection, int index) : base(collection, index) { ;}
Not sure I understand why this change was made? / It appears to be the only change to the file?
If you want to keep commented out code, you should a comment explaining why to keep it
a space was switched at the end of line 209. It is the same code as before. Not sure why that change is there because I did not make it.
Before: public AnnotationAuditInfoListPropertyDescriptor(AnnotationAuditInfoList collection, int index) : base(collection, index) { ;}
After: public AnnotationAuditInfoListPropertyDescriptor(AnnotationAuditInfoList collection, int index) : base(collection, index) {; }
@ -0,0 +1,226 @@
// ========================================================================
Not sure I understand why a _bak file was created and is being checked in for this?
Not sure how this got in GIT. It is no long in the project or on the file system.
Sorry I see the file now. I will remove it.
Then odd thing is that I removed it from the project, but it got included in the pull request.
@ -0,0 +67,4 @@
dt.Rows.Add(row);
}
//row = dt.NewRow();
unless reason for keeping the commented out code --- commented out code shouldn't be checked in?
(this would be throughout this file)
I removed the commented code.
@ -0,0 +16,4 @@
//namespace VEPROMS.CSLA.Library;
// C2025-027 this new file is used to support (data retrival) for selecting Annotation types to display on the Annotation screen.
Just to double check ---- Since there are many annotation screens, should we be more specific / say this is related to Annotation type filtering through V->Options?
@ -0,0 +204,4 @@
throw new DbCslaException("Error on AnnotationTypeInfoList.Get", ex);
}
}
private int _TypeID;
might be missing something ---- but Not sure I am understanding why these are compile time --- i.e. System.Runtime.CompilerServices.MethodImpl
seams like these would be class specific & if they are, should the methods that reference these not be "static" / i.e. could you end up with strange behavior if those methods are called multiple times (multiple users/open windows of the program)? ---- again, may not be the case, but figured I would double check?
This code was borrowed code that is not being used. I may take it out. I have it in the file when I tried to use CSLA DataPortal_Fetch. I have run into too many problems trying to use CSLA. I will give it another try.
I will remove it. I was initially trying CSLA, but CSLA is not easy to work with. I do not want to waste time to get CSLA to work on minor data requests.
I would recommend either it should follow CSLA or it should notmainly for 2 reasons:
@ -0,0 +361,4 @@
}
}
private void DataPortal_Fetch(retrieveAnnotSelections criteria)
may be missing something .... but if we are doing a "minimal" implementation --- i.e. not using csla (using sqlconnection and createcommand) for DB access, is there a reason we are using csla's DataPortal_Fetch?
@ -0,0 +404,4 @@
_itemID = itemID;
}
}
private void DataPortal_Fetch(AnnotationSelectByItemIDCriteria criteria)
may be missing something .... but if we are doing a "minimal" implementation --- i.e. not using csla (using sqlconnection and createcommand) for DB access, is there a reason we are using csla's DataPortal_Fetch?
I will remove it. I was initially trying CSLA, but CSLA is not easy to work with. I do not want to waste time to get CSLA to work on minor data requests.
I agree with Matt's comments.
Please removed commented out code or add a comment with reason to keep
Also _bak files should not be checked in.
@ -123,1 +123,3 @@
}
// C2025-027
//cbGridAnnoType.DataSource = VEPROMS.CSLA.Library.AnnotationstypeSelections.Get(ProcItem.ItemID);
cbGridAnnoType.DataSource = VEPROMS.CSLA.Library.AnnotationstypeSelections.Get(MyUserInfo.UserID, ProcItem.ItemID);
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)?
@ -1296,7 +1296,38 @@ namespace VEPROMS
pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
}
//void tv_SelectAnnotations(object sender, vlnTreeEventArgs args)
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)
I re-reviewed this morning.
see Pending comments - let me know if you have any questions.
@ -0,0 +14,4 @@
// C2025-027 Annotation Type Filtering
public partial class DlgAnnotationsSelect : Form
{
int AnnotationTypeID;
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?
@ -0,0 +25,4 @@
public DlgAnnotationsSelect(string userid)
{
InitializeComponent();
//MyItemID = pi.ItemID;
commented out code should be removed or reason given for why it is commented out / should be in the code long term.
@ -0,0 +97,4 @@
// Save selected list to DB.
private void btnUpdate_Click(object sender, EventArgs e)
{
int dltFlg = 1;
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?
@ -0,0 +101,4 @@
foreach (AnnotataionItem item in lstSelected.Items.OfType<AnnotataionItem>())
{
lstSelected.DisplayMember = "NameStr";
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?
@ -24078,0 +24129,4 @@
-- Description: Retrieve Current Annotation Types
-- =============================================
CREATE PROC [dbo].[getAnnotationstypeSelections]
So .... unless I have this backwards:
This is for filtering out Annotation Types --- so wouldn't anything selected in AnnotationTypeSelections need / be filtered out.
so basically, by default, we would show all annotation types / if a new annotation type was added it would show & only what is selected would be filtered out .......
if this is the case, wouldn't we want this info to come from AnnotationTypes
& be basically:
Select
AnnotationTypes.[TypeID],
AnnotationTypes.[Name],
AnnotationTypes.[Config],
AnnotationTypes.[DTS],
AnnotationTypes.[UserID],
AnnotationTypes.[LastChanged],
(SELECT COUNT(*) FROM [Annotations] WHERE [Annotations].[TypeID]=[AnnotationTypes].[TypeID]) [AnnotationCount],
AnnotationTypes.[IsEPAnnotationType]
FROM [AnnotationTypes]
LEFT OUTER JOIN AnnotationTypeSelections ON AnnotationTypeSelections.TypeID = AnnotationTypes.TypeID
WHERE AnnotationTypeSelections.UsrID = @UsrID
AND
AnnotationTypeSelections.ASTypeID IS NULL
----again, may be thinking of this wrong ... but was thinking we were storing in the db what they picked to filter out.
@ -24078,0 +24232,4 @@
-- Description: Store user Annotation selections for annotation filter.
-- =============================================
CREATE TABLE [dbo].[AnnotationTypeSelections](
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?
@ -0,0 +1,190 @@
namespace VEPROMS
Naming/casing should be consistent:
class is:
DlgAnnotationsSelect
but
designer is
dlgAnnotationsSelect?
@ -1346,3 +1404,4 @@
private DevComponents.DotNetBar.Controls.CheckBoxX cbOTRemember;
private DevComponents.DotNetBar.Controls.CheckBoxX cbOTAutoOpen;
private DevComponents.DotNetBar.Controls.CheckBoxX cbShwRplWrdsColor;
//private DevComponents.DotNetBar.ButtonItem cbShwAnnoFilter;
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.
@ -366,3 +366,3 @@
Properties.Settings.Default.Save(); // save settings
}
}
private void cbShwAnnoFilter_Click(object sender, EventArgs e)
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)
Now, this is a method with everything inside commented out --- if no code is to execute, should the method be removed?
@ -369,0 +376,4 @@
//Properties.Settings.Default.Save(); // save settings
}
private void buttonX1_Click(object sender, EventArgs e)
Should this be named something other than buttonX1?
@ -544,3 +544,3 @@
tv.ProcedureCheckedOutTo += new vlnTreeViewEvent(tv_ProcedureCheckedOutTo);
tv.ViewPDF += new vlnTreeViewPdfEvent(tv_ViewPDF);
//tv.SelectAnnotations += new (tv_SelectAnnotations);
unless reason for keeping the commented out code (should be explained in the comments) --- commented out code shouldn't be checked in?
@ -0,0 +41,4 @@
// if the user has not created a annotation sub-set list saved to AnnotationTypeSelections table.
if (dt.Rows.Count < 1)
{
//dt.Rows.Add(DataPortal.Fetch<AnnotationTypeInfoList>());
commented out code should be removed or reason given for why it is commented out / should be in the code long term.
@ -122,2 +122,2 @@
ProcItem = CurrentItem.MyProcedure;
}
//ProcItem = CurrentItem.MyProcedure;
just to double check - was this intended to be commented out?
@ -124,0 +123,4 @@
//ProcItem = CurrentItem.MyProcedure;
// C2025-027 Annotation Type Filtering
//cbGridAnnoType.WatermarkText = "Select Annotation Type";
//cbGridAnnoType.DataSource = VEPROMS.CSLA.Library.AnnotationstypeSelections.Get(MyUserInfo.UserID);
commented out code should be removed or reason given for why it is commented out / should be in the code long term. (lines 122-127)
@ -365,6 +370,12 @@ namespace Volian.Controls.Library
cbGridAnnoType.DisplayMember = "Name";
cbGridAnnoType.ValueMember = "TypeId";
cbGridAnnoType.DataSource = AnnotationTypeInfoList.Get().Clone();
this should be removed if data set is set to something else (see 2 lines after this)
Checkout
From your project repository, check out a new branch and test the changes.