コード例 #1
0
 /// <summary>
 /// Checks if we are repeating a flight or if we are repeating & reversing it.
 /// </summary>
 /// <param name="le">The logbook entry to start</param>
 /// <returns>The updated logbook entry</returns>
 private LogbookEntry CloneOrReverse(LogbookEntry le)
 {
     // if cloning, reset the ID and date
     if (util.GetIntParam(Request, "Clone", -1) != -1)
     {
         le            = le.Clone(null, util.GetIntParam(Request, "Reverse", -1) != -1);
         FlightID      = le.FlightID; // should be idFlightNew
         UseLastTail   = false;       // we need to use the tail from this flight's aircraft
         le.Date       = DateTime.Now;
         le.HobbsEnd   = le.HobbsStart = 0;
         le.EngineEnd  = le.EngineStart = le.FlightStart = le.FlightEnd = DateTime.MinValue;
         le.FlightData = null;
     }
     return(le);
 }
コード例 #2
0
    /// <summary>
    /// Checks if we are repeating a flight or if we are repeating & reversing it.
    /// </summary>
    /// <param name="le">The logbook entry to start</param>
    /// <returns>The updated logbook entry</returns>
    private LogbookEntry CloneOrReverse(LogbookEntry le)
    {
        // if cloning, reset the ID and date
        if (util.GetIntParam(Request, "Clone", -1) != -1)
        {
            le            = le.Clone();
            FlightID      = le.FlightID; // should be idFlightNew
            UseLastTail   = false;       // we need to use the tail from this flight's aircraft
            le.Date       = DateTime.Now;
            le.HobbsEnd   = le.HobbsStart = 0;
            le.EngineEnd  = le.EngineStart = le.FlightStart = le.FlightEnd = DateTime.MinValue;
            le.FlightData = null;

            if (util.GetIntParam(Request, "Reverse", -1) != -1)
            {
                string[] rgRoute = MyFlightbook.Airports.AirportList.NormalizeAirportList(le.Route);
                Array.Reverse(rgRoute);
                le.Route = String.Join(Resources.LocalizedText.LocalizedSpace, rgRoute);
            }
        }
        return(le);
    }