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

            // get the ID number of the print selection type
            int printType = Convert.ToInt32(Request.QueryString["printType"]);

            // set Selection label to product name //
            string selectionName = c.getDdlProductName(printType);

            lblPaperType.Text = selectionName;

            // set Quantity label to amount ordered //
            lblQty.Text = Request.QueryString["qty"];

            // set Order Total to calculated price //
            decimal pricePage;

            pricePage            = c.getDdlProductCost(printType);
            lblPricePerPage.Text = pricePage.ToString();

            // calculate order total //
            decimal sumTotal;
            int     paperQty = Convert.ToInt32(lblQty.Text);

            sumTotal           = pricePage * paperQty;
            lblOrderTotal.Text = sumTotal.ToString();


            // set Description label to customer text //
            lblDesc.Text = Request.QueryString["desc"];
        } /* end Page_Load() */
Beispiel #2
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() */