Exemplo n.º 1
0
        public void TryOut()
        {
            Console.WriteLine("De BookApp");

            //omdat er altijd van Book.Xml vertrokken wordt => hard coded ipv DI
            Bll.Book    book    = new Bll.Book();
            Dal.BookXml bookXml = new Dal.BookXml(book);
            bookXml.Book = book;
            bookXml.ReadAll();

            //als er zowel csv als json als xml aanwezig waren kon met DI gewerkt worden zoals hieronder
            //dal.Separator = '|';
            //dal.ReadAll();


            //Verder werken met DI
            Console.WriteLine(dal.Message);
            View.BookConsole view = new View.BookConsole(dal.Book);
            view.List();
            // serialize postcodes met een andere separator
            // naar ander bestand
            dal.ConnectionString = "Data/Book2";
            dal.Create('|');
            Console.WriteLine(dal.Message);
        }
Exemplo n.º 2
0
 static void PrintJson()
 {
     Bll.Book     book     = new Bll.Book();
     Dal.BookJson bookJson = new Dal.BookJson(book);
     bookJson.ConnectionString = @"Data/Book2";
     // bookJson.Book = book;
     bookJson.ReadAll();
     View.BookConsole view = new View.BookConsole(book);
     view.List();
 }
Exemplo n.º 3
0
 static void PrintCsv()
 {
     Bll.Book    book    = new Bll.Book();
     Dal.BookCsv bookCsv = new Dal.BookCsv(book);
     bookCsv.ConnectionString = @"Data/Book2";
     //   bookCsv.Book = book;
     bookCsv.ReadAll();
     View.BookConsole view = new View.BookConsole(book);
     view.List();
 }
Exemplo n.º 4
0
        static void PrintXml()
        {
            Bll.Book    book    = new Bll.Book();
            Dal.BookXml bookXml = new Dal.BookXml(book);
            bookXml.ConnectionString = @"Data/Book2";
            //     bookXml.Book = book;
            bookXml.ReadAll();
            Console.WriteLine(bookXml.Message);

            View.BookConsole view = new View.BookConsole(book);
            view.List();
        }
Exemplo n.º 5
0
 static void CreateXmlFromXml()
 {
     Console.WriteLine("De Book App Xml to Xml");
     Bll.Book    book    = new Bll.Book();
     Dal.BookXml bookXml = new Dal.BookXml(book);
     bookXml.Book = book;
     bookXml.ReadAll();
     Console.WriteLine(bookXml.Message);
     View.BookConsole view = new View.BookConsole(book);
     view.List();
     bookXml.ConnectionString = "Data/Book2";
     bookXml.Create();
     Console.WriteLine(bookXml.Message);
 }
Exemplo n.º 6
0
 static void CreateJsonFromXml()
 {
     Console.WriteLine("De Book App Xml to Json");
     Bll.Book    book    = new Bll.Book();
     Dal.BookXml bookXml = new Dal.BookXml(book);
     bookXml.Book = book;
     bookXml.ReadAll();
     Console.WriteLine(bookXml.Message);
     View.BookConsole view = new View.BookConsole(book);
     view.List();
     // serialize naar ander bestand
     Dal.BookJson bookJson = new Dal.BookJson(book);
     bookJson.ConnectionString = "Data/Book2";
     bookJson.Create();
     Console.WriteLine(bookJson.Message);
 }