public List<RideOffer> GetActiveOffers(Int64 requestRecID) { try { using (connection) { rideOffersList = new List<RideOffer>(); connection = new SqlConnection(DAL.ConnectionString); string sqlSelectString = "SELECT RideRequestRecID, DriverUserID, Notes, Status from [RideOffers] where Status in (1, 2) and RideRequestRecID = " + requestRecID; command = new SqlCommand(sqlSelectString, connection); command.Connection.Open(); SqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { RideOffer rideOffer = new RideOffer(); User user = new User(); rideOffer.RideRequestRecID = Convert.ToInt64(reader[0]); rideOffer.DriverUserID = reader[1].ToString(); rideOffer.Notes = reader[2].ToString(); rideOffer.Status = Convert.ToInt32(reader[3]); user = userDAL.GetUser(rideOffer.DriverUserID); rideOffer.Driver = user; rideOffersList.Add(rideOffer); } command.Connection.Close(); return rideOffersList; } } catch (Exception ex) { // err.ErrorMessage = ex.Message.ToString(); throw; } }
public bool AcceptOffer(RideOffer rideOffer) { bool isAccepted = false; return isAccepted; }