Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            // Get the connection string from the appsettings.json file
            IConfigurationBuilder builder = new ConfigurationBuilder()
                                            .SetBasePath(Directory.GetCurrentDirectory())
                                            .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);

            IConfigurationRoot configuration = builder.Build();

            string connectionString = configuration.GetConnectionString("Project");

            IParkSqlDAO        parkSqlDAO         = new ParkSqlDAO(@"Server=.\SQLEXPRESS;Database=npcampground;Trusted_Connection=True;");
            ICampgroundSqlDAO  campgroundSqlDAO   = new CampgroundSqlDAO(@"Server=.\SQLEXPRESS;Database=npcampground;Trusted_Connection=True;");
            ICampsiteSqlDAO    campsiteSqlDAO     = new CampsiteSqlDAO(@"Server=.\SQLEXPRESS;Database=npcampground;Trusted_Connection=True;");
            IReservationSqlDAO reservationsSqlDAO = new ReservationSqlDAO(@"Server=.\SQLEXPRESS;Database=npcampground;Trusted_Connection=True;");

            ReservationSystemCLI cli = new ReservationSystemCLI(parkSqlDAO, campgroundSqlDAO, campsiteSqlDAO, reservationsSqlDAO);

            cli.ReservationInterface();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            // Get the connection string from the appsettings.json file
            IConfigurationBuilder builder = new ConfigurationBuilder()
                                            .SetBasePath(Directory.GetCurrentDirectory())
                                            .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);

            IConfigurationRoot configuration = builder.Build();

            string connectionString = configuration.GetConnectionString("Project");

            ISiteDAO        siteDAO        = new SiteSqlDAO(connectionString);
            IParkDAO        parkDAO        = new ParkSqlDAO(connectionString);
            IReservationDAO reservationDAO = new ReservationSqlDAO(connectionString);
            ICampgroundDAO  campgroundDAO  = new CampgroundSqlDAO(connectionString);

            CapstoneCLI CLI = new CapstoneCLI(siteDAO, parkDAO, reservationDAO, campgroundDAO);

            CLI.runCLI();
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            // Get the connection string from the appsettings.json file
            IConfigurationBuilder builder = new ConfigurationBuilder()
                                            .SetBasePath(Directory.GetCurrentDirectory())
                                            .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);

            IConfigurationRoot configuration = builder.Build();

            string          connectionString = configuration.GetConnectionString("Project");
            IParkDAO        parkDao          = new ParkSqlDAO(connectionString);
            ICampgroundDAO  campDao          = new CampgroundSqlDAO(connectionString);
            IReservationDAO resDao           = new ReservationSqlDAO(connectionString);


            // Create a menu and run it
            ViewParksMenu menu = new ViewParksMenu(campDao, parkDao, resDao);

            menu.Run();
        }
        static void Main(string[] args)
        {
            //Console.WriteLine(DateTime.Today.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture));
            // Get the connection string from the appsettings.json file
            IConfigurationBuilder builder = new ConfigurationBuilder()
                                            .SetBasePath(Directory.GetCurrentDirectory())
                                            .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);

            IConfigurationRoot configuration = builder.Build();

            string connectionString = configuration.GetConnectionString("npcampground");


            IParkDAO        parkDAO        = new ParkSqlDAO(connectionString);
            ICampgroundDAO  campgroundDAO  = new CampgroundSqlDAO(connectionString);
            ISiteDAO        siteDAO        = new SiteSqlDAO(connectionString);
            IReservationDAO reservationDAO = new ReservationSqlDAO(connectionString);

            NPCampsiteReservationCLI cli = new NPCampsiteReservationCLI(parkDAO, campgroundDAO, siteDAO, reservationDAO);

            cli.RunCLI();
        }
        static void Main(string[] args)
        {
            // Get the connection string from the appsettings.json file
            IConfigurationBuilder builder = new ConfigurationBuilder()
                                            .SetBasePath(Directory.GetCurrentDirectory())
                                            .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);

            IConfigurationRoot configuration = builder.Build();

            string connectionString = configuration.GetConnectionString("Project");

            IParkSqlDAO        parkDAO        = new ParkSqlDAO(connectionString);
            ICampgroundSqlDAO  campgroundDAO  = new CampgroundSqlDAO(connectionString);
            ISiteSqlDAO        siteDAO        = new SiteSqlDAO(connectionString);
            IReservationSqlDAO reservationDAO = new ReservationSqlDAO(connectionString);

            MenuCLI projectCLI = new MenuCLI(parkDAO, campgroundDAO, siteDAO, reservationDAO); // objects that implement interfaces

            projectCLI.RunCLI();

            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            // Get the connection string from the appsettings.json file
            IConfigurationBuilder builder = new ConfigurationBuilder()
                                            .SetBasePath(Directory.GetCurrentDirectory())
                                            .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);

            IConfigurationRoot configuration = builder.Build();

            string connectionString = configuration.GetConnectionString("Project");

            IParkDAO        parkDAO        = new ParkSqlDAO(connectionString);
            ICampgroundDAO  campgroundDAO  = new CampgroundSqlDAO(connectionString);
            ISiteDAO        siteDAO        = new SiteSqlDAO(connectionString);
            IReservationDAO reservationDAO = new ReservationSqlDAO(connectionString);


            CLIMainMenu cliMainMenu = new CLIMainMenu(parkDAO, campgroundDAO, siteDAO, reservationDAO);

            cliMainMenu.Run();

            //TODO write tests

            //Console.WriteLine(@"                                                                                                                                                             A");
            //Console.WriteLine(@"                                                                                                                                                            d$b");
            //Console.WriteLine(@"                                                                                                                                                          .d\$$b.");
            //Console.WriteLine(@" ___                _         ___                                            _                        ___                 _                            .d$i$$\$$b.");
            //Console.WriteLine(@"(  _`\             ( )       |  _`\                                         ( )_  _                  (  _`\              ( )_                             d$$@b");
            //Console.WriteLine(@"| |_) )  _ _  _ __ | |/')    | (_) )   __    ___    __   _ __  _   _    _ _ | ,_)(_)   _     ___     | (_(_) _   _   ___ | ,_)   __    ___ ___           d\$$$ib");
            //Console.WriteLine(@"| ,__/'/'_` )( '__)| , <     | ,  /  /'__`\/',__) /'__`\( '__)( ) ( ) /'_` )| |  | | /'_`\ /' _ `\   `\__ \ ( ) ( )/',__)| |   /'__`\/' _ ` _ `\       .d$$$\$$$b");
            //Console.WriteLine(@"| |   ( (_| || |   | |\`\    | |\ \ (  ___/\__, \(  ___/| |   | \_/ |( (_| || |_ | |( (_) )| ( ) |   ( )_) || (_) |\__, \| |_ (  ___/| ( ) ( ) |     .d$$@$$$$\$$ib.");
            //Console.WriteLine(@"(_)   `\__,_)(_)   (_) (_)   (_) (_)`\____)(____/`\____)(_)   `\___/'`\__,_)`\__)(_)`\___/'(_) (_)   `\____)`\__, |(____/`\__)`\____)(_) (_) (_)          d$$i$$b");
            //Console.WriteLine(@"                                                                                                            ( )_| |                                     d\$$$$@$b");
            //Console.WriteLine(@"                                                                                                            `\___/'                                  .d$@$$\$$$$$@b.");
            //Console.WriteLine(@"                                                                                                                                                   .d$$$$i$$$\$$$$$$b.");
            //Console.WriteLine(@"                                                                                                                                                           ###");
            //Console.WriteLine(@"                                                                                                                                                           ###");
            //Console.WriteLine(@"                                                                                                                                                           ###");
        }
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.Green;

            // Get the connection string from the appsettings.json file
            IConfigurationBuilder builder = new ConfigurationBuilder()
                                            .SetBasePath(Directory.GetCurrentDirectory())
                                            .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);

            IConfigurationRoot configuration = builder.Build();

            string connectionString = configuration.GetConnectionString("Project");

            IReservationDAO reservationDAO = new ReservationSqlDAO(connectionString);
            IParkDAO        parkDAO        = new ParkSqlDAO(connectionString);
            ISiteDAO        siteDAO        = new SiteSqlDAO(connectionString);
            ICampgroundDAO  campgroundDAO  = new CampgroundSqlDAO(connectionString);

            ParkMenu menu = new ParkMenu(parkDAO, campgroundDAO, siteDAO, reservationDAO);

            menu.RunCLI();
            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            // Get the connection string from the appsettings.json file
            IConfigurationBuilder builder = new ConfigurationBuilder()
                                            .SetBasePath(Directory.GetCurrentDirectory())
                                            .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);

            IConfigurationRoot configuration = builder.Build();

            string connectionString = configuration.GetConnectionString("Project");

            // Instantiate a DAO of each type to pass to the menus
            IParkDAO        parkDAO        = new ParkSqlDAO(connectionString);
            ICampgroundDAO  campgroundDAO  = new CampgroundSqlDAO(connectionString);
            ISiteDAO        siteDAO        = new SiteSqlDAO(connectionString);
            IReservationDAO reservationDAO = new ReservationSqlDAO(connectionString);

            // Create a new main menu object and pass in all the DAOS
            MainMenu mainMenu = new MainMenu(parkDAO, campgroundDAO, siteDAO, reservationDAO);

            // Run the menu.
            mainMenu.Run();
        }
Ejemplo n.º 9
0
        static void Main(string[] args)
        {
            // Get the connection string from the appsettings.json file
            IConfigurationBuilder builder = new ConfigurationBuilder()
                                            .SetBasePath(Directory.GetCurrentDirectory())
                                            .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);

            IConfigurationRoot configuration = builder.Build();

            // Save the connection string pulled from key(Project), Value(db connection info) pair
            string connectionString = configuration.GetConnectionString("Project");

            // Instantiate objects communicating with DB here and pass to menu class
            IParkSqlDAO        parkDAO        = new ParkSqlDAO(connectionString);
            ICampgroundSqlDAO  campgroundDAO  = new CampgroundSqlDAO(connectionString);
            ISiteSqlDAO        siteDAO        = new SiteSqlDAO(connectionString);
            IReservationSqlDAO reservationDAO = new ReservationSqlDAO(connectionString);

            // Instantiate menu class for entire program and send it the data access objects
            NpCampgroundCLI cli = new NpCampgroundCLI(parkDAO, campgroundDAO, siteDAO, reservationDAO);

            //Console menu entry point
            cli.Run();
        }
Ejemplo n.º 10
0
 public CapstoneCLI(string connectionString)
 {
     parks            = new ParkSqlDAO(connectionString);
     ConnectionString = connectionString;
 }