Example #1
0
        private static void SelectByCustomerId(int customerId)
        {
            CustomerManager customerManager = new CustomerManager(new EfCustomerDal());
            var             customer        = customerManager.GetByCustomerId(customerId).Data;

            Console.WriteLine(customer.Id + " " + "Kullanıcı Id " + customer.UserId + " " + customer.CompanyName);
        }
Example #2
0
        private static void CustomerTest()
        {
            CustomerManager customerManager = new CustomerManager(new EFCustomerDal());
            var             result          = customerManager.GetAll();

            if (result.Success == true)
            {
                foreach (var item in customerManager.GetByCustomerId(3).Data)
                {
                    Console.WriteLine(item.CustomerId + " / " + item.CompanyName);
                }
            }
            else
            {
                Console.WriteLine(result.Message);
            }
        }
Example #3
0
        private static void CustomerUpdate()
        {
            CustomerManager customerManager = new CustomerManager(new EfCustomerDal());

            CustomerList();
            Console.WriteLine("Güncellemek istediğiniz müşterinin Id'si: ");
            int id             = int.Parse(Console.ReadLine());
            var customerEntity = customerManager.GetByCustomerId(id).Data;

            Console.WriteLine(customerEntity.UserId + " " + customerEntity.CompanyName);
            Console.WriteLine("");
            UserList();
            Console.Write("Kullanıcı Id'si güncelleyiniz: ");
            customerEntity.UserId = int.Parse(Console.ReadLine());
            Console.Write("Şirket adını güncelleyiniz: ");
            customerEntity.CompanyName = Console.ReadLine();
            customerManager.Update(customerEntity);
        }