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

            customerManager.ListCustomers();
            Console.WriteLine();

            customerManager.AddCustomer(new Customer
            {
                Id            = 1,
                FirstName     = "Burak",
                LastName      = "Kosova",
                AccountNumber = "456879731",
                TC            = "19245698764"
            });

            customerManager.AddCustomer(new Customer
            {
                Id            = 2,
                FirstName     = "Kendall",
                LastName      = "Jenner",
                AccountNumber = "456687978",
                TC            = "Not TC citizen"
            });

            customerManager.AddCustomer(new Customer
            {
                Id            = 3,
                FirstName     = "Cem",
                LastName      = "Yılmaz",
                AccountNumber = "442719332",
                TC            = "65478932125"
            });

            customerManager.AddCustomer(new Customer
            {
                Id            = 4,
                FirstName     = "Abel",
                LastName      = "Tesfaye",
                AccountNumber = "78214658",
                TC            = "Not TC citizen"
            });
            Console.WriteLine();

            customerManager.ListCustomers();
            Console.WriteLine();

            customerManager.DeleteCustomer(38);
            Console.WriteLine();

            customerManager.ListCustomers();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Customer customer1 = new Customer();

            customer1.Name    = "Mert";
            customer1.Surname = "Sevingit";
            customer1.Age     = 26;

            Customer customer2 = new Customer();

            customer2.Name    = "Mert2";
            customer2.Surname = "Sevingit2";
            customer2.Age     = 23;

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

            foreach (Customer customer  in customers)
            {
                Console.WriteLine("Customers :" + customer.Name + "-- " + customer.Surname + "-- " + "-- " + customer.Age);
                Console.WriteLine("-----------------------------");
            }

            CustomerManager customerManager = new CustomerManager();

            customerManager.ListCustomers(customer1, customer2);
            customerManager.AddCustomer(customer1);
            customerManager.DeleteCustomer(customer2);
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Customer customer = new Customer()
            {
                FirstName = "Salih",
                LastName  = "Harel",
                Mail      = "*****@*****.**",
                Id        = 4
            };

            CustomerManager customerManager = new CustomerManager();

            customerManager.Add(customer);
            Console.WriteLine("------------------");
            customerManager.Delete(customer);
            Console.WriteLine("------------------");

            Customer[] customers = new Customer[] { };
            customers = customerManager.ListCustomers();

            foreach (var cust in customers)
            {
                Console.WriteLine(cust.FirstName + " " + cust.LastName);
                Console.WriteLine(cust.Mail);
                Console.WriteLine("------------------");
            }
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            Customer customer = new Customer()
            {
                Id          = 1,
                Name        = "Tuğçe Asena",
                LastName    = "T.",
                Email       = "*****@*****.**",
                PhoneNumber = "+90 234 623 42 21",
                Title       = "Mrs. "
            };

            Customer customer1 = new Customer()
            {
                Id          = 2,
                Name        = "Gökhan",
                LastName    = "Şarapevi",
                Email       = "*****@*****.**",
                PhoneNumber = "+90 234 573 45 45",
                Title       = "Mr. "
            };

            Customer customer2 = new Customer()
            {
                Id          = 3,
                Name        = "Furkan",
                LastName    = "G.",
                Email       = "*****@*****.**",
                PhoneNumber = "+90 345 346 34 35",
                Title       = "Mr. "
            };

            Customer customer3 = new Customer()
            {
                Id          = 4,
                Name        = "Baha",
                LastName    = "Ö.",
                Email       = "*****@*****.**",
                PhoneNumber = "+90 325 234 62 12",
                Title       = "Mr. "
            };
            List <Customer> customers = new List <Customer> {
                customer, customer1, customer2, customer3
            };

            CustomerManager customerManager = new CustomerManager();

            Console.WriteLine("**-*-** In order to start the app press 'Enter' **-*-**");
            Console.WriteLine("**-*-** Keep pressing 'Enter' after each action takes place. **-*-**");
            Console.ReadKey();
            Console.WriteLine("**-*-** Customer Creation. **-*-**");
            customerManager.Add(customer);
            Console.WriteLine("**-*-** Customer Removal. **-*-**");
            customerManager.DeleteCustomer(customer1);
            Console.WriteLine("**-*-** Listing Customers. **-*-**");
            customerManager.ListCustomers(customers);
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            Customer customer1 = new Customer();

            customer1.Id      = 12;
            customer1.Name    = "Nur";
            customer1.Surname = "Ozcan";
            customer1.Age     = 26;

            Customer customer2 = new Customer();

            customer2.Id      = 4;
            customer2.Name    = "Anıl";
            customer2.Surname = "Ozcan";
            customer2.Age     = 23;

            CustomerManager customerManager = new CustomerManager();

            customerManager.AddCustomer(customer1);
            customerManager.DeleteCustomer(customer2);
            customerManager.ListCustomers(customer2);
        }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            Console.WriteLine("~~~~Welcome to the system~~~~");


            Customer c1 = new Customer();

            c1.CustomerID           = 2001;
            c1.CustomerName         = "Chandler Bing";
            c1.ProductName          = "Pinball Table";
            c1.CustomerBudget       = 300;
            c1.SuggestedProductCost = 450;

            Customer c2 = new Customer();

            c2.CustomerID           = 2002;
            c2.CustomerName         = "Monica Geller";
            c2.ProductName          = "Eyelash Curler";
            c2.CustomerBudget       = 150;
            c2.SuggestedProductCost = 120;

            Customer c3 = new Customer();

            c3.CustomerID           = 2003;
            c3.CustomerName         = "Joey Tribbiani";
            c3.ProductName          = "Duck";
            c3.CustomerBudget       = 20;
            c3.SuggestedProductCost = 15;

            Customer c4 = new Customer();

            c4.CustomerID           = 2004;
            c4.CustomerName         = "Phoebe Buffay";
            c4.ProductName          = "Guitar";
            c4.CustomerBudget       = 500;
            c1.SuggestedProductCost = 499;

            Customer c5 = new Customer();

            c5.CustomerID           = 2005;
            c5.CustomerName         = "Rachel Green";
            c5.ProductName          = "Fur";
            c5.CustomerBudget       = 600;
            c5.SuggestedProductCost = 1000;

            Customer c6 = new Customer();

            c6.CustomerID           = 2006;
            c6.CustomerName         = "Ross Geller";
            c6.ProductName          = "Dinosaur model";
            c6.CustomerBudget       = 900;
            c6.SuggestedProductCost = 850;

            Customer[] customers = new Customer[] { c1, c2, c3, c4, c5, c6 };

            Console.WriteLine();
            Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~Methods~~~~~~~~~~~~~~~~~~~~~~~");

            //instance
            Console.WriteLine();
            CustomerManager CManager = new CustomerManager();

            CManager.AddCustomer(c1);
            CManager.AddCustomer(c2);
            CManager.AddCustomer(c3);
            CManager.AddCustomer(c4);
            CManager.AddCustomer(c5);
            Console.WriteLine();
            Console.Write("Deletion Method : ");
            CManager.DeleteCustomer(c6);
            Console.WriteLine();

            CManager.ListCustomers(customers);
        }