Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //we needed to unimplement paypal
            invisi.Visible = false;


            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.GetPostageOptionByName(DdlPostage.SelectedItem.Text).Price.ToString("F");
            }



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

            else
            {
                Response.Redirect("Main");
            }
            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 Page_Load(object sender, EventArgs e)
        {
            string delete = Request.QueryString["delete"];

            options = QueryClass.GetPostageOptions();
            if (delete != null)
            {
                //Delete a specific postage option
                int index = Convert.ToInt32(delete);
                GlobalData.postageList.RemoveAt(index);
            }
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string delete = Request.QueryString["delete"];

            options = QueryClass.GetPostageOptions();
            if (delete != null)
            {
                int i = 0;
                try { i = Convert.ToInt32(delete); }
                catch { }
                QueryClass.ToggleDeletePostage(i);
                options = QueryClass.GetPostageOptions();
            }
        }