Ejemplo n.º 1
0
 //Clears the Session 'cart' and creates a new list
 private void ClearCart()
 {
     listOfSales = new SalesList();
     Session["cart"] = listOfSales;
 }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["ClientID"] == null)
            {
                Response.Redirect("Home.aspx");
            }

            if (Session["SecurityLevel"] != null && Session["SecurityLevel"].ToString() == "1")
            {
                pnlCheckOut.Visible = false;
                btnFinalCheckOut.Visible = false;
                pnlSuccess.Visible = false;
                txtEmail.Text = GetEmailAddress();

                if (!IsPostBack || Session["cart"] == null)
                {
                    DAL_Project.DAL d = new DAL_Project.DAL(@"Data Source=localhost;Initial Catalog=dbDeidreFinalAssign;Integrated Security=SSPI");
                    Session["cart"] = new SalesList();
                    ListViewItem.DataSource = d.ExecuteProcedure("spGetItem");
                    ListViewItem.DataBind();
                }
                listOfSales = (SalesList)Session["cart"];
                RefreshCart();
            }
            else
            {
                Response.Redirect("Home.aspx");
            }
        }