コード例 #1
0
ファイル: Program.cs プロジェクト: burakkoc5/ClassMethodDemo
        static void Main(string[] args)
        {
            Customer customer1 = new Customer();

            customer1.firstName = "Burak";
            customer1.lastName  = "Koç";
            customer1.id        = 1;

            Customer customer2 = new Customer();

            customer2.firstName = "Engin";
            customer2.lastName  = "Demirog";
            customer2.id        = 2;

            Customer customer3 = new Customer();

            customer3.firstName = "Berkay";
            customer3.lastName  = "Bilgin";
            customer3.id        = 3;

            Customer[] customers = new Customer[] { customer1, customer2, customer3 };

            CustomerManager cm = new CustomerManager();

            cm.addCustomer(customer1);
            cm.addCustomer(customer2);
            cm.addCustomer(customer3);
            Console.WriteLine("-----------------------");
            cm.showCustomers(customers);

            cm.deleteCustomer(customer1);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: gokcenaysu/CSharpCamp
        static void Main(string[] args)
        {
            Customer customer1 = new Customer();

            customer1.Id         = 1;
            customer1.FirstName  = "Aysu";
            customer1.LastName   = "Gökcen";
            customer1.CreditCard = "1234-4567-9876-5432";

            Customer customer2 = new Customer();

            customer2.Id         = 2;
            customer2.FirstName  = "Engin";
            customer2.LastName   = "Demiroğ";
            customer2.CreditCard = "9876-5432-1234-5678";

            /*  Customer[] customers = { customer1, customer2 };
             * foreach (Customer customer in customers)
             * {
             *    Console.WriteLine(customer.FirstName + " " + customer.LastName);
             *    Console.WriteLine(customer.CreditCard);
             * }*/

            CustomerManager customerManager = new CustomerManager();

            customerManager.addCustomer(customer1);
            customerManager.addCard(customer1);
            customerManager.deleteCustomer(customer2);
            customerManager.deleteCard(customer2);
        }
コード例 #3
0
        static void Main(string[] args)
        {
            CustomerManager manager = new CustomerManager();
            Customer        c1      = new Customer {
                name    = "Fikret",
                surname = "Gözütok",
                id      = "12323222",
                address = "Kütahya"
            };

            Customer c2 = new Customer
            {
                name    = "İsmail",
                surname = "Demir",
                id      = "111122233323",
                address = "Tavşanlı"
            };

            manager.deleteCustomer(c1);
            manager.addCustomer(c2);
            manager.getCustomerData(c2);



            Console.Read();
        }