コード例 #1
0
        public Request CreateRequest(Guid driverId, string registrationNumber)
        {
            Request request = new Request()
            {
                Id = Guid.NewGuid(),
            };
            var driver = DriverRepository.GetRouteWithVehicle(driverId);

            if (driver.CurrentRoute != null)
            {
                var trailer = TrailerRepository.GetByRegistrationNumber(registrationNumber);
                request.SetTrailer(trailer);

                request.SetVehicle(driver.CurrentRoute.Vehicle);
                request.SetStatus(RequestStatus.Active);
                request.SetSender(driver.Id);
                RequestRepository.Add(request);
                PersistenceContext.SaveChanges();
            }
            return(request);
        }
コード例 #2
0
 public Trailer GetByRegistrationNumber(string trailerNumber)
 {
     return(trailersRepository.GetByRegistrationNumber(trailerNumber));
 }