コード例 #1
0
 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));
        }