Exemplo n.º 1
0
    protected void gvData_RowCommand(object sender, CommandEventArgs e)
    {
        if (e == null)
        {
            throw new ArgumentNullException(nameof(e));
        }

        int index = Convert.ToInt32(e.CommandArgument, System.Globalization.CultureInfo.InvariantCulture);
        TelemetryReference ted = BoundData[index];
        LogbookEntry       le  = new LogbookEntry();

        le.FLoadFromDB(ted.FlightID.Value, Page.User.Identity.Name, LogbookEntry.LoadTelemetryOption.LoadAll, true);

        if (e.CommandName == "MapEm")
        {
            using (FlightData fd = new FlightData())
            {
                if (fd.ParseFlightData(le.FlightData))
                {
                    mfbGMapStraight.Map.Path      = fd.GetPath();
                    mfbGMapReconstituded.Map.Path = ted.GoogleData.DecodedPath();
                    pnlMaps.Visible = true;
                }
            }
        }
        else if (e.CommandName == "FromFlights")
        {
            le.Telemetry.Compressed = 0;    // no longer know the compressed
            le.MoveTelemetryFromFlightEntry();
            UpdateElement(index, le.Telemetry);
        }
        else if (e.CommandName == "ToFlights")
        {
            le.MoveTelemetryToFlightEntry();
            UpdateElement(index, le.Telemetry);
        }
    }