//-------------------------------------------------------------------------- public List <TourDetailPrice> init(SqlCommand cmd) { SqlConnection con = db.getConnection(); cmd.Connection = con; List <TourDetailPrice> l_TourDetailPrice = new List <TourDetailPrice>(); try { con.Open(); SqlDataReader reader = cmd.ExecuteReader(); SmartDataReader smartReader = new SmartDataReader(reader); while (smartReader.Read()) { TourDetailPrice m_TourDetailPrice = new TourDetailPrice(); m_TourDetailPrice.TourDetailPrice_ID = smartReader.GetInt32("TourDetailPrice_ID"); m_TourDetailPrice.TourDetailPrice_ArrivalDate = smartReader.GetDateTime("TourDetailPrice_ArrivalDate"); m_TourDetailPrice.TourDetailPrice_DepartureDate = smartReader.GetDateTime("TourDetailPrice_DepartureDate"); m_TourDetailPrice.TourDetailPrice_Price1 = smartReader.GetInt64("TourDetailPrice_Price1"); m_TourDetailPrice.TourDetailPrice_NumberPrice1 = smartReader.GetInt32("TourDetailPrice_NumberPrice1"); m_TourDetailPrice.TourDetailPrice_Price2 = smartReader.GetInt64("TourDetailPrice_Price2"); m_TourDetailPrice.TourDetailPrice_NumberPrice2 = smartReader.GetInt32("TourDetailPrice_NumberPrice2"); m_TourDetailPrice.TourDetailPrice_Price3 = smartReader.GetInt64("TourDetailPrice_Price3"); m_TourDetailPrice.TourDetailPrice_NumberPrice3 = smartReader.GetInt32("TourDetailPrice_NumberPrice3"); l_TourDetailPrice.Add(m_TourDetailPrice); } smartReader.disposeReader(reader); return(l_TourDetailPrice); } catch (SqlException err) { throw err; } finally { db.closeConnection(con); } }
public List <RoomHotel> init(SqlCommand cmd) { SqlConnection con = db.getConnection(); cmd.Connection = con; List <RoomHotel> l_RoomHotel = new List <RoomHotel>(); try { con.Open(); SqlDataReader reader = cmd.ExecuteReader(); SmartDataReader smartReader = new SmartDataReader(reader); while (smartReader.Read()) { RoomHotel m_RoomHotel = new RoomHotel(); m_RoomHotel.RoomHotel_ID = smartReader.GetInt32("RoomHotel_ID"); m_RoomHotel.RoomHotel_Title = smartReader.GetString("RoomHotel_Title"); m_RoomHotel.RoomHotel_Image = smartReader.GetString("RoomHotel_Image"); m_RoomHotel.RoomHotel_ListImage = smartReader.GetString("RoomHotel_ListImage"); m_RoomHotel.Hotel_ID = smartReader.GetInt32("Hotel_ID"); m_RoomHotel.RoomHotel_Type = smartReader.GetInt32("RoomHotel_Type"); m_RoomHotel.RoomHotel_Content = smartReader.GetString("RoomHotel_Content"); m_RoomHotel.RoomHotel_Extensions = smartReader.GetString("RoomHotel_Extensions"); m_RoomHotel.RoomHotel_View = smartReader.GetString("RoomHotel_View"); m_RoomHotel.RoomHotel_Bed = smartReader.GetString("RoomHotel_Bed"); m_RoomHotel.RoomHotel_Adutls = smartReader.GetInt32("RoomHotel_Adutls"); m_RoomHotel.RoomHotel_Infants = smartReader.GetInt32("RoomHotel_Infants"); m_RoomHotel.RoomHotel_Acreage = smartReader.GetFloat("RoomHotel_Acreage"); m_RoomHotel.RoomHotel_TotalPrice = smartReader.GetInt64("RoomHotel_TotalPrice"); m_RoomHotel.RoomHotel_DateStart = smartReader.GetDateTime("RoomHotel_DateStart"); m_RoomHotel.RoomHotel_DateEndArray = smartReader.GetDateTime("RoomHotel_DateEndArray"); m_RoomHotel.Hotel_TimeZone = smartReader.GetInt32("Hotel_TimeZone"); m_RoomHotel.Hotel_Price = smartReader.GetInt32("Hotel_Price"); m_RoomHotel.Hotel_PriceSale = smartReader.GetInt32("Hotel_PriceSale"); m_RoomHotel.Hotel_Qty = smartReader.GetInt32("Hotel_Qty"); l_RoomHotel.Add(m_RoomHotel); } smartReader.disposeReader(reader); return(l_RoomHotel); } catch (SqlException err) { throw err; } finally { db.closeConnection(con); } }