Exemplo n.º 1
0
        static void Main(string[] args)
        {
            BaseCustomerManager customerManager = new StarbucksCustomerManager(new MernisServiceAdapter());

            customerManager.Save(new Customer
            {
                FirtsName     = "****",
                LastName      = "****",
                NationalityId = "12345678901",
                DateOfBirth   = new DateTime(1999, 9, 9)
            });


            Console.ReadLine();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            //BaseCustomerManager customerManager = new NeroCustomerManager(); Neroda artık doğrulama istiyor.
            //customerManager.Save(new Customer
            //{
            //    DateOfBirth = new DateTime(1995, 8, 30),
            //    FirstName = "Zafer",
            //    LastName = "Çalışkan",
            //    NationalityId = "1234567899"
            //});


            BaseCustomerManager customerManager2 = new StarbucksCustomerManager(new MernisServiceAdapter());  //Gerçek mernis ilede çalışabiliriz.

            customerManager2.Save(new Customer
            {
                DateOfBirth   = new DateTime(1995, 8, 30),
                FirstName     = "Zafer",
                LastName      = "Çalışkan",
                NationalityId = "1234567899"
            });

            BaseCustomerManager customerManager3 = new StarbucksCustomerManager(new CustomerCheckManager());  //Fake service ilede çalışabiliriz.

            customerManager3.Save(new Customer
            {
                DateOfBirth   = new DateTime(1995, 8, 30),
                FirstName     = "Zafer",
                LastName      = "Çalışkan",
                NationalityId = "1234567899"
            });


            //----
            BaseCustomerManager customerManager = new NeroCustomerManager(new MernisServiceAdapter());  //Neroda doğrulamayla çalışıyor.

            customerManager.Save(new Customer
            {
                DateOfBirth   = new DateTime(1995, 8, 30),
                FirstName     = "Zafer",
                LastName      = "Çalışkan",
                NationalityId = "1234567899"
            });

            //Burada soyutlamanın gücünden yararlandık.
            //Customer kimlik doğrulaması için extension method kullansak? Single responsibility bozar. Customer nesnesi bir entitydir.
            //Entity içinde başka iş yapılmaz.
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            BaseCustomerManager customerManager = new StarbucksCustomerManager(new MernisServiceAdapter());

            customerManager.Save(new Customer
            {
                Id            = 1,
                FirstName     = "Seyit",
                LastName      = "Uludağ",
                DateOfBirth   = new DateTime(2001, 07, 03),
                NationalityId = "25638845200"
            });


            Console.ReadLine();
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            Customer customer1 = new Customer()
            {
                FirstName     = "İbrahim",
                LastName      = "Kaplan",
                DateOfBirth   = 1992,
                NationalityId = "44917432622"
            };


            BaseCustomerManager customerManager = new StarbucksCustomerManager(new MernisServerAdapter());

            customerManager.Save(customer1);
            //BaseCustomerManager customerManager1 = new StarbucksCustomerManager(new CustomerCheckManager());
            //customerManager1.Save(customer1);
            Console.ReadLine();
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            BaseCustomerManager starbucksCustomerManager = new StarbucksCustomerManager();

            starbucksCustomerManager.Save(new Customer
            {
                DateOfBirth    = new DateTime(1994, 10, 21),
                FirstName      = "Gökhan", LastName = "Göy",
                NationalitytId = "12554330878"
            });

            BaseCustomerManager neroCustomerManager = new NeroCustomerManager();

            neroCustomerManager.Save(new Customer
            {
                DateOfBirth    = new DateTime(1994, 10, 21),
                FirstName      = "Gökhan",
                LastName       = "Göy",
                NationalitytId = "12554330878"
            });
        }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            BaseCustomerManager customerManagerStarbucks = new StarbucksCustomerManager(new MernisServiceAdapter());

            customerManagerStarbucks.Save(new Customer
            {
                //mernis sistemin calışabimesi için dogru veriler girilmelidir
                DateOfBirth   = new DateTime(2000),
                FirstName     = "Karya",
                LastName      = "Alkan",
                NationalityId = "627294829492"
            });

            BaseCustomerManager customerManagerNero = new NeroCustomerManager();

            customerManagerNero.Save(new Customer
            {
                DateOfBirth   = new DateTime(1995, 8, 4),
                FirstName     = "Karya",
                LastName      = "Alkan",
                NationalityId = "12345678901"
            });
            Console.ReadLine();
        }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            BaseCustomerManager customerManager = new NeroCustomerManager();

            customerManager.Save(new Customer
            {
                DateOfBirth   = new DateTime(1983, 2, 8),
                FirstName     = "Atiba",
                LastName      = "Hutchinson",
                NationalityId = "98765432100"
            });

            BaseCustomerManager customerManager2 = new StarbucksCustomerManager(new MernisServiceAdapter());

            customerManager2.Save(new Customer
            {
                DateOfBirth   = new DateTime(1992, 1, 22),
                FirstName     = "Vincent",
                LastName      = "Aboubakar",
                NationalityId = "12345678900"
            });

            Console.ReadLine();
        }