Ejemplo n.º 1
0
        public static Events SearchEvents(Events eventsList, string field, string op, string[] values)
        {
            Events filteredList = FilterEvents(eventsList, field, op, values);

            IOConsole toDisplay = new IOConsole(filteredList);

            toDisplay.DisplayEventsToConsole();
            return(filteredList);
        }
Ejemplo n.º 2
0
        public static void AddEvents(string[] args)
        {
            IOConsole newEvent    = new IOConsole();
            string    date        = args[1];;
            string    title       = Utils.CodingNewLineChar(args[2]);
            string    description = "";

            if (args.Length == 4)
            {
                description = Utils.CodingNewLineChar(args[3]);
            }
            newEvent.AddDataFromConsole(date, title, description);
        }
Ejemplo n.º 3
0
        public static void ExportEvents(string[] args)
        {
            TXTFile files      = new TXTFile();
            Events  eventsList = files.LoadEventsFromFile();

            eventsList.Sort();
            if (args.Length == 2)
            {
                ExportToHTMLFile(@args[1], eventsList);
            }
            else
            {
                IOConsole evTools        = new IOConsole();
                string    criteria       = Utils.ParseFilteringCriteria(args[1]);
                Events    eventsToExport = SimpleDateFiltering(eventsList, criteria, DateTime.Today.ToShortDateString());
                ExportToHTMLFile(@args[2], eventsToExport);
            }
        }
Ejemplo n.º 4
0
        public static void DisplayEvents(string parameter)
        {
            TXTFile   files      = new TXTFile();
            Events    eventsList = files.LoadEventsFromFile();
            IOConsole display    = new IOConsole(eventsList);

            if (parameter == "all")
            {
                display.DisplayEventsToConsole();
            }
            else
            {
                string    criteria        = Utils.ParseFilteringCriteria(parameter);
                Events    eventsToDisplay = SimpleDateFiltering(eventsList, criteria, DateTime.Today.ToShortDateString());
                IOConsole toDisplay       = new IOConsole(eventsToDisplay);
                toDisplay.DisplayEventsToConsole();
            }
        }