예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            cart = new List <Product>();

            if (!IsPostBack)
            {
                foreach (PostageOptions po in QueryClass.GetPostageOptions())
                {
                    ListItem li = new ListItem();
                    li.Text = po.Name;
                    DdlPostage.Items.Add(li);
                }
                DdlPostage.SelectedIndex = 0;
                postPrice.InnerText      = "Postage: $" + QueryClass.GetPostageOption(DdlPostage.SelectedIndex + 1).Price.ToString("F");
            }



            if (Session["cart"] != null)
            {
                cart = (List <Product>)Session["cart"];
            }

            else
            {
                Response.Redirect("Checkout");
            }
            if (Session["user"] != null)
            {
                User u = (User)Session["user"];
                email.Enabled      = false;
                email.Text         = u.Email;
                postcode.Text      = u.Postcode;
                suburb.Text        = u.Suburb;
                streetAddress.Text = u.Street;
                phone.Text         = u.Phone;
                lastName.Text      = u.LastName;
                firstName.Text     = u.FirstName;
            }
            // Make paypal or credit card form visible on page laod
            if (!paypal.Checked)
            {
                paypalForm.Visible = false;
                cardForm.Visible   = true;
            }
            else
            {
                paypalForm.Visible = true;
                cardForm.Visible   = false;
            }
        }
예제 #2
0
 protected void ddlPostage_Changed(object sender, EventArgs e)
 {
     postPrice.InnerText = "Postage: $" + QueryClass.GetPostageOption(DdlPostage.SelectedIndex).Price.ToString("F");
 }