Beispiel #1
0
        static void Main(string[] args)
        {
            // Select all countries
            //GetAllCountries();

            // Get a count of all countries
            //GetCountryCount();

            // Select cities that belong to a country code
            //GetCitiesForCountryCode("USA");


            //Console.ReadKey();
            //return;

            //IConfigurationBuilder builder = new ConfigurationBuilder()
            //    .SetBasePath(Directory.GetCurrentDirectory())
            //    .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);

            //IConfigurationRoot configuration = builder.Build();
            //string connectionString = configuration.GetConnectionString("World");


            ICityDAO     cityDAO     = null;
            ICountryDAO  countryDAO  = new CountrySqlDAO(connectionString);
            ILanguageDAO languageDAO = null;

            WorldGeographyCLI cli = new WorldGeographyCLI(cityDAO, countryDAO, languageDAO);

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

            //IConfigurationRoot configuration = builder.Build();
            //string connectionString = configuration.GetConnectionString("World");


            ICityDAO     cityDAO     = new CitySqlDAO(@"Data Source=.\SQLEXPRESS;Initial Catalog=World;Integrated Security=True");
            ICountryDAO  countryDAO  = new CountrySqlDAO(@"Data Source=.\SQLEXPRESS;Initial Catalog=World;Integrated Security=True");
            ILanguageDAO languageDAO = null;

            WorldGeographyCLI cli = new WorldGeographyCLI(cityDAO, countryDAO, languageDAO);

            cli.RunCLI();
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            //IConfigurationBuilder builder = new ConfigurationBuilder()
            //    .SetBasePath(Directory.GetCurrentDirectory())
            //    .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);

            //IConfigurationRoot configuration = builder.Build();
            //string connectionString = configuration.GetConnectionString("World");


            ICityDAO     cityDAO     = null;
            ICountryDAO  countryDAO  = null;
            ILanguageDAO languageDAO = null;

            WorldGeographyCLI cli = new WorldGeographyCLI(cityDAO, countryDAO, languageDAO);

            cli.RunCLI();
        }
Beispiel #4
0
 public WorldGeographyCLI(ICityDAO cityDAO, ICountryDAO countryDAO, ILanguageDAO languageDAO)
 {
     this.cityDAO     = cityDAO;
     this.languageDAO = languageDAO;
     this.countryDAO  = countryDAO;
 }
 /// <summary>
 /// Constructor adds items to the top-level menu
 /// </summary>
 public CountryMenu(Country country, ICityDAO cityDAO, ICountryDAO countryDAO, ILanguageDAO languageDAO) :
     base(cityDAO, countryDAO, languageDAO)
 {
     // Save the country (which will be used for all country queries
     this.country = country;
 }
Beispiel #6
0
 public CountryController(ICityDAO cityDao, ICountryDAO countryDao, ILanguageDAO languageDao)
 {
     this.cityDao     = cityDao;
     this.countryDao  = countryDao;
     this.languageDao = languageDao;
 }
Beispiel #7
0
 /// <summary>
 /// Constructor adds items to the top-level menu
 /// </summary>
 public WorldDBMenu(ICityDAO cityDAO, ICountryDAO countryDAO, ILanguageDAO languageDAO) : base()
 {
     this.cityDAO     = cityDAO;
     this.languageDAO = languageDAO;
     this.countryDAO  = countryDAO;
 }