/// <summary>
        /// The page_ load.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.User.Identity.IsAuthenticated)
            {
                this.Response.Redirect("~/Login.aspx");
            }

            // Loading articles
            this.workingman = new ShoppingCartActions();
            this.transportman = new OrderLogic(new DeliveryOracleContext(), new PickupOracleContext(), new OrderOracleContext());

            // Loading user
            var customerLogic = new CustomerLogic(new CustomerOracleContext());
            this.currentCustomer = customerLogic.GetByEmail(HttpContext.Current.User.Identity.Name);

            // Put information in form
            this.HcustomerID.Value = this.currentCustomer.Id.ToString();
            this.txtName.Text = this.currentCustomer.Name;
            this.txtAddress.Text = this.currentCustomer.Address;
            this.txtPostalCode.Text = this.currentCustomer.Postalcode;
            this.txtCity.Text = this.currentCustomer.City;
            this.txtTelePhoneNumber.Text = this.currentCustomer.Telephone;
            this.txtEmailAddress.Text = this.currentCustomer.Emailaddress;

            // Loading list of stores for picking up
            this.storeLogic  = new StoreLogic(new StoreOracleContext());

            foreach (var store in storeLogic.GetAllStores())
            {
                this.drpStores.Items.Add("MyCom - " + store.Address);
            }

            // Loading fields for delivery
            this.txtAlterAddress.Text = this.currentCustomer.Address;
            this.txtAlterCity.Text = this.currentCustomer.City;
            this.txtAlterPostal.Text = this.currentCustomer.Postalcode;
        }
Ejemplo n.º 2
0
 public void GetCustomerByEmail()
 {
     var logic = new CustomerLogic(new CustomerOracleContext());
     var customer = logic.GetByEmail("*****@*****.**");
     Assert.IsNotNull(customer, "Getting customer by id failed");
 }