예제 #1
0
        private BindablePoint TranslateToBindablePoint(IDataReader dataReader)
        {
            BindablePoint bindPoint = new BindablePoint();

            TranslateToBindablePoint(dataReader, bindPoint);
            return(bindPoint);
        }
예제 #2
0
 void Delete(BindablePoint bindPoint)
 {
     using (BindablePointFactory factory = BindablePointFactory.GetInstance())
     {
         factory.InternalDelete(bindPoint);
     }
 }
예제 #3
0
        internal List <BindablePoint> InternalLoadByInstanceId(int instanceId)
        {
            RawSqlExecuteReaderAction readerAction = new RawSqlExecuteReaderAction();

            readerAction.CommandText = _loadByInstanceIdCommandText;
            readerAction.AddParameter("@InstanceId", instanceId, DbType.Int32);
            this.ExecuteCommand(readerAction);

            List <BindablePoint> bindPointList = new List <BindablePoint>();
            IDataReader          dataReader    = readerAction.DataReader;

            try
            {
                int[] ordinals = GetBindablePointFieldOrdinals(dataReader);
                while (dataReader.Read())
                {
                    BindablePoint res = new BindablePoint();
                    TranslateToBindablePoint(dataReader, res, ordinals[0], ordinals[1], ordinals[2], ordinals[3], ordinals[4]);
                    bindPointList.Add(res);
                }
            }
            finally
            {
                dataReader.Close();
            }

            return(bindPointList);
        }
예제 #4
0
 void Insert(BindablePoint bindPoint)
 {
     using (BindablePointFactory factory = BindablePointFactory.GetInstance())
     {
         factory.InternalInsert(bindPoint);
     }
 }
예제 #5
0
 protected void TranslateToBindablePoint(IDataReader dataReader, BindablePoint bindPoint, int idIndex, int defIdIndex, int instIdIndex, int activeIndex, int systemNameIndex)
 {
     bindPoint.BindablePointId           = dataReader.GetInt32(idIndex);
     bindPoint.BindablePointDefinitionId = dataReader.GetInt32(defIdIndex);
     bindPoint.InstanceId = dataReader.GetInt32(instIdIndex);
     bindPoint.Active     = dataReader.GetBoolean(activeIndex);
     bindPoint.SystemName = dataReader.GetString(systemNameIndex);
 }
예제 #6
0
        protected void Delete(BindablePoint bindPoint)
        {
            RawSqlExecuteNonQueryAction deleteAction = new RawSqlExecuteNonQueryAction();

            deleteAction.CommandText = _deleteCommandText;

            deleteAction.AddParameter("@BindablePointId", bindPoint.BindablePointId, DbType.Int32);

            this.ExecuteCommand(deleteAction);
        }
예제 #7
0
        protected void Insert(BindablePoint bindPoint)
        {
            RawSqlInsertAction insertAction = new RawSqlInsertAction();

            insertAction.CommandText = _insertCommandText;

            insertAction.AddParameter("@BindablePointId", bindPoint.BindablePointId, DbType.Int32);
            insertAction.AddParameter("@BindablePointDefinitonId", bindPoint.BindablePointDefinitionId, DbType.Int32);
            insertAction.AddParameter("@InstanceId", bindPoint.InstanceId, DbType.Int32);
            insertAction.AddParameter("@Active", bindPoint.Active, DbType.Boolean);
            this.ExecuteCommand(insertAction);
            bindPoint.BindablePointId = insertAction.InsertedIdentity;
        }
예제 #8
0
        protected void Update(BindablePoint bindPoint)
        {
            RawSqlExecuteNonQueryAction updateAction = new RawSqlExecuteNonQueryAction();

            updateAction.CommandText = _updateCommandText;

            updateAction.AddParameter("@BindablePointId", bindPoint.BindablePointId, DbType.Int32);
            updateAction.AddParameter("@BindablePointDefinitonId", bindPoint.BindablePointDefinitionId, DbType.Int32);
            updateAction.AddParameter("@InstanceId", bindPoint.InstanceId, DbType.Int32);
            updateAction.AddParameter("@Active", bindPoint.Active, DbType.Boolean);

            this.ExecuteCommand(updateAction);
        }
예제 #9
0
        internal BindablePoint InternalLoadByName(string bindPointName)
        {
            RawSqlExecuteReaderAction readerAction = new RawSqlExecuteReaderAction();

            readerAction.CommandText = _loadByNameCommandText;

            readerAction.AddParameter("@BindablePointName", bindPointName, DbType.String);

            BindablePoint bindPoint = null;

            this.ExecuteCommand(readerAction);
            try
            {
                readerAction.DataReader.Read();
                bindPoint = TranslateToBindablePoint(readerAction.DataReader);
            }
            finally
            {
                readerAction.DataReader.Close();
            }
            return(bindPoint);
        }
예제 #10
0
        internal BindablePoint InternalLoadByPrimaryKey(int bindPointId)
        {
            RawSqlExecuteReaderAction readerAction = new RawSqlExecuteReaderAction();

            readerAction.CommandText = _loadByIdCommandText;

            readerAction.AddParameter("@BindablePointId", bindPointId, DbType.Int32);

            BindablePoint bindPoint = null;

            this.ExecuteCommand(readerAction);
            try
            {
                readerAction.DataReader.Read();
                bindPoint = TranslateToBindablePoint(readerAction.DataReader);
            }
            finally
            {
                readerAction.DataReader.Close();
            }
            return(bindPoint);
        }
예제 #11
0
 internal void InternalInsert(BindablePoint bindPoint)
 {
     Insert(bindPoint);
 }
예제 #12
0
 protected void TranslateToBindablePoint(IDataReader dataReader, BindablePoint bindPoint)
 {
     int[] indexes = GetBindablePointFieldOrdinals(dataReader);
     TranslateToBindablePoint(dataReader, bindPoint, indexes[0], indexes[1], indexes[2], indexes[3], indexes[4]);
 }
예제 #13
0
 internal void InternalDelete(BindablePoint bindPoint)
 {
     this.Delete(bindPoint);
 }
예제 #14
0
 internal void InternalUpdate(BindablePoint bindPoint)
 {
     this.Update(bindPoint);
 }