diff --git a/PROMS/VEPROMS User Interface/DlgAnnotationsSelect.cs b/PROMS/VEPROMS User Interface/DlgAnnotationsSelect.cs index 1786e97c..3f4d87e3 100644 --- a/PROMS/VEPROMS User Interface/DlgAnnotationsSelect.cs +++ b/PROMS/VEPROMS User Interface/DlgAnnotationsSelect.cs @@ -95,6 +95,7 @@ namespace VEPROMS { DataTable dt2 = coverToTable(); VEPROMS.CSLA.Library.AnnotationstypeSelections.Update(dt2, UserID); + this.Close(); } public class AnnotataionItem { diff --git a/PROMS/VEPROMS User Interface/PROMSFixes.Sql b/PROMS/VEPROMS User Interface/PROMSFixes.Sql index d16b68c8..c882ef3c 100644 --- a/PROMS/VEPROMS User Interface/PROMSFixes.Sql +++ b/PROMS/VEPROMS User Interface/PROMSFixes.Sql @@ -24075,10 +24075,6 @@ ELSE GO -- C2025-027 Annotation Type Filtering -IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[AnnotationTypeSelections]') AND type in (N'U')) -DROP TABLE [dbo].[AnnotationTypeSelections] -GO - /****** Object: Table [dbo].[AnnotationTypeSelections] Script Date: 7/10/2025 2:38:23 PM ******/ SET ANSI_NULLS ON GO @@ -24149,7 +24145,10 @@ AS (SELECT COUNT(*) FROM [Annotations] WHERE [Annotations].[TypeID]= [TypeID]) [AnnotationCount], [IsEPAnnotationType] FROM [AnnotationTypes] --A - WHERE TypeID NOT IN (SELECT TypeID FROM AnnotationTypeSelections ATS WHERE ATS.UserID = @UserID) + LEFT OUTER JOIN AnnotationTypeSelections ON AnnotationTypeSelections.TypeID = AnnotationTypes.TypeID + WHERE AnnotationTypeSelections.UserID = @UserID + AND + AnnotationTypeSelections.ASTypeID IS NULL GO -- C2025-027 Annotation Type Filtering diff --git a/PROMS/VEPROMS.CSLA.Library/Minimal/AnnotationstypeSections.cs b/PROMS/VEPROMS.CSLA.Library/Minimal/AnnotationstypeSections.cs index 0ef12337..c3af558b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Minimal/AnnotationstypeSections.cs +++ b/PROMS/VEPROMS.CSLA.Library/Minimal/AnnotationstypeSections.cs @@ -150,15 +150,22 @@ namespace VEPROMS.CSLA.Library { using (SqlCommand cm = cn.CreateCommand()) { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "UpdateAnnotationstypeSelections"; - cm.CommandTimeout = Database.DefaultTimeout; + try + { + cm.CommandType = CommandType.StoredProcedure; + cm.CommandText = "UpdateAnnotationstypeSelections"; + cm.CommandTimeout = Database.DefaultTimeout; - //Pass table Valued parameter to Store Procedure - SqlParameter sqlParam = cm.Parameters.AddWithValue("@TempTable", dt); - sqlParam.SqlDbType = SqlDbType.Structured; - cm.Parameters.AddWithValue("@UserID", UserID); - cm.ExecuteNonQuery(); + //Pass table Valued parameter to Store Procedure + SqlParameter sqlParam = cm.Parameters.AddWithValue("@TempTable", dt); + sqlParam.SqlDbType = SqlDbType.Structured; + cm.Parameters.AddWithValue("@UserID", UserID); + cm.ExecuteNonQuery(); + } + catch (Exception ex) + { + throw new DbCslaException("Error in UpdateAnnotationstypeSelections: update failed", ex); + } } } }