public static void ShowTrafficCitationCreate(TrafficCitation citation, ComputerPlusEntity entity = null, TrafficCitationView.TrafficCitationActionEvent callbackDelegate = null)
        {
            TrafficCitation mCitation = null;

            if (citation == null && entity == null)
            {
                mCitation = Globals.PendingTrafficCitation != null ? Globals.PendingTrafficCitation : new TrafficCitation();
            }
            else if (citation == null && entity.Validate())
            {
                Function.Log("Creating Traffic Citation for ped in vehicle");
                mCitation = TrafficCitation.CreateForPedInVehicle(entity);
                Globals.PendingTrafficCitation = mCitation;
                Function.Log("Created Traffic Citation for ped  " + mCitation.FirstName);
            }
            else if (citation != null && citation == Globals.PendingTrafficCitation && !citation.FullName.Equals(entity.FullName))
            {
                if (entity.Validate())
                {
                    mCitation = TrafficCitation.CreateForPedInVehicle(entity);
                }
                else
                {
                    mCitation = new TrafficCitation();
                }
                Globals.PendingTrafficCitation = mCitation;
            }
            else
            {
                mCitation = citation;
            }
            Globals.Navigation.Push(new TrafficCitationCreateContainer(mCitation, TrafficCitationView.ViewTypes.CREATE, callbackDelegate));
        }
Ejemplo n.º 2
0
 internal TrafficCitationCreateContainer(TrafficCitation citation, TrafficCitationView.ViewTypes viewType = TrafficCitationView.ViewTypes.CREATE, TrafficCitationView.TrafficCitationActionEvent actionCallback = null) : base("Traffic Citation", TrafficCitationView.DefaultWidth, TrafficCitationView.DefaultHeight)
 {
     Citation = citation;
     ViewType = viewType;
     Callback = actionCallback;
 }