Пример #1
0
        public static TrafficCitation CreateForPedInVehicle(ComputerPlusEntity entity)
        {
            var citation = new TrafficCitation()
            {
                FirstName        = entity.FirstName,
                LastName         = entity.LastName,
                DOB              = entity.DOBString,
                HomeAddress      = entity.Address,
                CitationTimeDate = DateTime.Now.ToUniversalTime()
            };

            if (entity.Vehicle && !entity.Vehicle.IsPoliceVehicle)
            {
                citation.VehicleModel = entity.Vehicle.Model.Name;
                citation.VehicleTag   = entity.VehicleTag;
                citation.VehicleColor = entity.Vehicle.GetVehicleColorName();
            }
            else if (entity.Ped && entity.Ped.LastVehicle && !entity.Ped.LastVehicle.IsPoliceVehicle)
            {
                citation.VehicleModel = entity.Ped.LastVehicle.Model.Name;
                citation.VehicleTag   = entity.Ped.LastVehicle.LicensePlate;
                citation.VehicleColor = entity.Ped.LastVehicle.GetVehicleColorName();
            }
            else
            {
                citation.VehicleModel = "N/A";
                citation.VehicleTag   = "N/A";
                citation.VehicleColor = "N/A";
            }
            return(citation);
        }
Пример #2
0
 public static TrafficCitation CloneFromCitation(TrafficCitation citation)
 {
     return(new TrafficCitation()
     {
         FirstName = citation.FirstName,
         LastName = citation.LastName,
         DOB = citation.DOB,
         HomeAddress = citation.HomeAddress,
         CitationCity = citation.CitationCity,
         CitationStreetAddress = citation.CitationStreetAddress,
         VehicleColor = citation.VehicleColor,
         VehicleTag = citation.VehicleTag,
         VehicleModel = citation.VehicleModel,
         VehicleType = citation.VehicleType,
     });
 }