public IList GetCounterValue(string TableName)
 {
     try
     {
         return(PSF.GetCounterValue(TableName));
     }
     catch (Exception) { throw; }
     finally { if (PSF != null)
               {
                   PSF.Dispose();
               }
     }
 }
 public long CreateProcessInstance(ProcessInstance ProcessInstance)
 {
     try
     {
         if (ProcessInstance != null)
         {
             PSF.SaveOrUpdate <ProcessInstance>(ProcessInstance); return(ProcessInstance.Id);
         }
         else
         {
             throw new Exception("ProcessInstance Object is required and it cannot be empty.");
         }
     }
     catch (Exception) { throw; }
     finally { if (PSF != null)
               {
                   PSF.Dispose();
               }
     }
 }