public void SearchCustomers()
 {
     foreach (var item in _customerBL.GetCustomer())
     {
         Console.WriteLine(item.ToString());
     }
     Console.WriteLine("Press any key to continue");
     Console.ReadLine();
 }
示例#2
0
        private Customer SearchCustomer()
        {
            string phoneNumber = _validate.ValidateEmptyInput("Enter your phone number: ");

            try
            {
                Customer customer = _customerBL.GetCustomer(phoneNumber);
                return(customer);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.WriteLine("No matched branch is found. Go back to the Menu and create one");
                return(null);
            }
        }
示例#3
0
        public IActionResult Get(int?customerID, string email)
        {
            if (!customerID.HasValue && String.IsNullOrWhiteSpace(email))
            {
                return(BadRequest("No inquiry criteria"));
            }

            var customer = customerBL.GetCustomer(customerID, email);

            if (customer == null)
            {
                return(NotFound("Not found"));
            }
            var result = mapper.Map <CustomerInquiryResponseDto>(customer);

            return(Ok(result));
        }