protected void Page_Load(object sender, EventArgs e)
        {
            // instantiate object for access to methods //
            clsCustomers c = new clsCustomers();

            // bool placeholder to check if user is registered //
            bool checkCC;

            if (Session["customerID"] == null)
            {
                // redirect if account hasn't been created // 
                Response.Redirect("~/Register.aspx");

            } /* end if{} */
            else
            {
                // grab the ID inside the session and pass it for verification //
                checkCC = c.checkCCInfoAdded(Convert.ToInt32(Session["customerID"]));

                if (checkCC)
                {
                    // if credit card info is registered enable upload button //
                    btnUpload.Visible = true;
                    lnkCCInfo.Visible = false;
                }
                else
                {
                    // disable upload button if credit is not registered
                    btnUpload.Visible = false;
                    lblCCInfo.Visible = true;
                    lnkCCInfo.Visible = true;
                }

            } /* end else{} */
        protected void Page_Load(object sender, EventArgs e)
        {
            // instantiate objects for method access //
            clsDataLayer c = new clsDataLayer();
            clsCustomers p = new clsCustomers();

            if (Session["CustomerID"] == null)
            {
                Response.Redirect("~/Customers/CustomerLogin.aspx");
            } /* end if() */

            bool creditCardAdded;

            creditCardAdded = p.checkCCInfoAdded(Convert.ToInt32(Session["CustomerID"]));

            if (!creditCardAdded)
            {
                lblAddCCInfo.Text = "Please click on Account Details below and enter a credit card";
            }

            if (Page.IsPostBack)
            {
                lblAddCCInfo.Visible = false;
            }
        } /* end Page_Load() */
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            clsCustomers c = new clsCustomers();

            // bool placeholder to check if user is registered //
            bool checkCC;

            if (Session["customerID"] == null)
            {
                // redirect if account hasn't been created //
                Response.Redirect("~/Register.aspx");
            } /* end if{} */
            else
            {
                // grab the ID inside the session and pass it for verification //
                checkCC = c.checkCCInfoAdded(Convert.ToInt32(Session["customerID"]));

                if (checkCC)
                {
                    // if credit card info is registered enable upload button //
                    btnUpload.Visible = true;
                    lnkCCInfo.Visible = false;
                }
                else
                {
                    // disable upload button if credit is not registered
                    btnUpload.Visible = false;
                    lblCCInfo.Visible = true;
                    lnkCCInfo.Visible = true;
                }
            } /* end else{} */



            if (Page.IsPostBack)
            {
                // instantiate object for access to methods //
                //clsCustomers c = new clsCustomers();

                // Update cost of item on selection //
                int ddlPid = Convert.ToInt32(ddlProductsList.SelectedValue);

                //lblPoduct.Text = item;
                lblItemCost.Text = c.getDdlProductCost(ddlPid).ToString();

                //  //
                string urlString = c.getImageUrl(ddlPid);

                string imagePath = urlString;

                Image1.ImageUrl = imagePath;
            } /* end (Page.IsPostBack) */
        }     /* end Page_Load() */