public OrderProcessor(ApplicationData.ApplicationData context, Cart cart, ShippingDetailsViewModel shippingDetails)
 {
     this.context = context;
     this.cart    = cart;
     this.order   = new Order {
         OrderDate            = DateTime.Now,
         Email                = shippingDetails.Email,
         Sale                 = context.Sales.Where(x => x.Id == cart.SaleId).First(),
         ShipTo               = shippingDetails.FirstName + " " + shippingDetails.LastName,
         ShippingAddressLine1 = shippingDetails.AddressLine1,
         ShippingAddressLine2 = shippingDetails.AddressLine2,
         Suburb               = shippingDetails.Suburb,
         State                = shippingDetails.State,
         Postcode             = shippingDetails.Postcode
     };
 }
        public CartController()
        {
            string username = WebConfigurationManager.AppSettings["Username"];
            string password = WebConfigurationManager.AppSettings["Password"];

            NetworkCredential credentials = new NetworkCredential(username, password);

            if (applicationDataContext == null)
            {
                Uri applicationDataUri = new Uri(WebConfigurationManager.AppSettings["ApplicationDataUri"]);
                applicationDataContext             = new ApplicationData.ApplicationData(applicationDataUri);
                applicationDataContext.Credentials = credentials;
            }

            if (wmsDataContext == null)
            {
                Uri wmsDataUri = new Uri(WebConfigurationManager.AppSettings["WMSDataUri"]);
                wmsDataContext             = new WMSData.WMSData(wmsDataUri);
                wmsDataContext.Credentials = credentials;
            }
        }