QueryHour() public method

public QueryHour ( ) : bool
return bool
Exemplo n.º 1
0
        }         // Main

        // ----------------------------------------------------------------------
        private static bool QueryPeriodData(ref string periodType, TimePeriodDemoData demoData)
        {
            ConsoleTool.WriteSeparatorLine();
            do
            {
                string input = ConsoleTool.QueryText("Period type (y/by/hy/q/m/bm/w/bw/d/h/min) [enter=" + periodType + "]: ", periodType);
                if (string.IsNullOrEmpty(input))
                {
                    return(false);
                }

                switch (input)
                {
                case "Y":
                    Console.Clear();
                    goto case "y";

                case "y":
                    periodType = input;
                    return
                        (demoData.QueryPeriodCount() &&
                         demoData.QueryYear() &&
                         demoData.QueryYearBaseMonth());

                case "BY":
                    Console.Clear();
                    goto case "by";

                case "by":
                    periodType = input;
                    return
                        (demoData.QueryYear());

                case "HY":
                    Console.Clear();
                    goto case "hy";

                case "hy":
                    periodType = input;
                    return
                        (demoData.QueryPeriodCount() &&
                         demoData.QueryYear() &&
                         demoData.QueryYearBaseMonth() &&
                         demoData.QueryYearHalfyear());

                case "Q":
                    Console.Clear();
                    goto case "q";

                case "q":
                    periodType = input;
                    return
                        (demoData.QueryPeriodCount() &&
                         demoData.QueryYear() &&
                         demoData.QueryYearBaseMonth() &&
                         demoData.QueryYearQuarter());

                case "M":
                    Console.Clear();
                    goto case "m";

                case "m":
                    periodType = input;
                    return
                        (demoData.QueryPeriodCount() &&
                         demoData.QueryYear() &&
                         demoData.QueryYearMonth());

                case "BM":
                    Console.Clear();
                    goto case "bm";

                case "bm":
                    periodType = input;
                    return
                        (demoData.QueryYear() &&
                         demoData.QueryYearMonth());

                case "W":
                    Console.Clear();
                    goto case "w";

                case "w":
                    periodType = input;
                    return
                        (demoData.QueryPeriodCount() &&
                         demoData.QueryYear() &&
                         demoData.QueryYearWeekType() &&
                         demoData.QueryWeek());

                case "BW":
                    Console.Clear();
                    goto case "bw";

                case "bw":
                    periodType = input;
                    return
                        (demoData.QueryYear() &&
                         demoData.QueryWeek());

                case "D":
                    Console.Clear();
                    goto case "d";

                case "d":
                    periodType = input;
                    return
                        (demoData.QueryPeriodCount() &&
                         demoData.QueryYear() &&
                         demoData.QueryYearMonth() &&
                         demoData.QueryDay());

                case "H":
                    Console.Clear();
                    goto case "h";

                case "h":
                    periodType = input;
                    return
                        (demoData.QueryPeriodCount() &&
                         demoData.QueryYear() &&
                         demoData.QueryYearMonth() &&
                         demoData.QueryDay() &&
                         demoData.QueryHour());

                case "Min":
                    Console.Clear();
                    goto case "min";

                case "min":
                    periodType = input;
                    return
                        (demoData.QueryPeriodCount() &&
                         demoData.QueryYear() &&
                         demoData.QueryYearMonth() &
                         demoData.QueryDay() &&
                         demoData.QueryHour() &&
                         demoData.QueryMinute());
                }
            } while (true);
        }         // QueryPeriodData
Exemplo n.º 2
0
        // ----------------------------------------------------------------------
        private static bool QueryPeriodData( ref string periodType, TimePeriodDemoData demoData )
        {
            ConsoleTool.WriteSeparatorLine();
            do
            {
                string input = ConsoleTool.QueryText( "Period type (y/hy/q/m/w/d/h/min) [enter=" + periodType + "]: ", periodType );
                if ( string.IsNullOrEmpty( input ) )
                {
                    return false;
                }

                switch ( input )
                {
                    case "Y":
                        Console.Clear();
                        goto case "y";
                    case "y":
                        periodType = input;
                        return
                            demoData.QueryPeriodCount() &&
                            demoData.QueryYear() &&
                            demoData.QueryYearBaseMonth();
                    case "HY":
                        Console.Clear();
                        goto case "hy";
                    case "hy":
                        periodType = input;
                        return
                            demoData.QueryPeriodCount() &&
                            demoData.QueryYear() &&
                            demoData.QueryYearBaseMonth() &&
                            demoData.QueryYearHalfyear();
                    case "Q":
                        Console.Clear();
                        goto case "q";
                    case "q":
                        periodType = input;
                        return
                            demoData.QueryPeriodCount() &&
                            demoData.QueryYear() &&
                            demoData.QueryYearBaseMonth() &&
                            demoData.QueryYearQuarter();
                    case "M":
                        Console.Clear();
                        goto case "m";
                    case "m":
                        periodType = input;
                        return
                            demoData.QueryPeriodCount() &&
                            demoData.QueryYear() &&
                            demoData.QueryYearMonth();
                    case "W":
                        Console.Clear();
                        goto case "w";
                    case "w":
                        periodType = input;
                        return
                            demoData.QueryPeriodCount() &&
                            demoData.QueryYear() &&
                            demoData.QueryYearWeekType() &&
                            demoData.QueryWeek();
                    case "D":
                        Console.Clear();
                        goto case "d";
                    case "d":
                        periodType = input;
                        return
                            demoData.QueryPeriodCount() &&
                            demoData.QueryYear() &&
                            demoData.QueryYearMonth() &&
                            demoData.QueryDay();
                    case "H":
                        Console.Clear();
                        goto case "h";
                    case "h":
                        periodType = input;
                        return
                            demoData.QueryPeriodCount() &&
                            demoData.QueryYear() &&
                            demoData.QueryYearMonth() &&
                            demoData.QueryDay() &&
                            demoData.QueryHour();
                    case "Min":
                        Console.Clear();
                        goto case "min";
                    case "min":
                        periodType = input;
                        return
                            demoData.QueryPeriodCount() &&
                            demoData.QueryYear() &&
                            demoData.QueryYearMonth() &
                            demoData.QueryDay() &&
                            demoData.QueryHour() &&
                            demoData.QueryMinute();
                }
            } while ( true );
        }