public PriceType GetPriceType(int PriceTypeID) { var result = new PriceType(); var response = GetContext().PriceTypes .Where(c => c.PriceTypeID == PriceTypeID) .FirstOrDefault(); if (response == null) { return(null); } result.PriceTypeID = response.PriceTypeID; result.PriceTypeDescription = response.PriceTypeDescription; return(result); }
public PriceType GetPriceType(int PriceTypeID) { var result = new PriceType(); using (var reader = GetContext().GetReader(@" SELECT * FROM PriceTypes WHERE PriceTypeID = {0} ", PriceTypeID)) { if (!reader.Read()) { return(null); } result.PriceTypeID = reader.GetInt32("PriceTypeID"); result.PriceTypeDescription = reader.GetString("PriceTypeDescription"); } return(result); }
public PriceType GetPriceType(int PriceTypeID) { var result = new PriceType(); using (var reader = GetContext().GetReader(@" SELECT * FROM PriceTypes WHERE PriceTypeID = {0} ", PriceTypeID)) { if(!reader.Read()) return null; result.PriceTypeID = reader.GetInt32("PriceTypeID"); result.PriceTypeDescription = reader.GetString("PriceTypeDescription"); } return result; }
public PriceType GetPriceType(int PriceTypeID) { var result = new PriceType(); var response = GetContext().PriceTypes .Where(c => c.PriceTypeID == PriceTypeID) .FirstOrDefault(); if(response == null) return null; result.PriceTypeID = response.PriceTypeID; result.PriceTypeDescription = response.PriceTypeDescription; return result; }