/// <summary> /// Constructs the class with the given parameters /// </summary> public Schoonmaak(Medewerker medewerker, DateTime date, Tram tram, SchoonmaakType type) { Medewerker = medewerker; Date = date; Tram = tram; Type = type; }
/// <summary> /// Contructs the maintenance with the given values /// </summary> public Maintenance(Medewerker medewerker, DateTime date, Tram tram, MaintenanceType type) { Medewerker = medewerker; Date = date; Tram = tram; Type = type; }
/// <summary> /// On launch we get pick a tram from the list which is the one being ridden by the driver. /// </summary> public DriversForm() { InitializeComponent(); List<Tram> tramList = Database.GetAllTrams().ToList(); int id = Database.GetRandomTramIdNotRemise(tramList.Count); _tram = tramList.First(t => t.Id == id); tbTramNummer.Text = _tram.Nummer.ToString(); lbTramNummer.Text = _tram.Nummer.ToString(); }
/// <summary> /// Updates the tram with the provided info /// </summary> /// <param name="tram"></param> public static int UpdateTram(Tram tram) { string query = $"UPDATE Tram SET \"Nummer\" = {tram.Nummer}, \"Lengte\" = {tram.Lengte}, " + $"\"Vervuild\" = {Convert.ToInt32(tram.Vervuild)}, \"Defect\" = {Convert.ToInt32(tram.Defect)}, " + $"\"ConducteurGeschikt\" = {Convert.ToInt32(tram.ConducteurGeschikt)}, \"Beschikbaar\" = {Convert.ToInt32(tram.Beschikbaar)}, " + $"\"Tramtype_ID\" = {tram.TramTypeId}, \"Remise_ID_Standplaats\" = {tram.RemiseId} WHERE Id = {tram.Id}"; return(ExecuteNonQuery(query)); }