<?xml version="1.0"?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
      <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
      <requiredRuntime version="v4.0.20506" />
  </startup>
  <appSettings>
    <add key="ScriptEditor_Controller_DefaultScriptCSharp" value=
         "using CardAccess.Messaging;
namespace CardAccess.Scripting
{
    /// &lt;summary&gt;
    /// Generic script class. Your Script Class Must inherit CardAccess.Scripting.Script class.
    /// Please Change the Class Name.
    /// &lt;/summary&gt;
    public  class YourScriptClass : CardAccess.Scripting.Script
    {
        caAlertData alertData= new caAlertData();
        /// &lt;summary&gt;
        /// Your Script Class Constructor. This constructor must reside in your script Class.
        /// Change your constructor name based on your class name.
        /// &lt;/summary&gt;
        public YourScriptClass()
        {
        }
        /// &lt;summary&gt;
        /// This is where code that is not based on an event goes. 
        /// Anything that a script object would need to initialize and/or finalize goes here.
        /// &lt;/summary&gt;
        public override void Load()
        {                            
        }
        
        /// &lt;summary&gt;
        /// Routine that is called when an event/alert is received.  Processing for alert/event based scripts goes here.        
        /// &lt;/summary&gt;
        public override void ProcessEvent(caAlertData eventRec) 
        {
          alertData =eventRec;
        }
        /// &lt;summary&gt;
        /// All Generated Script For an Event Goes Here.
        /// &lt;/summary&gt;
        public override void GeneratedScript()
        {       
        }
    }
}
"
         />
    <add key="ScriptEditor_Controller_DefaultScriptVBDOTNET" value=
         "Imports CardAccess.Messaging
    Namespace CardAccess.Scripting
    '' &lt;summary&gt;
    '' Generic script class. Your Script Class Must inherit CardAccess.Scripting.Script class.
    '' Please Change the Class Name.
    '' &lt;/summary&gt;
    Public Class YourScriptClass
        Inherits CardAccess.Scripting.Script
        Dim alertData As New caAlertData()
        '' &lt;summary&gt;
        '' Your Script Class Constructor. This constructor must reside in your script Class.
        '' Change your constructor name based on your class name.
        '' &lt;/summary&gt;
        Public Sub New()
        End Sub
        '' &lt;summary&gt;
        '' This is where code that is not based on an event goes.
        '' Anything that a script object would need to initialize and/or finalize goes here.
        '' &lt;/summary&gt;
        Public Overrides Sub load()
        End Sub
        '' &lt;summary&gt;
        '' Routine that is called when an Event/alert is received.  Processing for alert/Event based scripts goes here.        
        '' &lt;/summary&gt;
        Public Overrides Sub ProcessEvent(eventRec As caAlertData) 
          alertData =eventRec
        End Sub
        '' &lt;summary&gt;
        '' All Generated Script For an Event Goes Here.
        '' Change Codes Here If you want the codes to be executed for a scriptLink
        '' &lt;/summary&gt;
        Public Overrides Sub  GeneratedScript()
        'SCRIPTPLACEHOLDER
        End Sub
    End Class    
End Namespace
         "
         />
    <add key="ScriptWizard_ScriptTemplate" value=
         "using CardAccess.Messaging;
namespace CardAccess.Scripting
{
    /// &lt;summary&gt;
    /// Generic script class. Your Script Class Must inherit CardAccess.Scripting.Script class.
    /// Please Change the Class Name.
    /// &lt;/summary&gt;
    public  class YourScriptClass : CardAccess.Scripting.Script
    {
        caAlertData alertData= new caAlertData();
        /// &lt;summary&gt;
        /// Your Script Class Constructor. This constructor must reside in your script Class.
        /// Change your constructor name based on your class name.
        /// &lt;/summary&gt;
        public YourScriptClass()
        {
        }
        /// &lt;summary&gt;
        /// This is where code that is not based on an event goes. 
        /// Anything that a script object would need to initialize and/or finalize goes here.
        /// &lt;/summary&gt;
        public override void Load()
        {                           	
        }
        
        /// &lt;summary&gt;
        /// Routine that is called when an event/alert is received.  Processing for alert/event based scripts goes here.        
        /// &lt;/summary&gt;
        public override void ProcessEvent(caAlertData eventRec) 
        {
          	alertData =eventRec;
        }
        /// &lt;summary&gt;
        /// All Generated Script For an Event Goes Here.
        /// &lt;/summary&gt;
        public override void GeneratedScript()
        {       
        	&lt;SCRIPTPLACEHOLDER&gt; 	      			
        }
    }
}
"
         />

    <add key="CA3000DuplicatePrivileg" value="DECLARE [DuplicateRole] CURSOR LOCAL
          FOR
          select tab.RoleName, NoPriv from
          (SELECT count(Priv) AS DupCount, [Priv] as [RoleName]
          FROM [@sourceServer].[@sourceDb].[dbo].[Privileg]
          group by Priv having count(*)&gt;1) as tab
          left join [@sourceServer].[@sourceDb].[dbo].[Privileg] as P ON P.Priv=tab.RoleName

          OPEN [DuplicateRole]
          BEGIN TRY
          DECLARE @RoleName NVARCHAR(MAX), @PrivNo INT, @Inct INT
          DECLARE @mg NVARCHAR(MAX), @RolName NVARCHAR(MAX)
          FETCH NEXT FROM [DuplicateRole] INTO @RoleName, @PrivNo
          SET @Inct=0
          WHILE @@FETCH_STATUS = 0
          BEGIN
          SET @RolName=''
          SET @RolName=@RoleName+' ('+CONVERT(VARCHAR(10),@PrivNo)+')'
          UPDATE [@sourceServer].[@sourceDb].[dbo].[Privileg] SET Priv=@RolName WHERE NoPriv=@PrivNo
          FETCH NEXT FROM [DuplicateRole] INTO @RolName, @PrivNo
          END
          END TRY
          BEGIN CATCH
          set @mg=(SELECT ERROR_MESSAGE())
          END CATCH
          CLOSE [DuplicateRole]
          DEALLOCATE [DuplicateRole]"
         />
  </appSettings>
</configuration>
