Example #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();
        }
Example #3
0
        protected string getTotalAmount()
        {
            SessionValues sv = new SessionValues();

            sv.getCartSessionList();
            int totalAmount = 0;

            for (int i = 0; i < sv.getCartSessionList().Count; i++)
            {
                totalAmount += sv.getCartSessionList()[i].getProductAmount();
                System.Diagnostics.Debug.WriteLine("count total cart amount" + sv.getCartSessionList()[i].getProductAmount());
            }

            return(totalAmount.ToString());
        }
Example #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();
        }
Example #5
0
        protected List <Cart> callGetCartSessionListObject()
        {
            SessionValues sv = new SessionValues();

            return(sv.getCartSessionList());
        }