コード例 #1
0
ファイル: App.cs プロジェクト: timjanssens/Programmeren3
        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);
        }
コード例 #2
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();
        }
コード例 #3
0
 static void CreateXmlFromXml()
 {
     Console.WriteLine("".PadLeft(100, '*'));
     Console.WriteLine($"\n\nDe Book App Xml to Xml\n\n");
     Console.WriteLine("".PadLeft(100, '*'));
     Bll.Book    book    = new Bll.Book();
     Dal.BookXml bookXml = new Dal.BookXml(book);
     // bookXml.Book = book;
     bookXml.ReadAll();
     Console.WriteLine(bookXml.Message);
     bookXml.ConnectionString = "Data/Book2";
     bookXml.Create();
     Console.WriteLine(bookXml.Message);
 }
コード例 #4
0
ファイル: Program.cs プロジェクト: timjanssens/Programmeren3
 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);
 }
コード例 #5
0
 static void CreateJsonFromXml()
 {
     Console.WriteLine("".PadLeft(100, '*'));
     Console.WriteLine($"\n\nDe Bookk App Xml to Json\n\n");
     Console.WriteLine("".PadLeft(100, '*'));
     Bll.Book    book    = new Bll.Book();
     Dal.BookXml bookXml = new Dal.BookXml(book);
     //   bookXml.Book = book;
     bookXml.ReadAll();
     Console.WriteLine(bookXml.Message);
     // Deserialize naar ander bestand
     Dal.BookJson bookJson = new Dal.BookJson(book);
     bookJson.ConnectionString = "Data/Book2";
     bookJson.Create();
     Console.WriteLine(bookJson.Message);
 }
コード例 #6
0
ファイル: Program.cs プロジェクト: timjanssens/Programmeren3
 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);
 }
コード例 #7
0
        public static void CreateCSV()
        {
            Console.WriteLine("".PadLeft(60, '*'));
            Console.WriteLine("\n\n\nDe BookApp CSV\n\n\n");
            Console.WriteLine("".PadLeft(60, '*'));

            Bll.Book    book    = new Bll.Book();
            Dal.BookXml bookXml = new Dal.BookXml(book);
            bookXml.Book = book;
            bookXml.ReadAll();
            Console.WriteLine(bookXml.Message);

            Dal.BookCsv bookCsv = new Dal.BookCsv(book);
            bookCsv.ConnectionString = @"Data/Book2";
            bookCsv.Create('|');
            Console.WriteLine(bookCsv.Message);
        }
コード例 #8
0
 static void CreateXmlFromXml()
 {
     Console.WriteLine("".PadLeft(100, '*'));
     Console.WriteLine($"\n\nDe Book App Xml to Xml\n\n");
     Console.WriteLine("".PadLeft(100, '*'));
     Bll.Book    book    = new Bll.Book();
     Dal.BookXml bookXml = new Dal.BookXml(book);
     bookXml.Book = book;
     bookXml.ReadAll();
     Console.WriteLine(bookXml.Message);
     //No need to show the list from originalXml
     // View.BookConsole view = new View.BookConsole(book);
     // view.List();
     bookXml.ConnectionString = "Data/Book2";
     bookXml.Create();
     Console.WriteLine(bookXml.Message);
 }
コード例 #9
0
        public static void CreateXML()
        {
            Console.WriteLine("".PadLeft(60, '*'));
            Console.WriteLine("\n\n\nDe BookApp XML\n\n\n");
            Console.WriteLine("".PadLeft(60, '*'));

            Bll.Book    book    = new Bll.Book();
            Dal.BookXml bookXml = new Dal.BookXml(book);
            bookXml.Book = book;
            bookXml.ReadAll();
            Console.WriteLine(bookXml.Message);

            BookXml bookXml1 = new BookXml(book);

            bookXml1.ConnectionString = @"Data/Book2";
            bookXml1.Create();
            Console.WriteLine(bookXml1.Message);
        }