public PeriodType GetPeriodType(int PeriodTypeID) { var result = new PeriodType(); var response = GetContext().PeriodTypes .Where(c => c.PeriodTypeID == PeriodTypeID) .FirstOrDefault(); if (response == null) { return(null); } result.PeriodTypeID = response.PeriodTypeID; result.PeriodTypeDescription = response.PeriodTypeDescription; return(result); }
public PeriodType GetPeriodType(int PeriodTypeID) { var result = new PeriodType(); using (var reader = GetContext().GetReader(@" SELECT * FROM PeriodTypes WHERE PeriodTypeID = {0} ", PeriodTypeID)) { if (!reader.Read()) { return(null); } result.PeriodTypeID = reader.GetInt32("PeriodTypeID"); result.PeriodTypeDescription = reader.GetString("PeriodTypeDescription"); } return(result); }
public PeriodType GetPeriodType(int PeriodTypeID) { var result = new PeriodType(); using (var reader = GetContext().GetReader(@" SELECT * FROM PeriodTypes WHERE PeriodTypeID = {0} ", PeriodTypeID)) { if(!reader.Read()) return null; result.PeriodTypeID = reader.GetInt32("PeriodTypeID"); result.PeriodTypeDescription = reader.GetString("PeriodTypeDescription"); } return result; }
public PeriodType GetPeriodType(int PeriodTypeID) { var result = new PeriodType(); var response = GetContext().PeriodTypes .Where(c => c.PeriodTypeID == PeriodTypeID) .FirstOrDefault(); if(response == null) return null; result.PeriodTypeID = response.PeriodTypeID; result.PeriodTypeDescription = response.PeriodTypeDescription; return result; }