Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string html = "";

            try
            {
                //Check for URL Parameters-- that determines if this page is being called to view an existing bom
                string p     = Request.QueryString["p"];
                string pR    = Request.QueryString["pR"];
                string bR    = Request.QueryString["bR"];
                string desNm = Request.QueryString["h"];
                if (p != null && pR != null && bR != null)
                {
                    CustomCode x = new CustomCode();
                    html = x.DownloadHTMLforBOM(p, pR, bR);
                    divResult.Controls.Add(new LiteralControl(html));
                    txtProduct.Text       = p.ToUpper();
                    txtProductRev.Text    = pR.ToUpper();
                    txtBOMRev.Text        = bR.ToUpper();
                    txtProductStatus.Text = x.GetProductStatus(p, pR, bR).ToUpper();
                    if (txtProductStatus.Text.ToUpper() == RELEASEKEY.ToUpper())
                    {
                        btnUpload.Enabled = false;
                        btnUpload.Style.Add("display", "none");
                        divBrowse.Style.Add("display", "none");
                    }

                    this.Title = txtProduct.Text + " Rev " + txtProductRev.Text + " (BOM Rev " + txtBOMRev.Text.PadLeft(2, '0') + ")";
                }
                else if (desNm != null)
                {
                    CustomCode x = new CustomCode();
                    html = x.DownloadHTMLforBOMHistory(desNm);
                    divResult.Controls.Add(new LiteralControl(html));
                    txtProduct.Text       = desNm.ToUpper();
                    txtProductRev.Text    = "";
                    txtBOMRev.Text        = "";
                    txtProductStatus.Text = "";
                    this.Title            = desNm + " History";
                }
                else
                {
                    this.Title = "BOM View and Upload";
                }
            } catch (Exception ex) {
                divResult.Controls.Add(new LiteralControl(DynControls.renderLiteralControlErrorString(ex, html)));
            }
        }