Exemple #1
0
        public OrderDisplay RetrieveOrderDisplay(int orderId)
        {
            OrderDisplay orderDisplay = new OrderDisplay();

            var addressRepository = new AddressRepository();

            if (orderId == 10)
            {
                orderDisplay.FirstName       = "Bilbo";
                orderDisplay.LastName        = "Baggins";
                orderDisplay.OrderDate       = new DateTimeOffset(2014, 04, 14, 10, 00, 00, new TimeSpan(7, 0, 0));
                orderDisplay.ShippingAddress = addressRepository.Retrieve(1);
            }

            orderDisplay.OrderDisplayItemList = new List <OrderDisplayItem>();

            if (orderId == 10)
            {
                var orderDisplayItem = new OrderDisplayItem()
                {
                    ProductName   = "Sun Flowers",
                    PurchasePrice = 15.96M,
                    OrderQuantity = 2
                };
                orderDisplay.OrderDisplayItemList.Add(orderDisplayItem);
                orderDisplayItem = new OrderDisplayItem()
                {
                    ProductName   = "Rake",
                    PurchasePrice = 6M,
                    OrderQuantity = 1
                };
                orderDisplay.OrderDisplayItemList.Add(orderDisplayItem);
            }
            return(orderDisplay);
        }
        public OrderDisplay RetrieveOrderDisplay(int orderId)
        {
            OrderDisplay orderDisplay = new OrderDisplay();

            // Code that retrieves the defined order fields
            var addressRepository = new AddressRepository();

            // Temporary Hard-coded data
            if (orderId == 10)
            {
                orderDisplay.FirstName       = "Bilbo";
                orderDisplay.LastName        = "Baggins";
                orderDisplay.OrderDate       = new DateTimeOffset(2014, 4, 14, 10, 00, 00, new TimeSpan(7, 0, 0));
                orderDisplay.ShippingAddress = addressRepository.Retrieve(1);
            }

            orderDisplay.OrderDisplayItemList = new List <OrderDisplayItem>();

            // Code that retrieves the order items

            // Temporary Hard-coded data
            if (orderId == 10)
            {
                var orderDisplayItem = new OrderDisplayItem()
                {
                    ProductName   = "Sunflowers",
                    PurchasePrice = 15.96M,
                    OrderQuantity = 2
                };
                orderDisplay.OrderDisplayItemList.Add(orderDisplayItem);

                orderDisplayItem = new OrderDisplayItem()
                {
                    ProductName   = "Rake",
                    PurchasePrice = 6M,
                    OrderQuantity = 1
                };
                orderDisplay.OrderDisplayItemList.Add(orderDisplayItem);
            }


            return(orderDisplay);
        }
        public OrderDisplay RetrieveOrderDisplay(int orderId)
        {
            OrderDisplay orderDisplay = new OrderDisplay();

            // Code that retrieves the defined order fields
            var addressRepository = new AddressRepository();

            // Temporary Hard-coded data
            if (orderId == 10)
            {
                orderDisplay.FirstName = "Bilbo";
                orderDisplay.LastName = "Baggins";
                orderDisplay.OrderDate = new DateTimeOffset(2014, 4, 14, 10, 00, 00, new TimeSpan(7, 0, 0));
                orderDisplay.ShippingAddress = addressRepository.Retrieve(1);
            }

            orderDisplay.OrderDisplayItemList = new List<OrderDisplayItem>();

            // Code that retrieves the order items

            // Temporary Hard-coded data
            if (orderId == 10)
            {
                var orderDisplayItem = new OrderDisplayItem()
                {
                    ProductName = "Sunflowers",
                    PurchasePrice = 15.96M,
                    OrderQuantity = 2
                };
                orderDisplay.OrderDisplayItemList.Add(orderDisplayItem);

                orderDisplayItem = new OrderDisplayItem()
                {
                    ProductName = "Rake",
                    PurchasePrice = 6M,
                    OrderQuantity = 1
                };
                orderDisplay.OrderDisplayItemList.Add(orderDisplayItem);
            }


            return orderDisplay;
        }
Exemple #4
0
 public CutomerRepository()
 {
     addressRepository = new AddressRepository();
 }
 public CustomerRepository()
 {
     _addressRepository = new AddressRepository();
 }
 public CustomerRepository()
 {
     addressRepository = new AddressRepository(); //collaborative relationship
 }
 // Default constructor to add an instance of the address repository
 public CustomerRepository()
 {
     addressRepository = new AddressRepository();
 }
Exemple #8
0
        public List <Address> GetAddressesByClientId(int clientId)
        {
            AddressRepository addressRepository = new AddressRepository();

            return(addressRepository.RetriveByCustomerId(clientId).ToList());
        }
Exemple #9
0
 public CustomerRepository()
 {
     addressRepository = new AddressRepository();
     addressRepository.RetrieveByCustomerId(1);
 }
Exemple #10
0
 //la hago privada porque nadie mas aparte de esta clase necesita usar esta propiedad
 public CustomerRepository()
 {
     //lo instancio directo en el cosntructor
     addressRepository = new AddressRepository();
 }
 public CustomerRepository()
 {
     //Collaborative relationship
     addressRepository = new AddressRepository();
 }
Exemple #12
0
 public CustomerRepository()//establishes collaborative relationship w/ customerrepository
 {
     addressRepository = new AddressRepository();
 }
 public CustomerRepository()
 {
     // Establish collaborative relationship between CustomerRepository and AddressRepository
     addressRepository = new AddressRepository();
 }
Exemple #14
0
 public CustomerRepository()
 {
     ar = new AddressRepository();
 }
Exemple #15
0
 public CustomerRepository()
 {
     // Uses a relationship
     addressRepository = new AddressRepository();
 }