예제 #1
0
        internal CustomerCatalog()
        {
            db        = CustomerDBFactory.GetDBL();
            customers = new Dictionary <int, Customer>();

            LoadCatalog();
        }
        public static List <Customer> LivingWithin100Km(ICustomerDB potentialCustomers)
        {
            LatLong DublinOffice = new LatLong(53.3393, -6.2576841);

            List <Customer> customers = new List <Customer>();

            foreach (Customer customer in potentialCustomers.Customers)
            {
                if (Earth.DistanceBetween(DublinOffice, customer.GpsCoord) <= 100.00)
                {
                    customers.Add(customer);
                }
            }

            customers.Sort((left, right) => left.Id.CompareTo(right.Id));

            return(customers);
        }
 public CustomerManager(ICustomerDB customerDB)
 {
     CustomerDB = customerDB;
 }
예제 #4
0
 public CustomerManager(IConfiguration configuration)
 {
     customerDB = new CustomerDB(configuration);
 }
예제 #5
0
 public CustomerController(ICustomerDB customerDB, ILocationDB locationDB)
 {
     this.customerDB = customerDB;
     this.locationDB = locationDB;
 }