private BindablePoint TranslateToBindablePoint(IDataReader dataReader) { BindablePoint bindPoint = new BindablePoint(); TranslateToBindablePoint(dataReader, bindPoint); return(bindPoint); }
void Delete(BindablePoint bindPoint) { using (BindablePointFactory factory = BindablePointFactory.GetInstance()) { factory.InternalDelete(bindPoint); } }
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); }
void Insert(BindablePoint bindPoint) { using (BindablePointFactory factory = BindablePointFactory.GetInstance()) { factory.InternalInsert(bindPoint); } }
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); }
protected void Delete(BindablePoint bindPoint) { RawSqlExecuteNonQueryAction deleteAction = new RawSqlExecuteNonQueryAction(); deleteAction.CommandText = _deleteCommandText; deleteAction.AddParameter("@BindablePointId", bindPoint.BindablePointId, DbType.Int32); this.ExecuteCommand(deleteAction); }
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; }
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); }
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); }
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); }
internal void InternalInsert(BindablePoint bindPoint) { Insert(bindPoint); }
protected void TranslateToBindablePoint(IDataReader dataReader, BindablePoint bindPoint) { int[] indexes = GetBindablePointFieldOrdinals(dataReader); TranslateToBindablePoint(dataReader, bindPoint, indexes[0], indexes[1], indexes[2], indexes[3], indexes[4]); }
internal void InternalDelete(BindablePoint bindPoint) { this.Delete(bindPoint); }
internal void InternalUpdate(BindablePoint bindPoint) { this.Update(bindPoint); }