static void Main(string[] args) { SparePart repuesto1 = new SparePart("10", "Brembo", 590); SparePart repuesto2 = new SparePart("45", "Yokohama", 700); List <SparePart> repuestos = new List <SparePart> { }; repuestos.Add(repuesto1); repuestos.Add(repuesto2); Mechanic mecanico1 = new Mechanic("001", "Roberto", "Carlos", "Mecanica de frenos", 350); Mechanic mecanico2 = new Mechanic("002", "Roman", "Riquelme", "Mecanica ligera", 275); Mechanic mecanico3 = new Mechanic("003", "Hugo", "Ibarra", "Mecanica de frenos", 450); Supervisor supervisor1 = new Supervisor("101", "Martín", "Palermo", "Mecanica de frenos", 700); Vehicle vehiculo1 = new Vehicle("159753", "Chevrolet", "Astra", "2006", "SAV 7313"); Vehicle vehiculo2 = new Vehicle("745896", "Nissan", "Versa", "2017", "SAB 4785"); Vehicle vehiculo3 = new Vehicle("555203", "Peugeot", "208", "2021", "RAB 4444"); WorkOrder orden1 = new WorkOrder("17/05/2021", "Mecanica ligera", vehiculo1, repuestos, 20, "Planificado", mecanico1); WorkOrder orden2 = new WorkOrder("12/10/2020", "Mecanica de freno", vehiculo2, repuestos, 10, "Planificado", mecanico2); WorkOrder orden3 = new WorkOrder("08/12/2019", "Mecanica ligera", vehiculo3, repuestos, 40, "Planificado", mecanico3); WorkShop workShop = new WorkShop(); orden1.OrderCost(); orden2.OrderCost(); orden3.OrderCost(); supervisor1.ApproveOrder(orden1); supervisor1.ApproveOrder(orden2); supervisor1.ApproveOrder(orden3); mecanico1.ValidateMechanic(orden1); mecanico2.ValidateMechanic(orden1); Console.WriteLine(); workShop.WaitingToCurrent(orden3); supervisor1.CompletedJob(orden1); supervisor1.ApproveOrder(orden3); supervisor1.ApproveOrder(orden3); Console.WriteLine(); }
public override string ApproveOrder(int orderTotal) { return(orderTotal < 500 ? $"Approved by {Name}" : Supervisor.ApproveOrder(orderTotal)); }