Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (sessionValues.getCustomerSessionObject() == null)
            {
                //Response.Redirect("Login_WebForm");
                Response.Redirect("Login_WebForm");
            }
            else if (sessionValues.getCartSessionList() == null)
            {
                Response.Redirect("Login_WebForm");
            }
            else
            {
                if (sessionValues.getCartSessionList() != null)
                {
                    cartlist = sessionValues.getCartSessionList();
                }
                else
                {
                }
                sendOrderCompleted();
                insertOrder();
            }

            Session.Clear();
            Session.RemoveAll();
            Session.Abandon();

            HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
            HttpContext.Current.Response.Cache.SetNoServerCaching();
            HttpContext.Current.Response.Cache.SetNoStore();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (sessionValues.getCustomerSessionObject() == null)
            {
                //Response.Redirect("Login_WebForm");
                Response.Redirect("Login_WebForm?param1=" + "cartLogin");
            }


            if (sessionValues.getCartSessionList() != null)
            {
                cartlist = sessionValues.getCartSessionList();
                limitProductAmountOnStock();
                updatePriceLabel();
            }

            if (!cartlist.Any())
            {
                // confirmAndPayButton.Enabled = false;
                cartEmptyLabel.Visible      = true;
                totalPriceLabel.Visible     = false;
                CustomerInfoLabel.Visible   = false;
                confirmAndPayButton.Enabled = false;
            }

            if (!Page.IsPostBack)
            {
                ViewState["postids"] = System.Guid.NewGuid().ToString();
                Session["postid"]    = ViewState["postids"].ToString();

                System.Diagnostics.Debug.WriteLine("Not Post back");
                dataTable = new DataTable();
                createDataTable();
                addProductsDataToGridView();
                gridViewDataBind();
                setUserInformation();
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("Postback");
                dataTable = (DataTable)ViewState["DataTable"];

                if (ViewState["postids"].ToString() != Session["postid"].ToString())
                {
                    pageRefresh = true;
                }
                Session["postid"]    = System.Guid.NewGuid().ToString();
                ViewState["postids"] = Session["postid"].ToString();
            }
            ViewState["DataTable"] = dataTable;
            // setCustomerInfoLabel();
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     sessionValues = new SessionValues();
     if (sessionValues.getCustomerSessionObject() == null)
     {
         Response.Redirect("ShoppingPage_WebForm");
     }
     else
     {
         // oldCustomerObject = (Customer)Session["currentLogedInUserObject"];
         oldCustomerObject  = sessionValues.getCustomerSessionObject();
         databaseConnecctor = new DatabaseConnector();
         if (!Page.IsPostBack)
         {
             fillTextBoxesWithOldInformation();
         }
     }
 }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Session["PageData"] = null;
            if (sessionValues.getCustomerSessionObject() == null)
            {
                //Response.Redirect("Login_WebForm");
                Response.Redirect("Login_WebForm");
            }
            else if (sessionValues.getCartSessionList() == null)
            {
                Response.Redirect("Login_WebForm");
            }
            else
            {
                setUserDetails();
            }

            HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
            HttpContext.Current.Response.Cache.SetNoServerCaching();
            HttpContext.Current.Response.Cache.SetNoStore();
        }
Esempio n. 5
0
        private void addOrdersToGridView()
        {
            customer = sessionValues.getCustomerSessionObject();
            List <ActualOrder> userOrders = databaseConnector.getCustomerOrders(customer.getCustomerID());

            for (int i = 0; i < userOrders.Count; i++)
            {
                DataRow dataRow = orderTable.NewRow();
                System.Diagnostics.Debug.WriteLine("seeee!!!!!   " + userOrders[i].getOrderID());
                dataRow["OrderID"] = userOrders[i].getOrderID();
                dataRow["Date"]    = userOrders[i].getDate();
                orderTable.Rows.Add(dataRow);
            }
        }
Esempio n. 6
0
        protected Customer callGetCustomerSessionObject()
        {
            SessionValues sv = new SessionValues();

            return(sv.getCustomerSessionObject());
        }