コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public void UpdateByBusID(BusInfo busInfo)
 {
     DataAccess.UpdateByBusID(busInfo.BusID, busInfo.BusCode, busInfo.BusNo, busInfo.BusTypeID);
 }
コード例 #4
0
 public void Insert(BusInfo busInfo)
 {
     DataAccess.Insert(busInfo.BusID, busInfo.BusCode, busInfo.BusNo, busInfo.BusTypeID);
 }