Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["refNum"] != null)
            {
                cartNum = Convert.ToInt32(Session["refNum"]);
            }
            else
            {
                Response.Redirect("~/Home.aspx");
            }

            if (Session["currUser"] != null)
            {
                user = (string)Session["currUser"];

                FormView1.DataSource = DBOps.BuildCreditCardDetails(user);
                FormView1.DataBind();
                BindControls(1);
                lvw_totals.DataSource = DBOps.BuildUserCartTotals(cartNum);
                lvw_totals.DataBind();
            }
            else
            {
                FormView1.DataSource = DBOps.BuildCreditCardDetails("-");
                FormView1.DataBind();
                BindControls(0);
                lvw_totals.DataSource = DBOps.BuildUserCartTotals(cartNum);
                lvw_totals.DataBind();
            }

            CompareValidator validator = ((CompareValidator)(FormView1.FindControl("CompareEndTodayValidator")));

            validator.ValueToCompare = DateTime.Now.ToShortDateString();

            SiteMaster master = Page.Master as SiteMaster;

            master.UpdateTotalCounters();
        }