/// <summary> /// /// </summary> /// <param name="entity"></param> /// <param name="connection"></param> /// <param name="transaction"></param> /// <returns></returns> public static DbDataReader Select(UserHistoryAttributesCriteria criteria, DbConnection connection, DbTransaction transaction) { var reader = KandaTableDataGateway._factory.CreateReader(connection, transaction); reader.CommandText = @"usp_SelectUserHistoryAttributes"; KandaDbDataMapper.MapToParameters(reader, criteria); reader.ExecuteReader(); return(reader); }
/// <summary> /// /// </summary> /// <param name="criteria"></param> /// <param name="connection"></param> /// <param name="transaction"></param> /// <returns></returns> public static int Delete(UserHistoryAttributesCriteria criteria, DbConnection connection, DbTransaction transaction) { var command = KandaTableDataGateway._factory.CreateCommand(connection, transaction); command.CommandText = @"usp_DeleteUserHistoryAttributes"; KandaDbDataMapper.MapToParameters(command, criteria); var result = KandaTableDataGateway._factory.CreateParameter(KandaTableDataGateway.RETURN_VALUE, DbType.Int32, sizeof(int), ParameterDirection.ReturnValue, DBNull.Value); command.Parameters.Add(result); command.ExecuteNonQuery(); return((int)result.Value); }
/// <summary> /// /// </summary> /// <param name="criteria"></param> /// <param name="connection"></param> /// <param name="transaction"></param> /// <returns></returns> public IEnumerable <UserHistoryAttributeEntity> Get(UserHistoryAttributesCriteria criteria, DbConnection connection, DbTransaction transaction) { var reader = default(DbDataReader); try { reader = UserHistoryAttributesGateway.Select(criteria, connection, transaction); var entities = KandaDbDataMapper.MapToEnumerable <UserHistoryAttributeEntity>(reader); return(entities); } finally { if (reader != null) { reader.Close(); } } }