Esempio n. 1
0
 public OrderImporter(dbi298845_prangersEntities database, countrycode countrycode) : base(database, countrycode)
 {
     database.Configuration.AutoDetectChangesEnabled = false;
     mappings      = database.mappings.ToList();
     stores        = database.stores.ToList();
     deliveryTypes = database.deliverytypes.ToList();
     products      = database.products.ToList();
     sauces        = database.sauces.ToList();
     bottoms       = database.bottoms.ToList();
     ingredients   = database.ingredients.ToList();
 }
Esempio n. 2
0
        private static countrycode GetOrCreateDefaultCountryCode(dbi298845_prangersEntities db)
        {
            //check if countrycode exists, so we can create a bottomprice for NL stores
            var countrycode = db.countrycodes.SingleOrDefault(i => i.code == "NL");

            if (countrycode == null) // if it doesnt exists, create a new countrycode
            {
                countrycode = new countrycode()
                {
                    code = "NL"
                };

                db.countrycodes.Add(countrycode);
                db.SaveChanges();
            }

            return(countrycode);
        }
Esempio n. 3
0
        static void Main(string[] allInputString)
        {
            dbi298845_prangersEntities database = new dbi298845_prangersEntities();
            countrycode countrycode             = GetOrCreateDefaultCountryCode(database);

            // Create the router to route the commands through.
            CommandRouter commandRouter = new CommandRouter(database, countrycode);

            // Register all possible commands.
            commandRouter.Register(new CommandImportPostalCode());
            commandRouter.Register(new CommandImportStore());
            commandRouter.Register(new CommandImportBottom());
            commandRouter.Register(new CommandImportProduct());
            commandRouter.Register(new CommandImportIngredient());
            commandRouter.Register(new CommandImportPizzaIngredient());
            commandRouter.Register(new CommandParseMapping());
            commandRouter.Register(new CommandImportOrder());

            // Execute the command
            commandRouter.Execute(allInputString);
            Console.ReadKey();
        }
Esempio n. 4
0
 public StoreImporter(dbi298845_prangersEntities database, countrycode countrycode) : base(database, countrycode)
 {
 }
Esempio n. 5
0
 public PizzaIngredientImporter(dbi298845_prangersEntities database, countrycode countrycode) : base(database, countrycode)
 {
 }
Esempio n. 6
0
 public Importer(dbi298845_prangersEntities database, countrycode countrycode)
 {
     this.database    = database;
     this.countrycode = countrycode;
 }
Esempio n. 7
0
 public ProductIngredientImport(dbi298845_prangersEntities database, countrycode countrycode) : base(database, countrycode)
 {
 }