예제 #1
0
    /// <summary>
    /// Updates the starting flight with the specified value in the specified column
    /// </summary>
    /// <param name="sfc">The column to read</param>
    /// <param name="sf">The target starting flight</param>
    /// <param name="value">The value</param>
    protected static void SetValueForColumn(StartingFlightColumn sfc, LogbookEntryCore sf, Decimal value)
    {
        if (sf == null)
        {
            throw new ArgumentNullException(nameof(sf));
        }
        switch (sfc)
        {
        case StartingFlightColumn.CFI:
            sf.CFI = value;
            break;

        case StartingFlightColumn.SIC:
            sf.SIC = value;
            break;

        case StartingFlightColumn.PIC:
            sf.PIC = value;
            break;

        case StartingFlightColumn.Total:
            sf.TotalFlightTime = value;
            break;
        }
    }
예제 #2
0
    protected static string ColumnTitleFromColumn(StartingFlightColumn sfc)
    {
        switch (sfc)
        {
        case StartingFlightColumn.CFI:
            return(Resources.LogbookEntry.FieldCFI);

        case StartingFlightColumn.SIC:
            return(Resources.LogbookEntry.FieldSIC);

        case StartingFlightColumn.PIC:
            return(Resources.LogbookEntry.FieldPIC);

        case StartingFlightColumn.Total:
            return(Resources.LogbookEntry.FieldTotal);
        }
        return("");
    }
예제 #3
0
    /// <summary>
    /// Gets the value from the starting flight in the specified column
    /// </summary>
    /// <param name="sfc">the column to read</param>
    /// <param name="sf">The starting flight</param>
    /// <returns>The appropriate column value</returns>
    protected static Decimal GetValueForColumn(StartingFlightColumn sfc, LogbookEntryCore sf)
    {
        if (sf == null)
        {
            throw new ArgumentNullException(nameof(sf));
        }
        switch (sfc)
        {
        case StartingFlightColumn.CFI:
            return(sf.CFI);

        case StartingFlightColumn.SIC:
            return(sf.SIC);

        case StartingFlightColumn.PIC:
            return(sf.PIC);

        case StartingFlightColumn.Total:
            return(sf.TotalFlightTime);
        }
        return(0.0M);
    }