namespace FBCKDAL.QueryBuilders; public static class ActionItemQB { // Index: (EmployeeId, TenantId, Status), (DueDate, TenantId, Status) public const string GET_ACTION_ITEMS = @" SELECT ActionItemId, ContextType, ContextId, EmployeeId, OwnerId, ActionText, DueDate, Status, CompletionRemarks, TenantId FROM TACTIONITEM WHERE TenantId = @TenantId AND (@EmployeeId = 0 OR EmployeeId = @EmployeeId) AND (@ContextType = -1 OR ContextType = @ContextType) AND (@ContextId = 0 OR ContextId = @ContextId) AND (@Status = -1 OR Status = @Status) ORDER BY DueDate ASC"; public const string INSERT_ACTION_ITEM = @" INSERT INTO TACTIONITEM (ContextType, ContextId, EmployeeId, OwnerId, ActionText, DueDate, Status, TenantId) VALUES (@ContextType, @ContextId, @EmployeeId, @OwnerId, @ActionText, @DueDate, 0, @TenantId) SELECT SCOPE_IDENTITY()"; public const string UPDATE_ACTION_ITEM = @" UPDATE TACTIONITEM SET ActionText = @ActionText, DueDate = @DueDate WHERE ActionItemId = @ActionItemId AND TenantId = @TenantId"; public const string COMPLETE_ACTION_ITEM = @" UPDATE TACTIONITEM SET Status = 1, CompletionRemarks = @CompletionRemarks WHERE ActionItemId = @ActionItemId AND TenantId = @TenantId"; }