/// <summary> /// 查询所有数据 /// </summary> /// <returns></returns> public List <Car> SelectAll() { carList.Clear(); var reader = db.ReadFullTable("CarInfo"); while (reader.Read()) { carList.Add(new Car { Index = Convert.ToInt16(reader["Idx"]), Type = Convert.ToString(reader["Type"]), CarNumber = Convert.ToString(reader["CarNumber"]), SeatNum = Convert.ToInt16(reader["SeatNum"]), CurbWeight = Convert.ToDouble(reader["CurbWeight"]), FullRated = Convert.ToDouble(reader["FullRated"]), Displacement = Convert.ToDouble(reader["Displacement"]), FrontSuspensionSystem = Convert.ToString(reader["FrontSuspensionSystem"]), RearSuspensionSystem = Convert.ToString(reader["RearSuspensionSystem"]), DriveMethod = Convert.ToString(reader["DriveMethod"]), Gearbox = Convert.ToString(reader["Gearbox"]), Brake = Convert.ToString(reader["Brake"]), BuyingTime = Convert.ToDateTime(reader["BuyingTime"]), InitialOdometerReading = Convert.ToInt16(reader["InitialOdometerReading"]), Picture = new BitmapImage(new Uri(Convert.ToString(reader["Picture"]), UriKind.RelativeOrAbsolute)) }); } return(carList); }
/// <summary> /// 查询所有数据 /// </summary> /// <returns></returns> public List <User> SelectAll() { userList.Clear(); var reader = db.ReadFullTable("UserInfo"); while (reader.Read()) { userList.Add(new User { Index = Convert.ToInt16(reader["Idx"]), UserName = Convert.ToString(reader["UserName"]), PassWord = Convert.ToString(reader["PassWord"]), Type = Convert.ToString(reader["Type"]), Picture = new BitmapImage(new Uri(Convert.ToString(reader["Picture"]), UriKind.RelativeOrAbsolute)) }); } return(userList); }
/// <summary> /// 查询所有数据 /// </summary> /// <returns></returns> public List <Equipment> SelectAll() { equipmentList.Clear(); var reader = db.ReadFullTable("EquipmentInfo"); while (reader.Read()) { equipmentList.Add(new Equipment { Index = Convert.ToInt16(reader["Idx"]), Name = Convert.ToString(reader["Name"]), Code = Convert.ToString(reader["Code"]), TermOfValidity = Convert.ToDateTime(reader["TermOfValidity"]), Picture = new BitmapImage(new Uri(Convert.ToString(reader["Picture"]), UriKind.RelativeOrAbsolute)) }); } return(equipmentList); }
/// <summary> /// 查询测试路线基础信息 /// </summary> private void SelectAllRouteBase() { testRouteBaseList.Clear(); var reader = db.ReadFullTable("TestRouteBaseInfo"); while (reader.Read()) { testRouteBaseList.Add(new TestRouteBase { Index = Convert.ToInt16(reader["Idx"]), TestRoutes = Convert.ToString(reader["TestRoutes"]), LineMileage = Convert.ToString(reader["LineMileage"]), Material = Convert.ToString(reader["Material"]), Time = Convert.ToString(reader["Time"]), Picture = new BitmapImage(new Uri(Convert.ToString(reader["Picture"]), UriKind.RelativeOrAbsolute)) }); } }