public BusInfo SelectByBusID(string busID) { IDataReader Reader = DataAccess.SelectByBusID(busID); BusInfo busInfo = new BusInfo(); if (Reader.Read()) { busInfo.BusID = Convert.ToString(Reader["BusID"]); busInfo.BusCode = Convert.ToString(Reader["BusCode"]); busInfo.BusNo = Convert.ToString(Reader["BusNo"]); busInfo.BusTypeID = Convert.ToString(Reader["BusTypeID"]); busInfo.TotalSeats = Convert.ToInt32(Reader["TotalSeats"]); } Reader.Close(); return(busInfo); }
public BusCollection SelectList() { BusCollection collection = new BusCollection(); IDataReader Reader = DataAccess.SelectList(); while (Reader.Read()) { BusInfo businfo = new BusInfo(); businfo.BusID = Convert.ToString(Reader["BusID"]); businfo.BusCode = Convert.ToString(Reader["BusCode"]); businfo.BusNo = Convert.ToString(Reader["BusNo"]); businfo.BusTypeID = Convert.ToString(Reader["BusTypeID"]); businfo.BusTypeDescription = Convert.ToString(Reader["Description"]); businfo.TotalSeats = Convert.ToInt32(Reader["TotalSeats"]); collection.Add(businfo); } Reader.Close(); return(collection); }
public void UpdateByBusID(BusInfo busInfo) { DataAccess.UpdateByBusID(busInfo.BusID, busInfo.BusCode, busInfo.BusNo, busInfo.BusTypeID); }
public void Insert(BusInfo busInfo) { DataAccess.Insert(busInfo.BusID, busInfo.BusCode, busInfo.BusNo, busInfo.BusTypeID); }