public static int Create(SQLiteConnection conn, Vehicle vh, int typeId, int brandId, int driverId, int bossId) { // kontrola existence VIN v databázi bool vinExists = VehicleDbMapper.VinExists(conn, vh.Vin); if (vinExists) { return(-1); } vh.VehicleType = VehicleTypeXmlMapper.SelectById(typeId); vh.VehicleBrand = VehicleBrandXmlMapper.SelectById(brandId); vh.Driver = UserDriverDbMapper.SelectById(conn, 4); vh.Boss = UserBossDbMapper.SelectById(conn, 1); int result = VehicleDbMapper.Insert(conn, vh); return(result); }
public static UserBoss FindById(SQLiteConnection conn, int id) { return(UserBossDbMapper.SelectById(conn, id)); }
public static List <UserBoss> FindAll(SQLiteConnection conn) { return(UserBossDbMapper.SelectAll(conn)); }