本文整理汇总了C#中OracleDataReader.GetDecimal方法的典型用法代码示例。如果您正苦于以下问题:C# OracleDataReader.GetDecimal方法的具体用法?C# OracleDataReader.GetDecimal怎么用?C# OracleDataReader.GetDecimal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OracleDataReader
的用法示例。
在下文中一共展示了OracleDataReader.GetDecimal方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SafeReadDecimal
/// Safely reads decimal values from the database if they are null
///<returns>0 if null otherwise value from DB</returns>
decimal SafeReadDecimal(OracleDataReader odr, int colindex)
{
if (!odr.IsDBNull(colindex))
return odr.GetDecimal(colindex);
else
return 0;
}
示例2: PopulateDto
internal override DtoBase PopulateDto(OracleDataReader reader)
{
var turno = new TurneroDto();
//
if (!reader.IsDBNull(_ordTurId)) { turno.TurId = reader.GetInt32(_ordTurId); }
//
if (!reader.IsDBNull(_ordTurTitulo)) { turno.TurTitulo = reader.GetString(_ordTurTitulo); }
//
if (!reader.IsDBNull(_ordTurDescripcion)) { turno.TurDescripcion = reader.GetString(_ordTurDescripcion); }
//
if (!reader.IsDBNull(_ordTurFechaIni)) { turno.TurFechaIni = reader.GetDateTime(_ordTurFechaIni); }
//
if (!reader.IsDBNull(_ordTurFechaFin)) { turno.TurFechaFin = reader.GetDateTime(_ordTurFechaFin); }
//
if (!reader.IsDBNull(_ordTurTodoDia)) { turno.TurTodoDia = reader.GetString(_ordTurTodoDia); }
//
if (!reader.IsDBNull(_ordTurPae)) { turno.TurPae = reader.GetInt32(_ordTurPae); }
//
if (!reader.IsDBNull(_ordTurPro)) { turno.TurPro= reader.GetInt32(_ordTurPro); }
//
if (!reader.IsDBNull(_ordTurMonto)) { turno.TurMonto = reader.GetDecimal(_ordTurMonto); }
//
if (!reader.IsDBNull(_ordTurOspId)) { turno.TurOspId = reader.GetInt32(_ordTurOspId); }
// IsNew
turno.IsNew = false;
return turno;
}
示例3: SafeReadDecimal
static decimal SafeReadDecimal(OracleDataReader odr, int ColIndex)
{
{
if (!odr.IsDBNull(ColIndex))
return odr.GetDecimal(ColIndex);
else
return 0;
}
}
示例4: GetIntNullable
internal static int? GetIntNullable(OracleDataReader reader, int index, int? defaultValue)
{
if (reader.IsDBNull(index)) { return null; }
int returnValue;
if (int.TryParse(reader.GetDecimal(index).ToString(), out returnValue) == true) { return returnValue; }
return defaultValue;
}
示例5: MapReaderToEventDto
EventDto MapReaderToEventDto(OracleDataReader dataReader)
{
return new EventDto()
{
Id = dataReader.GetInt64(ColumnPositions.Id),
CommandContext = ConvertToGuid(dataReader.GetOracleBinary(ColumnPositions.CommandContext)),
Name = dataReader.GetString(ColumnPositions.Name),
LogicalName = dataReader.GetString(ColumnPositions.LogicalName),
EventSourceId = ConvertToGuid(dataReader.GetOracleBinary(ColumnPositions.EventSourceId)),
EventSource = dataReader.GetString(ColumnPositions.EventSource),
Generation = dataReader.GetInt32(ColumnPositions.Generation),
Data = dataReader.GetOracleClob(ColumnPositions.Data).Value,
CausedBy = dataReader.GetString(ColumnPositions.CausedBy),
Origin = dataReader.GetString(ColumnPositions.Origin),
Occurred = dataReader.GetDateTime(ColumnPositions.Occured),
Version = Convert.ToDouble(dataReader.GetDecimal(ColumnPositions.Version))
};
}
示例6: LoadQuota
public static Quota LoadQuota(OracleDataReader odr)
{
string tablespaceName = odr.GetString(odr.GetOrdinal("tablespace_name"));
string userName = odr.GetString(odr.GetOrdinal("username"));
decimal? bytes = null,
maxBytes = null,
maxBlocks = null;
decimal blocks = odr.GetDecimal(odr.GetOrdinal("blocks"));
if (!odr.IsDBNull(odr.GetOrdinal("bytes")))
bytes = odr.GetDecimal(odr.GetOrdinal("bytes"));
if (!odr.IsDBNull(odr.GetOrdinal("max_bytes")))
maxBytes = odr.GetDecimal(odr.GetOrdinal("max_bytes"));
if (!odr.IsDBNull(odr.GetOrdinal("max_blocks")))
maxBlocks = odr.GetDecimal(odr.GetOrdinal("max_blocks"));
return new Quota(tablespaceName, userName, blocks, maxBlocks, bytes, maxBytes);
}
示例7: GetDecimal
internal static decimal GetDecimal(OracleDataReader reader, int index, decimal defaultValue)
{
return (reader.IsDBNull(index) || !(reader.GetValue(index) is Decimal)) ? defaultValue : (decimal)reader.GetDecimal(index);
}
示例8: loadUser
User loadUser(OracleDataReader odr, bool isCurrentUser)
{
DateTime? created = null,
expiryDate = null;
if (!odr.IsDBNull(4))
created = (DateTime)odr.GetDateTime(odr.GetOrdinal("created"));
if (!odr.IsDBNull(5))
expiryDate = (DateTime)odr.GetDateTime(odr.GetOrdinal("expiry_date"));
if (isCurrentUser)
return new CurrentUser(
odr.GetDecimal(odr.GetOrdinal("user_id")),
odr.GetString(odr.GetOrdinal("username")),
odr.GetString(odr.GetOrdinal("default_tablespace")),
odr.GetString(odr.GetOrdinal("temporary_tablespace")),
created,
expiryDate,
session);
else
return new User(
odr.GetDecimal(odr.GetOrdinal("user_id")),
odr.GetString(odr.GetOrdinal("username")),
odr.GetString(odr.GetOrdinal("default_tablespace")),
odr.GetString(odr.GetOrdinal("temporary_tablespace")),
created,
expiryDate,
session);
}
示例9: ReadSession
private static LPHSSession ReadSession(OracleDataReader reader)
{
LPHSSession session = new LPHSSession();
session.ID = (int)reader.GetDecimal(0);
session.Name = OracleDatabase.GetString(reader, 1, string.Empty);
session.StartDate = OracleDatabase.GetDateTime(reader, 2, DateTime.Now);
session.EndDate = OracleDatabase.GetDateTime(reader, 3, DateTime.Now);
session.UserSid = OracleDatabase.GetString(reader, 4, string.Empty);
return session;
}
示例10: ReadSchool
private static LPHSSchool ReadSchool(OracleDataReader reader)
{
LPHSSchool school = new LPHSSchool();
school.ID = (int)reader.GetDecimal(0);
school.Name = OracleDatabase.GetString(reader, 1, null); // reader.IsDBNull(1) ? null : reader.GetString(1),
school.Address1 = OracleDatabase.GetString(reader, 2, null); // reader.IsDBNull(2) ? null : reader.GetString(2),
school.Address2 = OracleDatabase.GetString(reader, 3, null); // reader.IsDBNull(3) ? null : reader.GetString(3),
school.Address3 = OracleDatabase.GetString(reader, 4, null); //reader.IsDBNull(4) ? null : reader.GetString(4),
school.City = OracleDatabase.GetString(reader, 5, null); // reader.IsDBNull(5) ? null : reader.GetString(5),
school.State = OracleDatabase.GetString(reader, 6, null); // reader.IsDBNull(6) ? null : reader.GetString(6),
school.Zip = OracleDatabase.GetString(reader, 7, null); // reader.IsDBNull(7) ? null : reader.GetString(7),
school.CoordinatorID = OracleDatabase.GetIntNullable(reader, 8, null);
school.Active = OracleDatabase.GetBooleanFromString(reader, 9);
school.RegionID = OracleDatabase.GetInt(reader, 10, -1);
school.SessionID = OracleDatabase.GetInt(reader, 11, -1);
return school;
}