Пример #1
0
        static void Main(string[] args)
        {
            // CustomManager customManager = new CustomManager(10);
            EmployeeManager employeeManager = new EmployeeManager(new DatabaseLogger());

            employeeManager.Add();

            PersonManager personManager = new PersonManager("Product");

            personManager.Add();
            Console.ReadLine();
        }
Пример #2
0
        static void Main(string[] args)
        {
            //CustomerManager customerManager = new CustomerManager();
            //customerManager.List();

            //Product product = new Product { Id=1,Name="Laptop"};
            //Product product2 = new Product ();

            //EmloyeeManager emloyeeManager = new EmloyeeManager(new DataBaseLogger());
            //emloyeeManager.Add();

            PersonManager personManager = new PersonManager("Product");

            personManager.Add();
            Teacher.Number = 10;
            Utilities.Validate();
        }
Пример #3
0
        static void Main(string[] args)
        {
            //(75)//////////////////////YAPICI BLOKLARA GİRİŞ(CONSTRUCTOR)/////////////////////////////////

            //(75)constructor lar bir sınıf new lendiğinde çalışacak kod bloğudur.
            CustomerManager customerManager = new CustomerManager(10);//(75)İnstance içinden değer gönderilirse içi dolu olan constructor, değer gönderilmezse içi boş olan constructor çalışır.

            customerManager.Add();

            //(76)///////////////////////NESNE ÖRNEKLERİ İÇİN CONSTRUCTOR////////////////////////////////////

            Product product  = new Product(1, "bv");//(76)buradan değerler constructor içine gönderiliyor
            Product product2 = new Product {
                Id = 1, Name = "laptop"
            };                                                         // (76)burada değerler doğrudan propertylere set ediliyor.

            //(77)//////////////////////////////////CONSTRUCTOR İNJECTİON////////////////////////////////////

            EmployeeManager employeeManager = new EmployeeManager(new DatabaseLogger());//(77)Hülle nesnei kullanımında artık Log metodunun hangi sınıf içinde çalıştırılacağını  instance ın constructor bölümünden parametre olarak gönderiyoruz.

            //employeeManager.Logger = new FileLogger();//(77) EmployeeManager içinde property den interface e erişim sağlarken burada çalışacak log metodunun databaselogger dan mı yoksa filelogger sınıfından mı çalışacağını bu heap atamasıyla yapıyorduk.
            employeeManager.Add();

            //(78)///////////////////////TEMEL SINIFIN YAPICI BLOĞUNA PARAMETRE GÖNDERME/////////////////////////

            PersonManager personManager = new PersonManager("product"); //(78)

            personManager.Add();                                        //(78)

            //(79)//////////////////////////////STATİC CLASS VE METOTLAR/////////////////////////////////////////

            Teacher.Number = 10;             //(79)Static nesneler çağırılırken instance üretmeye gerek yoktur.

            Utilities.Validate();            //(79) Sınıf static ise metot static olmak zoundadır.

            Manager.DoSomething();           //(79)Sınıf static değilse de altında metot static tanımlanabilir bu durumda instance a gerek yoktur.

            Manager manager = new Manager(); //(79)static olamayan sınıfın altındaki static olmayan metot için yine instance gerekir.

            manager.DoSomething2();          //(79)



            Console.ReadLine();
        }
Пример #4
0
        static void Main(string[] args)
        {
            CustomerManager customerManager = new CustomerManager(13);

            customerManager.List();

            Product product0 = new Product(1, "Hamza");
            Product product1 = new Product();

            EmployeeManager employeeManager = new EmployeeManager(new DatabaseLogger());

            employeeManager.Add();

            PersonManager personManager = new PersonManager("Product");

            personManager.Add();

            Console.ReadLine();
        }
Пример #5
0
        static void Main(string[] args)
        {
            CustomerManager customerManager = new CustomerManager();

            customerManager.List();
            Product product = new Product {
                ID = 1, Name = "Laptop"
            };

            Product product2 = new Product(2, "Computer");

            EmployeeManager employeeManager = new EmployeeManager(new DatabaseLogger());

            employeeManager.Add();

            PersonManager personManager = new PersonManager("Product");

            Console.ReadLine();
        }
Пример #6
0
        static void Main(string[] args)
        {
            CustomerManager customerManager = new CustomerManager();

            customerManager.List();


            Product product = new Product {
                Id = 1, Name = "Laptop"
            };
            Product product2 = new Product();
            Product product3 = new Product(2, "Laptop");


            EmployeeManager employeeManager = new EmployeeManager(new DatabaseLogger());

            employeeManager.Add();
            EmployeeManager employeeManager2 = new EmployeeManager(new FileLogger());

            employeeManager2.Add();


            PersonManager personManager = new PersonManager("Product");

            personManager.Add();


            Teacher.Number = 10;


            Utilities.Validate();


            Manager.DoSmt();
            Manager manager = new Manager();

            manager.DoSmt2();



            Console.ReadLine();
        }
Пример #7
0
        static void Main(string[] args)
        {
            CustomerManager customer = new CustomerManager();

            customer.Add();
            customer.List();

            EmployeeManager employeeManager = new EmployeeManager(new DatabaseLogger());

            employeeManager.Add();

            PersonManager personManager = new PersonManager("product");

            personManager.add();

            Teacher.Number = 10;
            Utilities.Validate();

            Console.ReadLine();
        }
Пример #8
0
        static void Main(string[] args)
        {
            CustomerManager customerManager = new CustomerManager(23); customerManager.List();
            Product         product         = new Product {
                Id = 1, name = "laptop"
            };
            Product product2 = new Product(2, "Computer");

            EmployerManager employerManager = new EmployerManager(new DatabaseLogger());
            PersonManager   personManager   = new PersonManager("Product");

            personManager.Add();
            employerManager.Add();
            Teacher.Number = 10;
            Manager.DoSomething();
            Manager manager = new Manager();

            manager.DoSomething2();

            Console.ReadLine();
        }
Пример #9
0
        static void Main(string[] args)
        {//ExorTek(Mehmet Demirel)
         //Console.WriteLine("Please enter a number : ");
         //int number = Convert.ToInt32(Console.ReadLine());

            CustomerManager customerManager = new CustomerManager(15 /* number */);

            customerManager.List();

            Product product = new Product()
            {
                Id   = 1,
                Name = "Mehmet"
            };

            Product product2 = new Product(2, "Mehmet");

            EmployeeManager employeeManager = new EmployeeManager(new FileLogger());

            //employeeManager.Logger = new DatabaseLogger();
            //employeeManager.Logger = new FileLogger();
            employeeManager.Add();

            PersonManager personManager = new PersonManager("Person");

            personManager.Add();

            Teacher.Number = 65;
            Console.WriteLine(Teacher.Number);

            Utilities.Validate();

            Manager.DoSomething();

            Manager manager = new Manager();

            manager.DoSomethings();

            Console.ReadLine();
        }
Пример #10
0
        static void Main(string[] args)
        {
            CustomerManager customerManager = new CustomerManager();

            customerManager.List();
            Product product = new Product {
                Id = 1, Name = "laptop"
            };
            Product product1 = new Product {
                Id = 2, Name = "computer"
            };
            //Product product = new Product();
            //product.Id();
            //product.Name();
            //Product product1 = new Product();
            //product1.Id();
            //product1.Name(); de diyebilirdim.

            EmployeeManager employeeManager = new EmployeeManager(new DatabaseLogger());

            //DatabaseLogger databaseLogger = new DatabaseLogger();
            //EmployeeManager employeeManager = new EmployeeManager(databaseLogger);
            //böyle de çağırabilirim daha güzel olur

            employeeManager.Add();

            PersonManager personManager = new PersonManager("Product");  /*istenen mesajı yazdım*/

            personManager.Add();

            teacher.Number = 15;
            Utilities.Validate();
            Manager.DoSomething();
            Manager.DoSomething2();
            Manager manager = new Manager();

            manager.DoSomething3();
            Console.ReadLine();
        }
Пример #11
0
        static void Main(string[] args)
        {
            CustomerManager customerManager = new CustomerManager();

            customerManager.List();

            Product product = new Product {
                Id = 1, Name = "Laptop"
            };
            Product product2 = new Product(2, "Computer");

            EmployeeManager employeeManager = new EmployeeManager(new DatabaseLogger()); //filelogger ve databaselogger kullanılabiliyor


            //employeeManager.Logger = new DatabaseLogger();

            //employeeManager.Logger = new FileLogger(); // ctor yapıldıgı için ihtiyaç kalmadı

            //employeeManager.Logger = new DatabaseLogger(); // ctor yapıldığı için ihtiyaç kalmadı

            employeeManager.Add();

            PersonManager personManager = new PersonManager("Product");

            personManager.Add();

            Teacher.Number = 10; // static oldugu için bu sekilde cagriliyor

            Utilities.Validate();

            Manager.DoSomething();// static oldugu için direk bu sekilde cagrılıyor


            Manager manager = new Manager(); //static olmadığı için isntance üzerinden cagrılıyor

            manager.DoSomethin2();

            Console.ReadLine();
        }
Пример #12
0
        static void Main(string[] args)
        {
            CustumorManager custumorManager = new CustumorManager(23);

            custumorManager.List();
            CustumorManager custumorManager2 = new CustumorManager();

            custumorManager2.List();

            Product product = new Product {
                Id = 1, Name = "Derya"
            };
            Product product2 = new Product(2, "Duygu");

            EmployeeManager employeeManager = new EmployeeManager(new DatabaseLogger());

            PersonManager personManager = new PersonManager("Product");

            personManager.Add();


            Console.ReadKey();
        }
Пример #13
0
        static void Main(string[] args)
        {
            CustomerManager customerManager = new CustomerManager(20);

            customerManager.List();

            Product product1 = new Product {
                Id = 1, Name = "Computer"
            };

            Console.WriteLine(product1.Name);

            Product product = new Product(2, "Bilgisayar");


            EmployeeManager employeeManager = new EmployeeManager(new DatabaseLogger());

            employeeManager.Add();

            PersonManager personManager = new PersonManager("Product");

            personManager.Add();
            Console.ReadLine();
        }