Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserLoggedin"] != null && (bool)Session["UserLoggedin"] == true)
        {
            Panel p1 = (Panel)(Master.FindControl("PanelLogin"));
            p1.Visible = false;
            LinkButton bt1 = (LinkButton)(Master.FindControl("btnLogOut"));
            bt1.Visible = true;
            Label lblName = (Label)(Master.FindControl("lblLoginName"));
            if (Session["email"] != null)
            {
                lblName.Text = "Hello! " + Session["email"].ToString();
            }

            BookStore bs = new BookStore();

            cust       = bs.CustomerBillingAddress(Session["email"].ToString());
            cust.email = Session["email"].ToString();

            lblBillName.Text         = cust.firstName + " " + cust.lastName;
            lblBillAddress.Text      = cust.address;
            lblBillCityStateZip.Text = cust.city + " " + cust.state + " " + cust.zip;
            lblBillPhone.Text        = cust.phone;
        }
        else
        {
            LinkButton bt1 = (LinkButton)Master.FindControl("btnLogOut");
            bt1.Visible = false;
        }

        if (!IsPostBack)
        {
            lblShipName.Text         = lblBillName.Text;
            lblShipAddress.Text      = lblBillAddress.Text;
            lblShipCityStateZip.Text = lblBillCityStateZip.Text;
            lblShipPhone.Text        = lblBillPhone.Text;

            linkbtnEditShipAddress.Visible = false;
            Session["CustDetails"]         = cust;
        }


        panelUpdateBillingAddress.Visible = false;
        panelNewShippingAddress.Visible   = false;
    }