private void PckTypeV_SelectedIndexChanged(object sender, EventArgs e) { Picker picker = sender as Picker; TypeVehicule cvModelSelected = (TypeVehicule)picker.SelectedItem; if (cvModelSelected.NomTypeVehicule != "Voiture") { lblNbPlace.IsVisible = false; txtNbPlace.IsVisible = false; } else { lblNbPlace.IsVisible = true; txtNbPlace.IsVisible = true; } }
public List <TypeVehicule> GetTypeVehicule() { #region Variables List <TypeVehicule> Types = new List <TypeVehicule>(); string query = "CALL GetTypes();"; int Code; string Name; Char Type; #endregion try { using (MySQLConn = new MySqlConnection(ConnectionDBTest.DbConnString())) { using (MySqlCommand cmd = new MySqlCommand(query.ToString(), MySQLConn)) { MySQLConn.Open(); var result = cmd.ExecuteReader(); while (result.Read()) { try { Code = result.GetInt32(0); Name = result.GetString(1); Type = result.GetChar(2); TypeVehicule Tv = new TypeVehicule(Code, Name, Type); Types.Add(Tv); } catch (System.Data.SqlTypes.SqlNullValueException e) { Code = 0; Name = ""; Type = ' '; TypeVehicule Tv = new TypeVehicule(Code, Name, Type); } } MySQLConn.Close(); } return(Types); } } catch (MySqlException e) { Console.Write("Ha ocurrido un error al conectar con la base de datos.\n"); return(null); } }
public void creerVehicule(Carburant carburant, TypeVehicule typeVehicule) { fabrique.creerVehicule(carburant, typeVehicule); }