public void Long_Maintenance(Bus baraabus) { DateTime Datum = DateTime.Now; MaintenanceTask LongTask = new MaintenanceTask(); LongTask.type = MaintenanceType.LongMaintenance; LongTask.PlannedDate = Datum.AddMonths((baraabus.Id - 1) % 12); while (!Idontcare(LongTask.PlannedDate)) { LongTask.PlannedDate = LongTask.PlannedDate.AddDays(1); } baraabus.Tasks.Add(LongTask); }
public void MasterRensteester(Bus barry) { DateTime Datum = DateTime.Now; decimal tryingdiehard = (barry.Id - 1) / 6; // Vier seizoenen (3 maanden) for (int i = 0; i < 4; i++) { MaintenanceTask task = new MaintenanceTask(); // Kleine reparatie beurten eens in de drie maanden task.PlannedDate = Datum.AddMonths((i * 3) + (barry.Id - 1) % 3).AddDays((int)Math.Floor(tryingdiehard)); task.type = MaintenanceType.ShortMaintenance; } }
public void renstester(Bus bus) { DateTime Datum = DateTime.Now; for (int i = 0; i < 60; i++) { MaintenanceTask Task = new MaintenanceTask(); // Voeg het aantal dagen toe op basis van de huidige week en dag Task.PlannedDate = Datum.AddDays((i * 7) + ((bus.Id - 1) % 7)); if (Task.PlannedDate.Year > Datum.Year) { break; } Task.type = i % 3 == (bus.Id - 1) % 3 ? MaintenanceType.LongCleaning : MaintenanceType.ShortCleaning; bus.Tasks.Add(Task); } }