C2025-027-AnnotationsTypeSelect #574
@@ -95,6 +95,7 @@ namespace VEPROMS
|
||||
{
|
||||
DataTable dt2 = coverToTable();
|
||||
VEPROMS.CSLA.Library.AnnotationstypeSelections.Update(dt2, UserID);
|
||||
this.Close();
|
||||
}
|
||||
public class AnnotataionItem
|
||||
mschill marked this conversation as resolved
Outdated
|
||||
{
|
||||
|
@@ -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
|
||||
|
@@ -149,6 +149,8 @@ namespace VEPROMS.CSLA.Library
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
try
|
||||
{
|
||||
mschill marked this conversation as resolved
Outdated
mschill
commented
if have a try catch, should there be something in the catch? if have a try catch, should there be something in the catch?
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "UpdateAnnotationstypeSelections";
|
||||
@@ -160,6 +162,11 @@ namespace VEPROMS.CSLA.Library
|
||||
cm.Parameters.AddWithValue("@UserID", UserID);
|
||||
cm.ExecuteNonQuery();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new DbCslaException("Error in UpdateAnnotationstypeSelections: update failed", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user
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?
Flag removed
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?
When a user changes or adds to his selections, we need to remove his selections in the DB and insert the updates.
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...
Would remove dltFlg and commented out code since no longer used.
As FYI - still valid
Flag removed