DevTreks.Extensions/AgBudgetingCalculators/InputsCapital/Machinery1Calculator.cs
/// <summary>
/// Get an input unit based on two input parameters
/// </summary>
Get an input unit based on two input parameters
Get an input unit based on two input parameters
public static void GetCapacityUnits(string optionForCapacity,
            string unitGroupId, out string unit)
        {
            unit = HOUR;
            int iUnitGroupId = (string.IsNullOrEmpty(unitGroupId) || unitGroupId == null)
                ? 1 : CalculatorHelpers.ConvertStringToInt(unitGroupId);
            if (optionForCapacity == "1")
            {
                if (iUnitGroupId < 1001)
                {
                    unit = HOURS_PER_HECTARE;
                }
                else
                {
                    unit = HOURS_PER_ACRE;
                }
            }
            else if (optionForCapacity == "2")
            {
                if (iUnitGroupId < 1001)
                {
                    unit = HOURS_PER_METRIC_TON;
                }
                else
                {
                    unit = HOURS_PER_TON;
                }
            }
            if (optionForCapacity == "3")
            {
                if (iUnitGroupId < 1001)
                {
                    unit = METRIC_TONS_PER_HOUR;
                }
                else
                {
                    unit = TONS_PER_HOUR;
                }
            }
        }
public static void GetCapacityUnits ( string optionForCapacity , string unitGroupId , out string unit ) { unit = HOUR ; int iUnitGroupId = ( string . IsNullOrEmpty ( unitGroupId ) || unitGroupId == null ) ? 1 : CalculatorHelpers . ConvertStringToInt ( unitGroupId ) ; if ( optionForCapacity == " " ) { if ( iUnitGroupId < 1001 ) { unit = HOURS_PER_HECTARE ; } else { unit = HOURS_PER_ACRE ; } } else if ( optionForCapacity == " " ) { if ( iUnitGroupId < 1001 ) { unit = HOURS_PER_METRIC_TON ; } else { unit = HOURS_PER_TON ; } } if ( optionForCapacity == " " ) { if ( iUnitGroupId < 1001 ) { unit = METRIC_TONS_PER_HOUR ; } else { unit = TONS_PER_HOUR ; } } }
Get an input unit based on two input parameters
Get an input unit based on two input parameters
//metric //metric //metric
optionForCapacity
string
unitGroupId
string
string
out