本文整理汇总了C#中IDataReader.GetInt方法的典型用法代码示例。如果您正苦于以下问题:C# IDataReader.GetInt方法的具体用法?C# IDataReader.GetInt怎么用?C# IDataReader.GetInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDataReader
的用法示例。
在下文中一共展示了IDataReader.GetInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Select
/// <summary>
/// Mapea un IDataReader a una entidad Linea Base.
/// </summary>
/// <param name="reader">Interfas IDataReader</param>
/// <returns>LineaBase</returns>
public static LineaBase Select(IDataReader reader)
{
return new LineaBase
{
Id = reader.GetInt("CODIGO"),
Nombre = reader.GetString("NOMBRE"),
Descripcion = reader.GetString("DESCRIPCION"),
ProyectoFase = new ProyectoFase { Id = reader.GetInt("CODIGO_PROYECTO_FASE"), Fase = new Fase { Nombre = reader.GetString("NOMBRE_FASE") } },
Estado = reader.GetString("ESTADO"),
FechaLiberacion = reader.GetDateTime("FECHA_LIBERACION")
};
}
示例2: Select
public static ElementoConfiguracion Select(IDataReader reader)
{
return new ElementoConfiguracion
{
Id = reader.GetInt("CODIGO"),
Nombre = reader.GetString("NOMBRE"),
Descripcion = reader.GetString("DECRIPCION"),
Fase = new Fase
{
Id = reader.GetInt("CODIGO_FASE")
},
Tipo = "DOC".Equals(reader.GetInt("TIPO")) ? TipoElementoConfiguracion.Documento : TipoElementoConfiguracion.Release
};
}
示例3: GetConcepts
public override IEnumerable<IEntity> GetConcepts(Concept concept, IDataReader reader, KeyMasterOffset keyMaster)
{
var concepts = base.GetConcepts(concept, reader, keyMaster).ToList();
if (concepts.Count > 0)
{
var baseConcept = concepts[0];
var died = reader.GetInt(Died);
if (died.HasValue && died.Value == 1)
{
yield return new Death((Entity) baseConcept) {Primary = true};
}
else //Medical claim diagnostic code indicating death
{
if (Concepts.Count() > 1)
{
for (int i = 1; i < Concepts.Count(); i++)
{
foreach (var entity in PopulateDeath(reader, Concepts[i], baseConcept)) yield return entity;
}
}
else
{
foreach (var entity in PopulateDeath(reader, Concepts[0], baseConcept)) yield return entity;
}
}
}
}
示例4: Select
/// <summary>
/// Mapea un IDataReader a una entidad Proyecto.
/// </summary>
/// <param name="reader">Interfas IDataReader</param>
/// <returns>Proyecto</returns>
public static Proyecto Select(IDataReader reader)
{
return new Proyecto
{
Id = reader.GetInt("CODIGO"),
Nombre = reader.GetString("NOMBRE"),
Descripcion = reader.GetString("DESCRIPCION"),
FechaInicio = reader.GetDateTime("FECHA_INICIO"),
FechaFin = reader.GetDateTime("FECHA_FIN"),
JefeProyecto = new Usuario
{
Id = reader.GetInt("CODIGO_JEFE_PROYECTO")
},
Estado = reader.GetString("ESTADO")
};
}
示例5: Select
/// <summary>
/// Mapea un IDataReader a una entidad Fase.
/// </summary>
/// <param name="reader">Interfas IDataReader</param>
/// <returns>Fase</returns>
public static Fase Select(IDataReader reader)
{
return new Fase
{
Id = reader.GetInt("CODIGO"),
Nombre = reader.GetString("NOMBRE")
};
}
示例6: Select
/// <summary>
/// Mapea un IDataReader a una entidad Usuario.
/// </summary>
/// <param name="reader">Interfas IDataReader</param>
/// <returns>Usuario</returns>
public static Usuario Select(IDataReader reader)
{
return new Usuario
{
Id = reader.GetInt("CODIGO"),
Nombre = reader.GetString("NOMBRE")
};
}
示例7: Mapper
internal PersonneDTO Mapper(IDataReader rd, PersonneDTO personne)
{
personne.Nom = rd.GetString("NOM");
personne.Prenom = rd.GetString("PRENOM");
personne.Telephone = rd.GetString("TELEPHONE");
personne.IdPersonne = rd.GetInt("ID");
return personne;
}
示例8: AddRecord
public override void AddRecord(IDataReader reader)
{
var prodcode = reader.GetInt("prodcode");
var ndd = reader.GetDecimal("ndd");
var quantity = reader.GetDecimal("qty");
var numpacks = reader.GetInt("numpacks");
var dayssupply = reader.GetInt("numdays");
if (prodcode.HasValue && dayssupply.HasValue)
{
var key = CompositeKeyHelper.GetCprdDaysSupplyKey(prodcode.Value, ndd, quantity, numpacks);
if (!lookup.ContainsKey(key))
{
lookup.Add(key, dayssupply.Value);
}
}
}
示例9: GetConcepts
public override IEnumerable<IEntity> GetConcepts(Concept concept, IDataReader reader, KeyMasterOffset keyMaster)
{
long? relevantConditionConceptId = 0;
DateTime? endDate = null;
if(Concepts.Length == 2)
{
var relevantConcepts = Concepts[1].GetValues(Vocabulary, Concepts[1].Fields[0], reader);
if (relevantConcepts.Count > 0)
relevantConditionConceptId = relevantConcepts.Min(c => c.ConceptId);
}
foreach (var c in base.GetConcepts(concept, reader, keyMaster))
{
var e = (Entity) c;
var calculatedDaysSupply = GetDaysSupply(reader, e);
if (!string.IsNullOrEmpty(EndDate))
{
if (calculatedDaysSupply > 0 && calculatedDaysSupply <= 365)
endDate = e.StartDate.AddDays(calculatedDaysSupply - 1);
else
endDate = reader.GetDateTime(EndDate);
}
var refillString = reader.GetString(Refill);
int? refill = null;
if (!string.IsNullOrEmpty(refillString))
{
int refillValue;
// in Optum Refill looks like: 01, 02...
int.TryParse(refillString, out refillValue);
refill = refillValue;
}
yield return new DrugExposure(e)
{
Id = keyMaster.DrugExposureId,
Refills = refill,
DaysSupply = reader.GetInt(DaysSupply),
CalculatedDaysSupply = calculatedDaysSupply,
Quantity = GetQuantity(reader),
RelevantConditionConceptId = relevantConditionConceptId,
EndDate = endDate == DateTime.MinValue ? null : endDate,
GetEraConceptIdsCall = Vocabulary.LookupIngredientLevel
};
}
}
示例10: Mapper
internal BienDTO Mapper(IDataReader rd, BienDTO bien)
{
bien.IdBien = rd.GetInt("BIENID");
bien.Description = rd.GetString("DESCRIPTION");
bien.Latitude = rd.GetString("LATITUDE");
bien.Longitude = rd.GetString("LONGITUDE");
bien.Titre = rd.GetString("TITRE");
//on fait volontairement le choix de ne pas charger le propriétaire ; il sera chargé à la demande.
bien.Proprietaire = null;
bien.Adresse = rd.GetString("ADRESSE");
TypeBienDAO.Mapper(rd, bien);
return bien;
}
示例11: GetValues
public List<LookupValue> GetValues(Vocabulary vocabulary, Field field, IDataReader reader)
{
if (!string.IsNullOrEmpty(field.ConceptId))
{
var conceptId = reader.GetInt(field.ConceptId);
return new List<LookupValue> { new LookupValue { ConceptId = conceptId } };
}
var mapper = FindMapper(ConceptIdMappers, reader);
if (mapper == null)
return new List<LookupValue> { new LookupValue { ConceptId = field.DefaultConceptId } };
var conceptKey = reader.GetString(field.Key);
if (conceptKey == null) return new List<LookupValue>();
return mapper.Map(vocabulary, field.Key, conceptKey, reader.GetDateTime(field.EventDate));
}
示例12: GetTypeId
public int? GetTypeId(Field field, IDataReader reader)
{
if (!string.IsNullOrEmpty(field.TypeId))
{
return reader.GetInt(field.TypeId);
}
var mapper = FindMapper(TypeIdMappers, reader);
if (mapper == null)
{
return field.DefaultTypeId;
}
var typeIds = mapper.Map(null, field.Key, reader[field.Key].ToString(), reader.GetDateTime(field.EventDate));
if (typeIds.Count == 0)
return null;
return (int?)typeIds[0].ConceptId;
}
示例13: GetConcepts
public override IEnumerable<IEntity> GetConcepts(Concept concept, IDataReader reader, KeyMasterOffset keyMaster)
{
var visitOccurrences = base.GetConcepts(concept, reader, keyMaster).ToList();
if(visitOccurrences.Count > 0)
{
var id = reader.GetLong(Id);
var visitOccurrence = new VisitOccurrence((Entity) visitOccurrences[0])
{
CareSiteId = reader.GetInt(CareSiteId) ?? 0
};
if(id.HasValue)
{
visitOccurrence.Id = id.Value;
}
else
{
visitOccurrence.IdUndefined = true;
}
yield return visitOccurrence;
}
}
示例14: Mapper
internal AgendaDTO Mapper(IDataReader rd, AgendaDTO agenda)
{
agenda.Date = rd.GetDateTime("DATEENTREE");
agenda.Description = rd.GetString("DESCRIPTION");
agenda.Titre = rd.GetString("TITRE");
if (rd.GetNullableInt("PROSPECTPERSONNEID") != null) {
ProspectDAO prospect = new ProspectDAO();
agenda.Prospect = prospect.Charger(rd.GetInt("PROSPECTPERSONNEID"));
}
if (rd.GetNullableInt("AGENTPERSONNEID") != null) {
AgentDAO agent = new AgentDAO();
agenda.Agent = agent.Charger(rd.GetInt("AGENTPERSONNEID"));
}
if (rd.GetNullableInt("ANNONCEID") != null) {
AnnonceDAO annonce = new AnnonceDAO();
agenda.Annonce = annonce.Charger(rd.GetInt("ANNONCEID"));
}
agenda.IdAgenda = rd.GetInt("ID");
return agenda;
}
示例15: GetConcepts
public override IEnumerable<IEntity> GetConcepts(Concept concept, IDataReader reader, KeyMasterOffset keyMaster)
{
long id;
var idUndefined = false;
if (string.IsNullOrEmpty(Id))
{
id = KeyMaster.GetProviderId();
idUndefined = true;
}
else
{
id = reader.GetLong(Id).Value;
}
if (concept == null)
{
yield return new Provider
{
Id = id,
CareSiteId = reader.GetInt(CareSiteId) ?? 0,
ProviderSourceValue = reader.GetString(ProviderSourceValue),
SourceValue = reader.GetString(SpecialtySourceValue)
};
}
else
{
var conceptField = concept.Fields[0];
var source = reader.GetString(conceptField.Key) ?? reader.GetString(conceptField.SourceKey);
if (source != null && source.Length == 0)
source = null;
var specialtyConceptIds = concept.GetValues(Vocabulary, conceptField, reader).ToList();
long? specialtyConcept = null;
//(Unknown Physician Specialty)
long defaultConceptId = 38004514;
if (conceptField.DefaultConceptId.HasValue)
{
defaultConceptId = conceptField.DefaultConceptId.Value;
}
if (specialtyConceptIds.Count > 0)
{
specialtyConcept = specialtyConceptIds[0].ConceptId;
}
yield return new Provider
{
Id = id,
IdUndefined = idUndefined,
CareSiteId = reader.GetInt(CareSiteId) ?? 0,
ConceptId = specialtyConcept.HasValue ? specialtyConcept.Value : defaultConceptId,
ProviderSourceValue = reader.GetString(ProviderSourceValue),
SourceValue =
string.IsNullOrEmpty(conceptField.SourceKey) ? source : reader.GetString(conceptField.SourceKey)
};
}
}