public override IReadOnlyList <Agent> Translate(SqlCommand command, IDataRowReader reader) { var Agents = new List <Agent>(); while (reader.Read()) { Agents.Add(new Agent( reader.GetInt32("AgentID"), reader.GetString("Name"), reader.GetDouble("Salary"))); } return(Agents); }
public override IReadOnlyList <SalesObj> Translate(SqlCommand command, IDataRowReader reader) { var temp = new List <SalesObj>(); while (reader.Read()) { temp.Add(new SalesObj( reader.GetDouble("Sales"), reader.GetString("StreetAddress") )); } return(temp); }
public override CarRentalReservation Translate(SqlCommand command, IDataRowReader reader) { if (!reader.Read()) { throw new RecordNotFoundException(reservationID.ToString()); } return(new CarRentalReservation(reader.GetInt32("ReservationID"), reader.GetInt32("CarRentalID"), reader.GetDateTime("RentalDate"), reader.GetString("Model"), reader.GetDouble("Price") )); }
public override IReadOnlyList <TopHeartRates> Translate(SqlCommand command, IDataRowReader reader) { var topHeartRates = new List <TopHeartRates>(); while (reader.Read()) { topHeartRates.Add(new TopHeartRates( reader.GetDouble("AvgHeartRate"), reader.GetString("Date") )); } return(topHeartRates); }
public override Customer Translate(SqlCommand command, IDataRowReader reader) { if (!reader.Read()) { return(null); } return(new Customer(customerID, reader.GetString("Name"), reader.GetDouble("Budget"), reader.GetInt32("Age"), reader.GetString("Sex"), reader.GetInt32("ContactID") )); }
public override IReadOnlyList <RatingByWeather> Translate(SqlCommand command, IDataRowReader reader) { var ratingsByWeather = new List <RatingByWeather>(); while (reader.Read()) { ratingsByWeather.Add(new RatingByWeather( reader.GetDouble("Rating"), reader.GetString("WeatherType"), reader.GetString("Date") )); } return(ratingsByWeather); }
public override IReadOnlyList <Customer> Translate(SqlCommand command, IDataRowReader reader) { var customers = new List <Customer>(); while (reader.Read()) { customers.Add(new Customer( reader.GetInt32("CustomerID"), reader.GetString("Name"), reader.GetDouble("Budget"), reader.GetInt32("Age"), reader.GetString("Sex"), reader.GetInt32("ContactID") )); } return(customers); }
public override IReadOnlyList <AllWorkouts> Translate(SqlCommand command, IDataRowReader reader) { var workouts = new List <AllWorkouts>(); while (reader.Read()) { workouts.Add(new AllWorkouts( reader.GetString("StartTime"), reader.GetString("EndTime"), reader.GetDouble("Rating"), reader.GetString("Date"), reader.GetDouble("Weight"), reader.GetDouble("SleepDuration"), reader.GetDouble("Calories"), reader.GetDouble("Duration"), reader.GetDouble("AvgHeartRate"), reader.GetInt32("IsIndoor"), reader.GetString("WeatherType"), reader.GetString("Name"))); } return(workouts); }
/// <summary> /// Method to create the objects with the information /// returned from the sql procedure. /// </summary> /// <param name="command">The Sql command</param> /// <param name="reader">The data row reader</param> /// <returns>A dictionary with the Movie as the key and the theater sales as the value</returns> public override Dictionary <Movie, double> Translate(SqlCommand command, IDataRowReader reader) { var movies = new Dictionary <Movie, double>(); while (reader.Read()) { movies.Add(new Movie(reader.GetInt32("MovieId"), reader.GetString("MovieTitle"), reader.GetString("Rating"), reader.GetInt32("RuntimeMinutes"), reader.GetDateTime("ReleaseDate")), reader.GetDouble("TheaterSales")); } return(movies); }