Click here to Skip to main content
15,897,315 members
Articles / Desktop Programming / WPF

DBTool for Oracle - Part 1

Rate me:
Please Sign up or sign in to vote.
4.92/5 (45 votes)
13 Apr 2014CPOL18 min read 138.6K   5.1K   88  
Enhance productivity and reliability, write your own tools.
using System;
using System.Collections.Generic;
using System.Data;
using System.Threading;
using System.Reflection;
using Oracle.DataAccess.Client;


using Harlinn.Oracle.DBTool.Example.Common;
using Harlinn.Oracle.DBTool.Example.Types;
using Harlinn.Oracle.DBTool.Example.DB;


namespace Harlinn.Oracle.DBTool.Example.Implementation
{


    public partial class ServiceImplementation : IDataContextProvider
    {

        private static readonly log4net.ILog sfLog = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

        private static void LogException(Exception exc, MethodBase method)
        {
            Logger.LogException(sfLog, exc, method);
        }

        static void Entering( MethodBase method )
        {
            Logger.Entering(sfLog, method);
        }

        static void Leaving( MethodBase method )
        {
            Logger.Leaving(sfLog, method);
        }

        private static readonly object synchObject = new object();

        private static ServiceImplementation implementation;
        public static ServiceImplementation Implementation
        {
            get
            {
                if (implementation == null)
                {
                    lock (synchObject)
                    {
                        if (implementation == null)
                        {
                            implementation = new ServiceImplementation();
                        }
                    }
                }
                return implementation;
            }
        }

        private string GetQualifiedStorage( long tag )
        {
            string result = GetTagValueSchema() + "." + GetTagValueStorage( tag );
            return result;
        }


        private string GetTagValueSchema( )
        {
            return "HarlinnData";
        }

        private string GetTagValueStorage( long tag )
        {
            string result = TagAccessor.GetTagValueTablename(tag);
            return result;
        }

        public event OnNodeInsertedDelegate OnNodeInsertedEvent;
        public event OnNodeChangedDelegate OnNodeChangedEvent;
        public event OnNodeDeletedDelegate OnNodeDeletedEvent;

        public event OnItemInsertedDelegate OnItemInsertedEvent;
        public event OnItemChangedDelegate OnItemChangedEvent;
        public event OnItemDeletedDelegate OnItemDeletedEvent;

        public event OnTagTypeInsertedDelegate OnTagTypeInsertedEvent;
        public event OnTagTypeChangedDelegate OnTagTypeChangedEvent;
        public event OnTagTypeDeletedDelegate OnTagTypeDeletedEvent;

        public event OnEnumerationInsertedDelegate OnEnumerationInsertedEvent;
        public event OnEnumerationChangedDelegate OnEnumerationChangedEvent;
        public event OnEnumerationDeletedDelegate OnEnumerationDeletedEvent;

        public event OnEnumerationValueInsertedDelegate OnEnumerationValueInsertedEvent;
        public event OnEnumerationValueChangedDelegate OnEnumerationValueChangedEvent;
        public event OnEnumerationValueDeletedDelegate OnEnumerationValueDeletedEvent;

        public event OnTagInsertedDelegate OnTagInsertedEvent;
        public event OnTagChangedDelegate OnTagChangedEvent;
        public event OnTagDeletedDelegate OnTagDeletedEvent;

        public event OnBinaryValueInsertedDelegate OnBinaryValueInsertedEvent;
        public event OnBinaryValueChangedDelegate OnBinaryValueChangedEvent;
        public event OnBinaryValueDeletedDelegate OnBinaryValueDeletedEvent;

        public event OnBooleanValueInsertedDelegate OnBooleanValueInsertedEvent;
        public event OnBooleanValueChangedDelegate OnBooleanValueChangedEvent;
        public event OnBooleanValueDeletedDelegate OnBooleanValueDeletedEvent;

        public event OnByteValueInsertedDelegate OnByteValueInsertedEvent;
        public event OnByteValueChangedDelegate OnByteValueChangedEvent;
        public event OnByteValueDeletedDelegate OnByteValueDeletedEvent;

        public event OnDateTimeValueInsertedDelegate OnDateTimeValueInsertedEvent;
        public event OnDateTimeValueChangedDelegate OnDateTimeValueChangedEvent;
        public event OnDateTimeValueDeletedDelegate OnDateTimeValueDeletedEvent;

        public event OnDoubleValueInsertedDelegate OnDoubleValueInsertedEvent;
        public event OnDoubleValueChangedDelegate OnDoubleValueChangedEvent;
        public event OnDoubleValueDeletedDelegate OnDoubleValueDeletedEvent;

        public event OnEnumeratedValueInsertedDelegate OnEnumeratedValueInsertedEvent;
        public event OnEnumeratedValueChangedDelegate OnEnumeratedValueChangedEvent;
        public event OnEnumeratedValueDeletedDelegate OnEnumeratedValueDeletedEvent;

        public event OnFloatValueInsertedDelegate OnFloatValueInsertedEvent;
        public event OnFloatValueChangedDelegate OnFloatValueChangedEvent;
        public event OnFloatValueDeletedDelegate OnFloatValueDeletedEvent;

        public event OnIntValueInsertedDelegate OnIntValueInsertedEvent;
        public event OnIntValueChangedDelegate OnIntValueChangedEvent;
        public event OnIntValueDeletedDelegate OnIntValueDeletedEvent;

        public event OnLongValueInsertedDelegate OnLongValueInsertedEvent;
        public event OnLongValueChangedDelegate OnLongValueChangedEvent;
        public event OnLongValueDeletedDelegate OnLongValueDeletedEvent;

        public event OnSByteValueInsertedDelegate OnSByteValueInsertedEvent;
        public event OnSByteValueChangedDelegate OnSByteValueChangedEvent;
        public event OnSByteValueDeletedDelegate OnSByteValueDeletedEvent;

        public event OnShortBinaryValueInsertedDelegate OnShortBinaryValueInsertedEvent;
        public event OnShortBinaryValueChangedDelegate OnShortBinaryValueChangedEvent;
        public event OnShortBinaryValueDeletedDelegate OnShortBinaryValueDeletedEvent;

        public event OnShortStringValueInsertedDelegate OnShortStringValueInsertedEvent;
        public event OnShortStringValueChangedDelegate OnShortStringValueChangedEvent;
        public event OnShortStringValueDeletedDelegate OnShortStringValueDeletedEvent;

        public event OnShortValueInsertedDelegate OnShortValueInsertedEvent;
        public event OnShortValueChangedDelegate OnShortValueChangedEvent;
        public event OnShortValueDeletedDelegate OnShortValueDeletedEvent;

        public event OnStringValueInsertedDelegate OnStringValueInsertedEvent;
        public event OnStringValueChangedDelegate OnStringValueChangedEvent;
        public event OnStringValueDeletedDelegate OnStringValueDeletedEvent;

        public event OnTimeSpanValueInsertedDelegate OnTimeSpanValueInsertedEvent;
        public event OnTimeSpanValueChangedDelegate OnTimeSpanValueChangedEvent;
        public event OnTimeSpanValueDeletedDelegate OnTimeSpanValueDeletedEvent;

        public event OnUIntValueInsertedDelegate OnUIntValueInsertedEvent;
        public event OnUIntValueChangedDelegate OnUIntValueChangedEvent;
        public event OnUIntValueDeletedDelegate OnUIntValueDeletedEvent;

        public event OnULongValueInsertedDelegate OnULongValueInsertedEvent;
        public event OnULongValueChangedDelegate OnULongValueChangedEvent;
        public event OnULongValueDeletedDelegate OnULongValueDeletedEvent;

        public event OnUShortValueInsertedDelegate OnUShortValueInsertedEvent;
        public event OnUShortValueChangedDelegate OnUShortValueChangedEvent;
        public event OnUShortValueDeletedDelegate OnUShortValueDeletedEvent;


        public List<NodeElementData> GetAllNodes( )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<NodeElementData> result = NodeElementAccessor.GetAll();
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public NodeElementData GetNodeById( long id )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    NodeElementData result = NodeElementAccessor.GetById(id );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public NodeElementData GetNodeByParentAndName( long? parent, string name )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    NodeElementData result = NodeElementAccessor.GetByParentAndName(parent,name );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<NodeElementData> GetNodeByParent( long? parent )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<NodeElementData> result = NodeElementAccessor.GetByParent(parent );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public NodeElementData SaveNode( Guid clientId, NodeElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    NodeElementData result = null;
                    int recordsSaved = NodeElementAccessor.Save( element, out result );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public NodeElementData InsertNode( Guid clientId, NodeElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    NodeElementData result = null;
                    int recordsInserted = NodeElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnNodeInsertedEvent != null )
                        {
                            OnNodeInsertedEventArgs eventArgs = new OnNodeInsertedEventArgs( clientId, result );
                            OnNodeInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertNodeList( Guid clientId, List<NodeElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    NodeElementAccessor.Insert( elements );
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public NodeElementData UpdateNode( Guid clientId, NodeElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    NodeElementData result = null;
                    int recordsUpdated = NodeElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnNodeChangedEvent != null )
                        {
                            OnNodeChangedEventArgs eventArgs = new OnNodeChangedEventArgs( clientId, result );
                            OnNodeChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteNode( Guid clientId,  long id, long optimisticLock )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = NodeElementAccessor.Delete(id,optimisticLock);
                    if( result != 0)
                    {
                        if( OnNodeDeletedEvent != null )
                        {
                            OnNodeDeletedEventArgs eventArgs = new OnNodeDeletedEventArgs( clientId, id);
                            OnNodeDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<ItemElementData> GetAllItems( )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<ItemElementData> result = ItemElementAccessor.GetAll();
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ItemElementData GetItemById( long id )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ItemElementData result = ItemElementAccessor.GetById(id );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ItemElementData GetItemByNodeAndName( long node, string name )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ItemElementData result = ItemElementAccessor.GetByNodeAndName(node,name );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<ItemElementData> GetItemByNode( long node )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<ItemElementData> result = ItemElementAccessor.GetByNode(node );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ItemElementData SaveItem( Guid clientId, ItemElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ItemElementData result = null;
                    int recordsSaved = ItemElementAccessor.Save( element, out result );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ItemElementData InsertItem( Guid clientId, ItemElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ItemElementData result = null;
                    int recordsInserted = ItemElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnItemInsertedEvent != null )
                        {
                            OnItemInsertedEventArgs eventArgs = new OnItemInsertedEventArgs( clientId, result );
                            OnItemInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertItemList( Guid clientId, List<ItemElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ItemElementAccessor.Insert( elements );
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ItemElementData UpdateItem( Guid clientId, ItemElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ItemElementData result = null;
                    int recordsUpdated = ItemElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnItemChangedEvent != null )
                        {
                            OnItemChangedEventArgs eventArgs = new OnItemChangedEventArgs( clientId, result );
                            OnItemChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteItem( Guid clientId,  long id, long optimisticLock )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = ItemElementAccessor.Delete(id,optimisticLock);
                    if( result != 0)
                    {
                        if( OnItemDeletedEvent != null )
                        {
                            OnItemDeletedEventArgs eventArgs = new OnItemDeletedEventArgs( clientId, id);
                            OnItemDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<TagTypeElementData> GetAllTagTypes( )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<TagTypeElementData> result = TagTypeElementAccessor.GetAll();
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public TagTypeElementData GetTagTypeById( long id )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    TagTypeElementData result = TagTypeElementAccessor.GetById(id );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public TagTypeElementData GetTagTypeByName( string name )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    TagTypeElementData result = TagTypeElementAccessor.GetByName(name );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public TagTypeElementData InsertTagType( Guid clientId, TagTypeElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    TagTypeElementData result = null;
                    int recordsInserted = TagTypeElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnTagTypeInsertedEvent != null )
                        {
                            OnTagTypeInsertedEventArgs eventArgs = new OnTagTypeInsertedEventArgs( clientId, result );
                            OnTagTypeInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertTagTypeList( Guid clientId, List<TagTypeElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    TagTypeElementAccessor.Insert( elements );
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public TagTypeElementData UpdateTagType( Guid clientId, TagTypeElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    TagTypeElementData result = null;
                    int recordsUpdated = TagTypeElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnTagTypeChangedEvent != null )
                        {
                            OnTagTypeChangedEventArgs eventArgs = new OnTagTypeChangedEventArgs( clientId, result );
                            OnTagTypeChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteTagType( Guid clientId,  long id )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = TagTypeElementAccessor.Delete(id);
                    if( result != 0)
                    {
                        if( OnTagTypeDeletedEvent != null )
                        {
                            OnTagTypeDeletedEventArgs eventArgs = new OnTagTypeDeletedEventArgs( clientId, id);
                            OnTagTypeDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<EnumerationElementData> GetAllEnumerations( )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<EnumerationElementData> result = EnumerationElementAccessor.GetAll();
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public EnumerationElementData GetEnumerationById( long id )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    EnumerationElementData result = EnumerationElementAccessor.GetById(id );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public EnumerationElementData GetEnumerationByName( string name )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    EnumerationElementData result = EnumerationElementAccessor.GetByName(name );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public EnumerationElementData SaveEnumeration( Guid clientId, EnumerationElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    EnumerationElementData result = null;
                    int recordsSaved = EnumerationElementAccessor.Save( element, out result );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public EnumerationElementData InsertEnumeration( Guid clientId, EnumerationElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    EnumerationElementData result = null;
                    int recordsInserted = EnumerationElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnEnumerationInsertedEvent != null )
                        {
                            OnEnumerationInsertedEventArgs eventArgs = new OnEnumerationInsertedEventArgs( clientId, result );
                            OnEnumerationInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertEnumerationList( Guid clientId, List<EnumerationElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    EnumerationElementAccessor.Insert( elements );
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public EnumerationElementData UpdateEnumeration( Guid clientId, EnumerationElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    EnumerationElementData result = null;
                    int recordsUpdated = EnumerationElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnEnumerationChangedEvent != null )
                        {
                            OnEnumerationChangedEventArgs eventArgs = new OnEnumerationChangedEventArgs( clientId, result );
                            OnEnumerationChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteEnumeration( Guid clientId,  long id, long optimisticLock )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = EnumerationElementAccessor.Delete(id,optimisticLock);
                    if( result != 0)
                    {
                        if( OnEnumerationDeletedEvent != null )
                        {
                            OnEnumerationDeletedEventArgs eventArgs = new OnEnumerationDeletedEventArgs( clientId, id);
                            OnEnumerationDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<EnumerationValueElementData> GetAllEnumerationValues( )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<EnumerationValueElementData> result = EnumerationValueElementAccessor.GetAll();
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public EnumerationValueElementData GetEnumerationValueById( long id )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    EnumerationValueElementData result = EnumerationValueElementAccessor.GetById(id );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public EnumerationValueElementData GetEnumerationValueByEnumerationAndName( long enumeration, string name )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    EnumerationValueElementData result = EnumerationValueElementAccessor.GetByEnumerationAndName(enumeration,name );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public EnumerationValueElementData GetEnumerationValueByEnumerationAndValue( long enumeration, long value )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    EnumerationValueElementData result = EnumerationValueElementAccessor.GetByEnumerationAndValue(enumeration,value );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<EnumerationValueElementData> GetEnumerationValueByEnumeration( long enumeration )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<EnumerationValueElementData> result = EnumerationValueElementAccessor.GetByEnumeration(enumeration );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public EnumerationValueElementData SaveEnumerationValue( Guid clientId, EnumerationValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    EnumerationValueElementData result = null;
                    int recordsSaved = EnumerationValueElementAccessor.Save( element, out result );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public EnumerationValueElementData InsertEnumerationValue( Guid clientId, EnumerationValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    EnumerationValueElementData result = null;
                    int recordsInserted = EnumerationValueElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnEnumerationValueInsertedEvent != null )
                        {
                            OnEnumerationValueInsertedEventArgs eventArgs = new OnEnumerationValueInsertedEventArgs( clientId, result );
                            OnEnumerationValueInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertEnumerationValueList( Guid clientId, List<EnumerationValueElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    EnumerationValueElementAccessor.Insert( elements );
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public EnumerationValueElementData UpdateEnumerationValue( Guid clientId, EnumerationValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    EnumerationValueElementData result = null;
                    int recordsUpdated = EnumerationValueElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnEnumerationValueChangedEvent != null )
                        {
                            OnEnumerationValueChangedEventArgs eventArgs = new OnEnumerationValueChangedEventArgs( clientId, result );
                            OnEnumerationValueChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteEnumerationValue( Guid clientId,  long id, long optimisticLock )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = EnumerationValueElementAccessor.Delete(id,optimisticLock);
                    if( result != 0)
                    {
                        if( OnEnumerationValueDeletedEvent != null )
                        {
                            OnEnumerationValueDeletedEventArgs eventArgs = new OnEnumerationValueDeletedEventArgs( clientId, id);
                            OnEnumerationValueDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<TagElementData> GetAllTags( )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<TagElementData> result = TagElementAccessor.GetAll();
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public TagElementData GetTagById( long id )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    TagElementData result = TagElementAccessor.GetById(id );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public TagElementData GetTagByItemAndName( long item, string name )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    TagElementData result = TagElementAccessor.GetByItemAndName(item,name );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<TagElementData> GetTagByEnumeration( long? enumeration )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<TagElementData> result = TagElementAccessor.GetByEnumeration(enumeration );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<TagElementData> GetTagByType( long type )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<TagElementData> result = TagElementAccessor.GetByType(type );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<TagElementData> GetTagByItem( long item )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<TagElementData> result = TagElementAccessor.GetByItem(item );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public TagElementData SaveTag( Guid clientId, TagElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    TagElementData result = null;
                    int recordsSaved = TagElementAccessor.Save( element, out result );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public TagElementData InsertTag( Guid clientId, TagElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    TagElementData result = null;
                    int recordsInserted = TagElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnTagInsertedEvent != null )
                        {
                            OnTagInsertedEventArgs eventArgs = new OnTagInsertedEventArgs( clientId, result );
                            OnTagInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertTagList( Guid clientId, List<TagElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    TagElementAccessor.Insert( elements );
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public TagElementData UpdateTag( Guid clientId, TagElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    TagElementData result = null;
                    int recordsUpdated = TagElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnTagChangedEvent != null )
                        {
                            OnTagChangedEventArgs eventArgs = new OnTagChangedEventArgs( clientId, result );
                            OnTagChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteTag( Guid clientId,  long id, long optimisticLock )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = TagElementAccessor.Delete(id,optimisticLock);
                    if( result != 0)
                    {
                        if( OnTagDeletedEvent != null )
                        {
                            OnTagDeletedEventArgs eventArgs = new OnTagDeletedEventArgs( clientId, id);
                            OnTagDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<BinaryValueElementData> GetAllBinaryValues( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<BinaryValueElementData> result = BinaryValueElementAccessor.GetAll( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public BinaryValueElementData GetBinaryValueByTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    BinaryValueElementData result = BinaryValueElementAccessor.GetByTimeStamp( tag, ts );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public BinaryValueElementData GetBinaryValueForTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    BinaryValueElementData result = BinaryValueElementAccessor.GetBinaryValueForTimeStamp( tag, ts);
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public BinaryValueElementData GetBinaryValueForLastTimeStamp( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    BinaryValueElementData result = BinaryValueElementAccessor.GetBinaryValueForLastTimeStamp( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<BinaryValueElementData> GetBinaryValueForInterval( long tag, DateTime startOfInterval, DateTime endOfInterval )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<BinaryValueElementData> result = BinaryValueElementAccessor.GetBinaryValueForInterval( tag, startOfInterval, endOfInterval );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }


        public BinaryValueElementData InsertBinaryValue( Guid clientId, BinaryValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    BinaryValueElementData result = null;
                    int recordsInserted = BinaryValueElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnBinaryValueInsertedEvent != null )
                        {
                            OnBinaryValueInsertedEventArgs eventArgs = new OnBinaryValueInsertedEventArgs( clientId, result );
                            OnBinaryValueInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertBinaryValueList( Guid clientId, List<BinaryValueElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    if(elements.Count > 0)
                    {
                        BinaryValueElementAccessor.Insert( elements );
                    }
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public BinaryValueElementData UpdateBinaryValue( Guid clientId, BinaryValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    BinaryValueElementData result = null;
                    int recordsUpdated = BinaryValueElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnBinaryValueChangedEvent != null )
                        {
                            OnBinaryValueChangedEventArgs eventArgs = new OnBinaryValueChangedEventArgs( clientId, result );
                            OnBinaryValueChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteBinaryValue( Guid clientId, long tag,  DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = BinaryValueElementAccessor.Delete( tag, ts);
                    if( result != 0)
                    {
                        if( OnBinaryValueDeletedEvent != null )
                        {
                            OnBinaryValueDeletedEventArgs eventArgs = new OnBinaryValueDeletedEventArgs( clientId, tag,ts);
                            OnBinaryValueDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<BooleanValueElementData> GetAllBooleanValues( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<BooleanValueElementData> result = BooleanValueElementAccessor.GetAll( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public BooleanValueElementData GetBooleanValueByTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    BooleanValueElementData result = BooleanValueElementAccessor.GetByTimeStamp( tag, ts );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public BooleanValueElementData GetBooleanValueForTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    BooleanValueElementData result = BooleanValueElementAccessor.GetBooleanValueForTimeStamp( tag, ts);
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public BooleanValueElementData GetBooleanValueForLastTimeStamp( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    BooleanValueElementData result = BooleanValueElementAccessor.GetBooleanValueForLastTimeStamp( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<BooleanValueElementData> GetBooleanValueForInterval( long tag, DateTime startOfInterval, DateTime endOfInterval )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<BooleanValueElementData> result = BooleanValueElementAccessor.GetBooleanValueForInterval( tag, startOfInterval, endOfInterval );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }


        public BooleanValueElementData InsertBooleanValue( Guid clientId, BooleanValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    BooleanValueElementData result = null;
                    int recordsInserted = BooleanValueElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnBooleanValueInsertedEvent != null )
                        {
                            OnBooleanValueInsertedEventArgs eventArgs = new OnBooleanValueInsertedEventArgs( clientId, result );
                            OnBooleanValueInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertBooleanValueList( Guid clientId, List<BooleanValueElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    if(elements.Count > 0)
                    {
                        BooleanValueElementAccessor.Insert( elements );
                    }
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public BooleanValueElementData UpdateBooleanValue( Guid clientId, BooleanValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    BooleanValueElementData result = null;
                    int recordsUpdated = BooleanValueElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnBooleanValueChangedEvent != null )
                        {
                            OnBooleanValueChangedEventArgs eventArgs = new OnBooleanValueChangedEventArgs( clientId, result );
                            OnBooleanValueChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteBooleanValue( Guid clientId, long tag,  DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = BooleanValueElementAccessor.Delete( tag, ts);
                    if( result != 0)
                    {
                        if( OnBooleanValueDeletedEvent != null )
                        {
                            OnBooleanValueDeletedEventArgs eventArgs = new OnBooleanValueDeletedEventArgs( clientId, tag,ts);
                            OnBooleanValueDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<ByteValueElementData> GetAllByteValues( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<ByteValueElementData> result = ByteValueElementAccessor.GetAll( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ByteValueElementData GetByteValueByTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ByteValueElementData result = ByteValueElementAccessor.GetByTimeStamp( tag, ts );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ByteValueElementData GetByteValueForTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ByteValueElementData result = ByteValueElementAccessor.GetByteValueForTimeStamp( tag, ts);
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ByteValueElementData GetByteValueForLastTimeStamp( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ByteValueElementData result = ByteValueElementAccessor.GetByteValueForLastTimeStamp( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<ByteValueElementData> GetByteValueForInterval( long tag, DateTime startOfInterval, DateTime endOfInterval )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<ByteValueElementData> result = ByteValueElementAccessor.GetByteValueForInterval( tag, startOfInterval, endOfInterval );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }


        public ByteValueElementData InsertByteValue( Guid clientId, ByteValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ByteValueElementData result = null;
                    int recordsInserted = ByteValueElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnByteValueInsertedEvent != null )
                        {
                            OnByteValueInsertedEventArgs eventArgs = new OnByteValueInsertedEventArgs( clientId, result );
                            OnByteValueInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertByteValueList( Guid clientId, List<ByteValueElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    if(elements.Count > 0)
                    {
                        ByteValueElementAccessor.Insert( elements );
                    }
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ByteValueElementData UpdateByteValue( Guid clientId, ByteValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ByteValueElementData result = null;
                    int recordsUpdated = ByteValueElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnByteValueChangedEvent != null )
                        {
                            OnByteValueChangedEventArgs eventArgs = new OnByteValueChangedEventArgs( clientId, result );
                            OnByteValueChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteByteValue( Guid clientId, long tag,  DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = ByteValueElementAccessor.Delete( tag, ts);
                    if( result != 0)
                    {
                        if( OnByteValueDeletedEvent != null )
                        {
                            OnByteValueDeletedEventArgs eventArgs = new OnByteValueDeletedEventArgs( clientId, tag,ts);
                            OnByteValueDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<DateTimeValueElementData> GetAllDateTimeValues( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<DateTimeValueElementData> result = DateTimeValueElementAccessor.GetAll( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public DateTimeValueElementData GetDateTimeValueByTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    DateTimeValueElementData result = DateTimeValueElementAccessor.GetByTimeStamp( tag, ts );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public DateTimeValueElementData GetDateTimeValueForTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    DateTimeValueElementData result = DateTimeValueElementAccessor.GetDateTimeValueForTimeStamp( tag, ts);
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public DateTimeValueElementData GetDateTimeValueForLastTimeStamp( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    DateTimeValueElementData result = DateTimeValueElementAccessor.GetDateTimeValueForLastTimeStamp( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<DateTimeValueElementData> GetDateTimeValueForInterval( long tag, DateTime startOfInterval, DateTime endOfInterval )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<DateTimeValueElementData> result = DateTimeValueElementAccessor.GetDateTimeValueForInterval( tag, startOfInterval, endOfInterval );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }


        public DateTimeValueElementData InsertDateTimeValue( Guid clientId, DateTimeValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    DateTimeValueElementData result = null;
                    int recordsInserted = DateTimeValueElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnDateTimeValueInsertedEvent != null )
                        {
                            OnDateTimeValueInsertedEventArgs eventArgs = new OnDateTimeValueInsertedEventArgs( clientId, result );
                            OnDateTimeValueInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertDateTimeValueList( Guid clientId, List<DateTimeValueElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    if(elements.Count > 0)
                    {
                        DateTimeValueElementAccessor.Insert( elements );
                    }
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public DateTimeValueElementData UpdateDateTimeValue( Guid clientId, DateTimeValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    DateTimeValueElementData result = null;
                    int recordsUpdated = DateTimeValueElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnDateTimeValueChangedEvent != null )
                        {
                            OnDateTimeValueChangedEventArgs eventArgs = new OnDateTimeValueChangedEventArgs( clientId, result );
                            OnDateTimeValueChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteDateTimeValue( Guid clientId, long tag,  DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = DateTimeValueElementAccessor.Delete( tag, ts);
                    if( result != 0)
                    {
                        if( OnDateTimeValueDeletedEvent != null )
                        {
                            OnDateTimeValueDeletedEventArgs eventArgs = new OnDateTimeValueDeletedEventArgs( clientId, tag,ts);
                            OnDateTimeValueDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<DoubleValueElementData> GetAllDoubleValues( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<DoubleValueElementData> result = DoubleValueElementAccessor.GetAll( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public DoubleValueElementData GetDoubleValueByTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    DoubleValueElementData result = DoubleValueElementAccessor.GetByTimeStamp( tag, ts );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public DoubleValueElementData GetDoubleValueForTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    DoubleValueElementData result = DoubleValueElementAccessor.GetDoubleValueForTimeStamp( tag, ts);
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public DoubleValueElementData GetDoubleValueForLastTimeStamp( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    DoubleValueElementData result = DoubleValueElementAccessor.GetDoubleValueForLastTimeStamp( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<DoubleValueElementData> GetDoubleValueForInterval( long tag, DateTime startOfInterval, DateTime endOfInterval )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<DoubleValueElementData> result = DoubleValueElementAccessor.GetDoubleValueForInterval( tag, startOfInterval, endOfInterval );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }


        public DoubleValueElementData InsertDoubleValue( Guid clientId, DoubleValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    DoubleValueElementData result = null;
                    int recordsInserted = DoubleValueElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnDoubleValueInsertedEvent != null )
                        {
                            OnDoubleValueInsertedEventArgs eventArgs = new OnDoubleValueInsertedEventArgs( clientId, result );
                            OnDoubleValueInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertDoubleValueList( Guid clientId, List<DoubleValueElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    if(elements.Count > 0)
                    {
                        DoubleValueElementAccessor.Insert( elements );
                    }
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public DoubleValueElementData UpdateDoubleValue( Guid clientId, DoubleValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    DoubleValueElementData result = null;
                    int recordsUpdated = DoubleValueElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnDoubleValueChangedEvent != null )
                        {
                            OnDoubleValueChangedEventArgs eventArgs = new OnDoubleValueChangedEventArgs( clientId, result );
                            OnDoubleValueChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteDoubleValue( Guid clientId, long tag,  DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = DoubleValueElementAccessor.Delete( tag, ts);
                    if( result != 0)
                    {
                        if( OnDoubleValueDeletedEvent != null )
                        {
                            OnDoubleValueDeletedEventArgs eventArgs = new OnDoubleValueDeletedEventArgs( clientId, tag,ts);
                            OnDoubleValueDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<EnumeratedValueElementData> GetAllEnumeratedValues( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<EnumeratedValueElementData> result = EnumeratedValueElementAccessor.GetAll( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public EnumeratedValueElementData GetEnumeratedValueByTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    EnumeratedValueElementData result = EnumeratedValueElementAccessor.GetByTimeStamp( tag, ts );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public EnumeratedValueElementData GetEnumeratedValueForTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    EnumeratedValueElementData result = EnumeratedValueElementAccessor.GetEnumeratedValueForTimeStamp( tag, ts);
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public EnumeratedValueElementData GetEnumeratedValueForLastTimeStamp( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    EnumeratedValueElementData result = EnumeratedValueElementAccessor.GetEnumeratedValueForLastTimeStamp( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<EnumeratedValueElementData> GetEnumeratedValueForInterval( long tag, DateTime startOfInterval, DateTime endOfInterval )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<EnumeratedValueElementData> result = EnumeratedValueElementAccessor.GetEnumeratedValueForInterval( tag, startOfInterval, endOfInterval );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }


        public EnumeratedValueElementData InsertEnumeratedValue( Guid clientId, EnumeratedValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    EnumeratedValueElementData result = null;
                    int recordsInserted = EnumeratedValueElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnEnumeratedValueInsertedEvent != null )
                        {
                            OnEnumeratedValueInsertedEventArgs eventArgs = new OnEnumeratedValueInsertedEventArgs( clientId, result );
                            OnEnumeratedValueInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertEnumeratedValueList( Guid clientId, List<EnumeratedValueElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    if(elements.Count > 0)
                    {
                        EnumeratedValueElementAccessor.Insert( elements );
                    }
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public EnumeratedValueElementData UpdateEnumeratedValue( Guid clientId, EnumeratedValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    EnumeratedValueElementData result = null;
                    int recordsUpdated = EnumeratedValueElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnEnumeratedValueChangedEvent != null )
                        {
                            OnEnumeratedValueChangedEventArgs eventArgs = new OnEnumeratedValueChangedEventArgs( clientId, result );
                            OnEnumeratedValueChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteEnumeratedValue( Guid clientId, long tag,  DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = EnumeratedValueElementAccessor.Delete( tag, ts);
                    if( result != 0)
                    {
                        if( OnEnumeratedValueDeletedEvent != null )
                        {
                            OnEnumeratedValueDeletedEventArgs eventArgs = new OnEnumeratedValueDeletedEventArgs( clientId, tag,ts);
                            OnEnumeratedValueDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<FloatValueElementData> GetAllFloatValues( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<FloatValueElementData> result = FloatValueElementAccessor.GetAll( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public FloatValueElementData GetFloatValueByTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    FloatValueElementData result = FloatValueElementAccessor.GetByTimeStamp( tag, ts );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public FloatValueElementData GetFloatValueForTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    FloatValueElementData result = FloatValueElementAccessor.GetFloatValueForTimeStamp( tag, ts);
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public FloatValueElementData GetFloatValueForLastTimeStamp( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    FloatValueElementData result = FloatValueElementAccessor.GetFloatValueForLastTimeStamp( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<FloatValueElementData> GetFloatValueForInterval( long tag, DateTime startOfInterval, DateTime endOfInterval )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<FloatValueElementData> result = FloatValueElementAccessor.GetFloatValueForInterval( tag, startOfInterval, endOfInterval );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }


        public FloatValueElementData InsertFloatValue( Guid clientId, FloatValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    FloatValueElementData result = null;
                    int recordsInserted = FloatValueElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnFloatValueInsertedEvent != null )
                        {
                            OnFloatValueInsertedEventArgs eventArgs = new OnFloatValueInsertedEventArgs( clientId, result );
                            OnFloatValueInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertFloatValueList( Guid clientId, List<FloatValueElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    if(elements.Count > 0)
                    {
                        FloatValueElementAccessor.Insert( elements );
                    }
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public FloatValueElementData UpdateFloatValue( Guid clientId, FloatValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    FloatValueElementData result = null;
                    int recordsUpdated = FloatValueElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnFloatValueChangedEvent != null )
                        {
                            OnFloatValueChangedEventArgs eventArgs = new OnFloatValueChangedEventArgs( clientId, result );
                            OnFloatValueChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteFloatValue( Guid clientId, long tag,  DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = FloatValueElementAccessor.Delete( tag, ts);
                    if( result != 0)
                    {
                        if( OnFloatValueDeletedEvent != null )
                        {
                            OnFloatValueDeletedEventArgs eventArgs = new OnFloatValueDeletedEventArgs( clientId, tag,ts);
                            OnFloatValueDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<IntValueElementData> GetAllIntValues( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<IntValueElementData> result = IntValueElementAccessor.GetAll( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public IntValueElementData GetIntValueByTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    IntValueElementData result = IntValueElementAccessor.GetByTimeStamp( tag, ts );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public IntValueElementData GetIntValueForTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    IntValueElementData result = IntValueElementAccessor.GetIntValueForTimeStamp( tag, ts);
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public IntValueElementData GetIntValueForLastTimeStamp( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    IntValueElementData result = IntValueElementAccessor.GetIntValueForLastTimeStamp( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<IntValueElementData> GetIntValueForInterval( long tag, DateTime startOfInterval, DateTime endOfInterval )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<IntValueElementData> result = IntValueElementAccessor.GetIntValueForInterval( tag, startOfInterval, endOfInterval );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }


        public IntValueElementData InsertIntValue( Guid clientId, IntValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    IntValueElementData result = null;
                    int recordsInserted = IntValueElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnIntValueInsertedEvent != null )
                        {
                            OnIntValueInsertedEventArgs eventArgs = new OnIntValueInsertedEventArgs( clientId, result );
                            OnIntValueInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertIntValueList( Guid clientId, List<IntValueElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    if(elements.Count > 0)
                    {
                        IntValueElementAccessor.Insert( elements );
                    }
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public IntValueElementData UpdateIntValue( Guid clientId, IntValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    IntValueElementData result = null;
                    int recordsUpdated = IntValueElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnIntValueChangedEvent != null )
                        {
                            OnIntValueChangedEventArgs eventArgs = new OnIntValueChangedEventArgs( clientId, result );
                            OnIntValueChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteIntValue( Guid clientId, long tag,  DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = IntValueElementAccessor.Delete( tag, ts);
                    if( result != 0)
                    {
                        if( OnIntValueDeletedEvent != null )
                        {
                            OnIntValueDeletedEventArgs eventArgs = new OnIntValueDeletedEventArgs( clientId, tag,ts);
                            OnIntValueDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<LongValueElementData> GetAllLongValues( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<LongValueElementData> result = LongValueElementAccessor.GetAll( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public LongValueElementData GetLongValueByTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    LongValueElementData result = LongValueElementAccessor.GetByTimeStamp( tag, ts );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public LongValueElementData GetLongValueForTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    LongValueElementData result = LongValueElementAccessor.GetLongValueForTimeStamp( tag, ts);
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public LongValueElementData GetLongValueForLastTimeStamp( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    LongValueElementData result = LongValueElementAccessor.GetLongValueForLastTimeStamp( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<LongValueElementData> GetLongValueForInterval( long tag, DateTime startOfInterval, DateTime endOfInterval )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<LongValueElementData> result = LongValueElementAccessor.GetLongValueForInterval( tag, startOfInterval, endOfInterval );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }


        public LongValueElementData InsertLongValue( Guid clientId, LongValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    LongValueElementData result = null;
                    int recordsInserted = LongValueElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnLongValueInsertedEvent != null )
                        {
                            OnLongValueInsertedEventArgs eventArgs = new OnLongValueInsertedEventArgs( clientId, result );
                            OnLongValueInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertLongValueList( Guid clientId, List<LongValueElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    if(elements.Count > 0)
                    {
                        LongValueElementAccessor.Insert( elements );
                    }
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public LongValueElementData UpdateLongValue( Guid clientId, LongValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    LongValueElementData result = null;
                    int recordsUpdated = LongValueElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnLongValueChangedEvent != null )
                        {
                            OnLongValueChangedEventArgs eventArgs = new OnLongValueChangedEventArgs( clientId, result );
                            OnLongValueChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteLongValue( Guid clientId, long tag,  DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = LongValueElementAccessor.Delete( tag, ts);
                    if( result != 0)
                    {
                        if( OnLongValueDeletedEvent != null )
                        {
                            OnLongValueDeletedEventArgs eventArgs = new OnLongValueDeletedEventArgs( clientId, tag,ts);
                            OnLongValueDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<SByteValueElementData> GetAllSByteValues( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<SByteValueElementData> result = SByteValueElementAccessor.GetAll( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public SByteValueElementData GetSByteValueByTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    SByteValueElementData result = SByteValueElementAccessor.GetByTimeStamp( tag, ts );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public SByteValueElementData GetSByteValueForTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    SByteValueElementData result = SByteValueElementAccessor.GetSByteValueForTimeStamp( tag, ts);
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public SByteValueElementData GetSByteValueForLastTimeStamp( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    SByteValueElementData result = SByteValueElementAccessor.GetSByteValueForLastTimeStamp( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<SByteValueElementData> GetSByteValueForInterval( long tag, DateTime startOfInterval, DateTime endOfInterval )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<SByteValueElementData> result = SByteValueElementAccessor.GetSByteValueForInterval( tag, startOfInterval, endOfInterval );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }


        public SByteValueElementData InsertSByteValue( Guid clientId, SByteValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    SByteValueElementData result = null;
                    int recordsInserted = SByteValueElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnSByteValueInsertedEvent != null )
                        {
                            OnSByteValueInsertedEventArgs eventArgs = new OnSByteValueInsertedEventArgs( clientId, result );
                            OnSByteValueInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertSByteValueList( Guid clientId, List<SByteValueElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    if(elements.Count > 0)
                    {
                        SByteValueElementAccessor.Insert( elements );
                    }
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public SByteValueElementData UpdateSByteValue( Guid clientId, SByteValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    SByteValueElementData result = null;
                    int recordsUpdated = SByteValueElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnSByteValueChangedEvent != null )
                        {
                            OnSByteValueChangedEventArgs eventArgs = new OnSByteValueChangedEventArgs( clientId, result );
                            OnSByteValueChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteSByteValue( Guid clientId, long tag,  DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = SByteValueElementAccessor.Delete( tag, ts);
                    if( result != 0)
                    {
                        if( OnSByteValueDeletedEvent != null )
                        {
                            OnSByteValueDeletedEventArgs eventArgs = new OnSByteValueDeletedEventArgs( clientId, tag,ts);
                            OnSByteValueDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<ShortBinaryValueElementData> GetAllShortBinaryValues( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<ShortBinaryValueElementData> result = ShortBinaryValueElementAccessor.GetAll( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ShortBinaryValueElementData GetShortBinaryValueByTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ShortBinaryValueElementData result = ShortBinaryValueElementAccessor.GetByTimeStamp( tag, ts );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ShortBinaryValueElementData GetShortBinaryValueForTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ShortBinaryValueElementData result = ShortBinaryValueElementAccessor.GetShortBinaryValueForTimeStamp( tag, ts);
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ShortBinaryValueElementData GetShortBinaryValueForLastTimeStamp( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ShortBinaryValueElementData result = ShortBinaryValueElementAccessor.GetShortBinaryValueForLastTimeStamp( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<ShortBinaryValueElementData> GetShortBinaryValueForInterval( long tag, DateTime startOfInterval, DateTime endOfInterval )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<ShortBinaryValueElementData> result = ShortBinaryValueElementAccessor.GetShortBinaryValueForInterval( tag, startOfInterval, endOfInterval );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }


        public ShortBinaryValueElementData InsertShortBinaryValue( Guid clientId, ShortBinaryValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ShortBinaryValueElementData result = null;
                    int recordsInserted = ShortBinaryValueElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnShortBinaryValueInsertedEvent != null )
                        {
                            OnShortBinaryValueInsertedEventArgs eventArgs = new OnShortBinaryValueInsertedEventArgs( clientId, result );
                            OnShortBinaryValueInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertShortBinaryValueList( Guid clientId, List<ShortBinaryValueElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    if(elements.Count > 0)
                    {
                        ShortBinaryValueElementAccessor.Insert( elements );
                    }
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ShortBinaryValueElementData UpdateShortBinaryValue( Guid clientId, ShortBinaryValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ShortBinaryValueElementData result = null;
                    int recordsUpdated = ShortBinaryValueElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnShortBinaryValueChangedEvent != null )
                        {
                            OnShortBinaryValueChangedEventArgs eventArgs = new OnShortBinaryValueChangedEventArgs( clientId, result );
                            OnShortBinaryValueChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteShortBinaryValue( Guid clientId, long tag,  DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = ShortBinaryValueElementAccessor.Delete( tag, ts);
                    if( result != 0)
                    {
                        if( OnShortBinaryValueDeletedEvent != null )
                        {
                            OnShortBinaryValueDeletedEventArgs eventArgs = new OnShortBinaryValueDeletedEventArgs( clientId, tag,ts);
                            OnShortBinaryValueDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<ShortStringValueElementData> GetAllShortStringValues( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<ShortStringValueElementData> result = ShortStringValueElementAccessor.GetAll( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ShortStringValueElementData GetShortStringValueByTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ShortStringValueElementData result = ShortStringValueElementAccessor.GetByTimeStamp( tag, ts );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ShortStringValueElementData GetShortStringValueForTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ShortStringValueElementData result = ShortStringValueElementAccessor.GetShortStringValueForTimeStamp( tag, ts);
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ShortStringValueElementData GetShortStringValueForLastTimeStamp( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ShortStringValueElementData result = ShortStringValueElementAccessor.GetShortStringValueForLastTimeStamp( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<ShortStringValueElementData> GetShortStringValueForInterval( long tag, DateTime startOfInterval, DateTime endOfInterval )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<ShortStringValueElementData> result = ShortStringValueElementAccessor.GetShortStringValueForInterval( tag, startOfInterval, endOfInterval );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }


        public ShortStringValueElementData InsertShortStringValue( Guid clientId, ShortStringValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ShortStringValueElementData result = null;
                    int recordsInserted = ShortStringValueElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnShortStringValueInsertedEvent != null )
                        {
                            OnShortStringValueInsertedEventArgs eventArgs = new OnShortStringValueInsertedEventArgs( clientId, result );
                            OnShortStringValueInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertShortStringValueList( Guid clientId, List<ShortStringValueElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    if(elements.Count > 0)
                    {
                        ShortStringValueElementAccessor.Insert( elements );
                    }
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ShortStringValueElementData UpdateShortStringValue( Guid clientId, ShortStringValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ShortStringValueElementData result = null;
                    int recordsUpdated = ShortStringValueElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnShortStringValueChangedEvent != null )
                        {
                            OnShortStringValueChangedEventArgs eventArgs = new OnShortStringValueChangedEventArgs( clientId, result );
                            OnShortStringValueChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteShortStringValue( Guid clientId, long tag,  DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = ShortStringValueElementAccessor.Delete( tag, ts);
                    if( result != 0)
                    {
                        if( OnShortStringValueDeletedEvent != null )
                        {
                            OnShortStringValueDeletedEventArgs eventArgs = new OnShortStringValueDeletedEventArgs( clientId, tag,ts);
                            OnShortStringValueDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<ShortValueElementData> GetAllShortValues( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<ShortValueElementData> result = ShortValueElementAccessor.GetAll( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ShortValueElementData GetShortValueByTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ShortValueElementData result = ShortValueElementAccessor.GetByTimeStamp( tag, ts );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ShortValueElementData GetShortValueForTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ShortValueElementData result = ShortValueElementAccessor.GetShortValueForTimeStamp( tag, ts);
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ShortValueElementData GetShortValueForLastTimeStamp( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ShortValueElementData result = ShortValueElementAccessor.GetShortValueForLastTimeStamp( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<ShortValueElementData> GetShortValueForInterval( long tag, DateTime startOfInterval, DateTime endOfInterval )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<ShortValueElementData> result = ShortValueElementAccessor.GetShortValueForInterval( tag, startOfInterval, endOfInterval );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }


        public ShortValueElementData InsertShortValue( Guid clientId, ShortValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ShortValueElementData result = null;
                    int recordsInserted = ShortValueElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnShortValueInsertedEvent != null )
                        {
                            OnShortValueInsertedEventArgs eventArgs = new OnShortValueInsertedEventArgs( clientId, result );
                            OnShortValueInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertShortValueList( Guid clientId, List<ShortValueElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    if(elements.Count > 0)
                    {
                        ShortValueElementAccessor.Insert( elements );
                    }
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ShortValueElementData UpdateShortValue( Guid clientId, ShortValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ShortValueElementData result = null;
                    int recordsUpdated = ShortValueElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnShortValueChangedEvent != null )
                        {
                            OnShortValueChangedEventArgs eventArgs = new OnShortValueChangedEventArgs( clientId, result );
                            OnShortValueChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteShortValue( Guid clientId, long tag,  DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = ShortValueElementAccessor.Delete( tag, ts);
                    if( result != 0)
                    {
                        if( OnShortValueDeletedEvent != null )
                        {
                            OnShortValueDeletedEventArgs eventArgs = new OnShortValueDeletedEventArgs( clientId, tag,ts);
                            OnShortValueDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<StringValueElementData> GetAllStringValues( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<StringValueElementData> result = StringValueElementAccessor.GetAll( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public StringValueElementData GetStringValueByTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    StringValueElementData result = StringValueElementAccessor.GetByTimeStamp( tag, ts );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public StringValueElementData GetStringValueForTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    StringValueElementData result = StringValueElementAccessor.GetStringValueForTimeStamp( tag, ts);
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public StringValueElementData GetStringValueForLastTimeStamp( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    StringValueElementData result = StringValueElementAccessor.GetStringValueForLastTimeStamp( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<StringValueElementData> GetStringValueForInterval( long tag, DateTime startOfInterval, DateTime endOfInterval )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<StringValueElementData> result = StringValueElementAccessor.GetStringValueForInterval( tag, startOfInterval, endOfInterval );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }


        public StringValueElementData InsertStringValue( Guid clientId, StringValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    StringValueElementData result = null;
                    int recordsInserted = StringValueElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnStringValueInsertedEvent != null )
                        {
                            OnStringValueInsertedEventArgs eventArgs = new OnStringValueInsertedEventArgs( clientId, result );
                            OnStringValueInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertStringValueList( Guid clientId, List<StringValueElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    if(elements.Count > 0)
                    {
                        StringValueElementAccessor.Insert( elements );
                    }
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public StringValueElementData UpdateStringValue( Guid clientId, StringValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    StringValueElementData result = null;
                    int recordsUpdated = StringValueElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnStringValueChangedEvent != null )
                        {
                            OnStringValueChangedEventArgs eventArgs = new OnStringValueChangedEventArgs( clientId, result );
                            OnStringValueChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteStringValue( Guid clientId, long tag,  DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = StringValueElementAccessor.Delete( tag, ts);
                    if( result != 0)
                    {
                        if( OnStringValueDeletedEvent != null )
                        {
                            OnStringValueDeletedEventArgs eventArgs = new OnStringValueDeletedEventArgs( clientId, tag,ts);
                            OnStringValueDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<TimeSpanValueElementData> GetAllTimeSpanValues( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<TimeSpanValueElementData> result = TimeSpanValueElementAccessor.GetAll( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public TimeSpanValueElementData GetTimeSpanValueByTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    TimeSpanValueElementData result = TimeSpanValueElementAccessor.GetByTimeStamp( tag, ts );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public TimeSpanValueElementData GetTimeSpanValueForTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    TimeSpanValueElementData result = TimeSpanValueElementAccessor.GetTimeSpanValueForTimeStamp( tag, ts);
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public TimeSpanValueElementData GetTimeSpanValueForLastTimeStamp( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    TimeSpanValueElementData result = TimeSpanValueElementAccessor.GetTimeSpanValueForLastTimeStamp( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<TimeSpanValueElementData> GetTimeSpanValueForInterval( long tag, DateTime startOfInterval, DateTime endOfInterval )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<TimeSpanValueElementData> result = TimeSpanValueElementAccessor.GetTimeSpanValueForInterval( tag, startOfInterval, endOfInterval );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }


        public TimeSpanValueElementData InsertTimeSpanValue( Guid clientId, TimeSpanValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    TimeSpanValueElementData result = null;
                    int recordsInserted = TimeSpanValueElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnTimeSpanValueInsertedEvent != null )
                        {
                            OnTimeSpanValueInsertedEventArgs eventArgs = new OnTimeSpanValueInsertedEventArgs( clientId, result );
                            OnTimeSpanValueInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertTimeSpanValueList( Guid clientId, List<TimeSpanValueElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    if(elements.Count > 0)
                    {
                        TimeSpanValueElementAccessor.Insert( elements );
                    }
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public TimeSpanValueElementData UpdateTimeSpanValue( Guid clientId, TimeSpanValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    TimeSpanValueElementData result = null;
                    int recordsUpdated = TimeSpanValueElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnTimeSpanValueChangedEvent != null )
                        {
                            OnTimeSpanValueChangedEventArgs eventArgs = new OnTimeSpanValueChangedEventArgs( clientId, result );
                            OnTimeSpanValueChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteTimeSpanValue( Guid clientId, long tag,  DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = TimeSpanValueElementAccessor.Delete( tag, ts);
                    if( result != 0)
                    {
                        if( OnTimeSpanValueDeletedEvent != null )
                        {
                            OnTimeSpanValueDeletedEventArgs eventArgs = new OnTimeSpanValueDeletedEventArgs( clientId, tag,ts);
                            OnTimeSpanValueDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<UIntValueElementData> GetAllUIntValues( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<UIntValueElementData> result = UIntValueElementAccessor.GetAll( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public UIntValueElementData GetUIntValueByTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    UIntValueElementData result = UIntValueElementAccessor.GetByTimeStamp( tag, ts );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public UIntValueElementData GetUIntValueForTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    UIntValueElementData result = UIntValueElementAccessor.GetUIntValueForTimeStamp( tag, ts);
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public UIntValueElementData GetUIntValueForLastTimeStamp( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    UIntValueElementData result = UIntValueElementAccessor.GetUIntValueForLastTimeStamp( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<UIntValueElementData> GetUIntValueForInterval( long tag, DateTime startOfInterval, DateTime endOfInterval )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<UIntValueElementData> result = UIntValueElementAccessor.GetUIntValueForInterval( tag, startOfInterval, endOfInterval );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }


        public UIntValueElementData InsertUIntValue( Guid clientId, UIntValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    UIntValueElementData result = null;
                    int recordsInserted = UIntValueElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnUIntValueInsertedEvent != null )
                        {
                            OnUIntValueInsertedEventArgs eventArgs = new OnUIntValueInsertedEventArgs( clientId, result );
                            OnUIntValueInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertUIntValueList( Guid clientId, List<UIntValueElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    if(elements.Count > 0)
                    {
                        UIntValueElementAccessor.Insert( elements );
                    }
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public UIntValueElementData UpdateUIntValue( Guid clientId, UIntValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    UIntValueElementData result = null;
                    int recordsUpdated = UIntValueElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnUIntValueChangedEvent != null )
                        {
                            OnUIntValueChangedEventArgs eventArgs = new OnUIntValueChangedEventArgs( clientId, result );
                            OnUIntValueChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteUIntValue( Guid clientId, long tag,  DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = UIntValueElementAccessor.Delete( tag, ts);
                    if( result != 0)
                    {
                        if( OnUIntValueDeletedEvent != null )
                        {
                            OnUIntValueDeletedEventArgs eventArgs = new OnUIntValueDeletedEventArgs( clientId, tag,ts);
                            OnUIntValueDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<ULongValueElementData> GetAllULongValues( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<ULongValueElementData> result = ULongValueElementAccessor.GetAll( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ULongValueElementData GetULongValueByTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ULongValueElementData result = ULongValueElementAccessor.GetByTimeStamp( tag, ts );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ULongValueElementData GetULongValueForTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ULongValueElementData result = ULongValueElementAccessor.GetULongValueForTimeStamp( tag, ts);
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ULongValueElementData GetULongValueForLastTimeStamp( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ULongValueElementData result = ULongValueElementAccessor.GetULongValueForLastTimeStamp( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<ULongValueElementData> GetULongValueForInterval( long tag, DateTime startOfInterval, DateTime endOfInterval )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<ULongValueElementData> result = ULongValueElementAccessor.GetULongValueForInterval( tag, startOfInterval, endOfInterval );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }


        public ULongValueElementData InsertULongValue( Guid clientId, ULongValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ULongValueElementData result = null;
                    int recordsInserted = ULongValueElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnULongValueInsertedEvent != null )
                        {
                            OnULongValueInsertedEventArgs eventArgs = new OnULongValueInsertedEventArgs( clientId, result );
                            OnULongValueInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertULongValueList( Guid clientId, List<ULongValueElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    if(elements.Count > 0)
                    {
                        ULongValueElementAccessor.Insert( elements );
                    }
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public ULongValueElementData UpdateULongValue( Guid clientId, ULongValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    ULongValueElementData result = null;
                    int recordsUpdated = ULongValueElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnULongValueChangedEvent != null )
                        {
                            OnULongValueChangedEventArgs eventArgs = new OnULongValueChangedEventArgs( clientId, result );
                            OnULongValueChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteULongValue( Guid clientId, long tag,  DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = ULongValueElementAccessor.Delete( tag, ts);
                    if( result != 0)
                    {
                        if( OnULongValueDeletedEvent != null )
                        {
                            OnULongValueDeletedEventArgs eventArgs = new OnULongValueDeletedEventArgs( clientId, tag,ts);
                            OnULongValueDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<UShortValueElementData> GetAllUShortValues( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<UShortValueElementData> result = UShortValueElementAccessor.GetAll( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public UShortValueElementData GetUShortValueByTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    UShortValueElementData result = UShortValueElementAccessor.GetByTimeStamp( tag, ts );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public UShortValueElementData GetUShortValueForTimeStamp( long tag, DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    UShortValueElementData result = UShortValueElementAccessor.GetUShortValueForTimeStamp( tag, ts);
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public UShortValueElementData GetUShortValueForLastTimeStamp( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    UShortValueElementData result = UShortValueElementAccessor.GetUShortValueForLastTimeStamp( tag );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public List<UShortValueElementData> GetUShortValueForInterval( long tag, DateTime startOfInterval, DateTime endOfInterval )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    List<UShortValueElementData> result = UShortValueElementAccessor.GetUShortValueForInterval( tag, startOfInterval, endOfInterval );
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }


        public UShortValueElementData InsertUShortValue( Guid clientId, UShortValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    UShortValueElementData result = null;
                    int recordsInserted = UShortValueElementAccessor.Insert( element, out result );
                    if( recordsInserted != 0)
                    {
                        if( OnUShortValueInsertedEvent != null )
                        {
                            OnUShortValueInsertedEventArgs eventArgs = new OnUShortValueInsertedEventArgs( clientId, result );
                            OnUShortValueInsertedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public void InsertUShortValueList( Guid clientId, List<UShortValueElementData> elements )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    if(elements.Count > 0)
                    {
                        UShortValueElementAccessor.Insert( elements );
                    }
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public UShortValueElementData UpdateUShortValue( Guid clientId, UShortValueElementData element )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    UShortValueElementData result = null;
                    int recordsUpdated = UShortValueElementAccessor.Update( element, out result );
                    if( recordsUpdated != 0)
                    {
                        if( OnUShortValueChangedEvent != null )
                        {
                            OnUShortValueChangedEventArgs eventArgs = new OnUShortValueChangedEventArgs( clientId, result );
                            OnUShortValueChangedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }

        public int DeleteUShortValue( Guid clientId, long tag,  DateTime ts )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    int result = UShortValueElementAccessor.Delete( tag, ts);
                    if( result != 0)
                    {
                        if( OnUShortValueDeletedEvent != null )
                        {
                            OnUShortValueDeletedEventArgs eventArgs = new OnUShortValueDeletedEventArgs( clientId, tag,ts);
                            OnUShortValueDeletedEvent( this, eventArgs );
                        }
                    }
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }


        public Interval GetTagValueInterval( long tag )
        {
            MethodBase currentMethod = MethodBase.GetCurrentMethod();
            Entering(currentMethod);
            try
            {
                try
                {
                    string schema = GetTagValueSchema( );
                    string storage = GetTagValueStorage( tag );
                    Interval result = TagAccessor.GetTagInterval(schema,storage);
                    return result;
                }
                catch (Exception exc)
                {
                    LogException(exc, currentMethod );
                    throw;
                }
            }
            finally
            {
                Leaving(currentMethod);
            }
        }


    }


}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect Sea Surveillance AS
Norway Norway
Chief Architect - Sea Surveillance AS.

Specializing in integrated operations and high performance computing solutions.

I’ve been fooling around with computers since the early eighties, I’ve even done work on CP/M and MP/M.

Wrote my first “real” program on a BBC micro model B based on a series in a magazine at that time. It was fun and I got hooked on this thing called programming ...

A few Highlights:

  • High performance application server development
  • Model Driven Architecture and Code generators
  • Real-Time Distributed Solutions
  • C, C++, C#, Java, TSQL, PL/SQL, Delphi, ActionScript, Perl, Rexx
  • Microsoft SQL Server, Oracle RDBMS, IBM DB2, PostGreSQL
  • AMQP, Apache qpid, RabbitMQ, Microsoft Message Queuing, IBM WebSphereMQ, Oracle TuxidoMQ
  • Oracle WebLogic, IBM WebSphere
  • Corba, COM, DCE, WCF
  • AspenTech InfoPlus.21(IP21), OsiSoft PI


More information about what I do for a living can be found at: harlinn.com or LinkedIn

You can contact me at espen@harlinn.no

Comments and Discussions