Example #1
0
        public bool AddRegistryTrafficTicket(TrafficTicket t, vehicle v, DateTime time)
        {
            RpRegistryTrafficTickets rpRegistry = new RpRegistryTrafficTickets();
            RpDrivers     rpD   = new RpDrivers();
            List <Driver> ListD = rpD.GetDrivers().ToList();
            Driver        d     = null;

            foreach (Driver driver in ListD)
            {
                foreach (vehicle car in driver.listVehicles)
                {
                    if (car.Registration == v.Registration)
                    {
                        d = driver;
                        break;
                    }
                }
            }

            if (d != null)
            {
                return(rpRegistry.AddRegistryTrafficTicket(t, v, d, time));
            }
            else
            {
                //TODO mandar mensaje error
                return(false);
            }
        }
Example #2
0
        public List <Driver> GetDrivers()
        {
            RpDrivers rpDrivers = new RpDrivers();

            return(rpDrivers.GetDrivers().ToList());
        }