예제 #1
0
        static void Main(string[] args)
        {
            User_Interface UI  = new User_Interface();
            CSV_Processor  cSV = new CSV_Processor();


            String file_Selection = string.Empty;
            Int32  user_Choice    = 0;
            String search_Term    = string.Empty;

            //creating an array of WineItems
            //I know this should be in a class, but I cannot make it work.
            //Something is usually better than nothing.
            WineItem[] collection = new WineItem[4000];
            Int32      i          = 0;


            //Have user select the file to read from.
            UI.Load_File_Dialog(out file_Selection);

            cSV.Load_CSV(file_Selection, collection);

            UI.Query_User(out user_Choice);



            switch (user_Choice)
            {
            case 1:
            {
                foreach (WineItem item in collection)
                {
                    if (collection != null)
                    {
                        Console.WriteLine((collection[i]));
                        i++;
                    }
                }
                Console.ReadLine();
                UI.Query_User(out user_Choice);
                break;
            }

            case 2:
            {
                UI.Search_Menu(out search_Term);
                break;
            }
            }
        }
예제 #2
0
        static void Main(string[] args)
        {
           
            User_Interface UI = new User_Interface();
            CSV_Processor cSV = new CSV_Processor();
            

            String file_Selection = string.Empty;
            Int32 user_Choice = 0;
            String search_Term = string.Empty;

            //creating an array of WineItems
            //I know this should be in a class, but I cannot make it work.  
            //Something is usually better than nothing.
            WineItem[] collection = new WineItem[4000];
            Int32 i = 0;


            //Have user select the file to read from.
            UI.Load_File_Dialog(out file_Selection);

            cSV.Load_CSV(file_Selection, collection);

            UI.Query_User(out user_Choice);



            

            switch (user_Choice)
            {
                case 1:
                    {
                        foreach(WineItem item in collection)
                        {

                            if (collection != null)
                            {
                                Console.WriteLine((collection[i]));
                                i++;
                            }
                        }
                        Console.ReadLine();
                        UI.Query_User(out user_Choice);
                        break;
                    }
                case 2:
                    {

                        UI.Search_Menu(out search_Term);
                        break;

                    }




            }
            
            

        }