public MappingParser(dbi298845_prangersEntities database)
        {
            this.database = database;

            this.products    = database.products.ToList();
            this.mappings    = database.mappings.ToList();
            this.ingredients = database.ingredients.ToList();
        }
 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();
 }
Beispiel #3
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);
        }
Beispiel #4
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();
        }
Beispiel #5
0
 public StoreImporter(dbi298845_prangersEntities database, countrycode countrycode) : base(database, countrycode)
 {
 }
Beispiel #6
0
 public PizzaIngredientImporter(dbi298845_prangersEntities database, countrycode countrycode) : base(database, countrycode)
 {
 }
Beispiel #7
0
 public Importer(dbi298845_prangersEntities database, countrycode countrycode)
 {
     this.database    = database;
     this.countrycode = countrycode;
 }
 public ProductIngredientImport(dbi298845_prangersEntities database, countrycode countrycode) : base(database, countrycode)
 {
 }