Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Add controls to pnlInput; attributes for these controls are taken from the database, so that this can
            //be a truly generic solution
            if (m_useDB)
            {
                DynControls.GenerateControlsFromDatabase(DBK.AppKeys.CUSTOM_PN, pnlInput);
                pnlInput.Controls.Add(DynControls.html_button("btnSubmit", "SUBMIT", "inputButton", true, form: "frmCustomPN"));
            }
            else
            {
                pnlInput.Controls.Add(DynControls.html_label("lbl_1", "Enter Board Name:", "fldlabel", "txt_1"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_txtbox("txt_1", "txtinput"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblError_1", "Error Message goes here; so on for other elements.", "errorlabel", "", true));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblHelp_1", "Help link will go here.", "helplabel"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_linebreak());

                pnlInput.Controls.Add(DynControls.html_label("lbl_2", "Enter Family Number:", "fldlabel", "txt_2"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_txtbox("txt_2", "txtinput"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblError_2", "Error Message goes here; so on for other elements.", "errorlabel", "", false));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblHelp_2", "Help link will go here.", "helplabel"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_linebreak());

                pnlInput.Controls.Add(DynControls.html_label("lbl_3", "Enter Release Revision:", "fldlabel", "txt_3"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_txtbox("txt_3", "txtinput"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblError_3", "Error Message goes here; so on for other elements.", "errorlabel", "", false));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblHelp_3", "Help link will go here.", "helplabel"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_linebreak());

                pnlInput.Controls.Add(DynControls.html_label("lbl_4", "Do you need a PCB Number?", "fldlabel", "cbo_4"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_combobox_YESNO("cbo_4", "cboInput"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblError_4", "Error Message goes here; so on for other elements.", "errorlabel", "", false));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblHelp_4", "Help link will go here.", "helplabel"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_linebreak());

                pnlInput.Controls.Add(DynControls.html_label("lbl_5", "Enter Number of SHIELD Part Numbers", "fldlabel", "txt_5"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_txtbox("txt_5", "txtinput", "0"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblError_5", "Error Message goes here; so on for other elements.", "errorlabel", "", false));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblHelp_5", "Help link will go here.", "helplabel"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_linebreak());

                pnlInput.Controls.Add(DynControls.html_label("lbl_6", "Enter Number of SROM/NVRAM Part Numbers", "fldlabel", "txt_6"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_txtbox("txt_6", "txtinput", "0"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblError_6", "Error Message goes here; so on for other elements.", "errorlabel", "", false));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblHelp_6", "Help link will go here.", "helplabel"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_linebreak());

                pnlInput.Controls.Add(DynControls.html_label("lbl_7", "Enter Number of BT FW Part Numbers", "fldlabel", "txt_7"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_txtbox("txt_7", "txtinput", "0"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblError_7", "Error Message goes here; so on for other elements.", "errorlabel", "", false));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblHelp_7", "Help link will go here.", "helplabel"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_linebreak());

                pnlInput.Controls.Add(DynControls.html_label("lbl_8", "Enter Number of WORK INSTRUCTION Part Numbers", "fldlabel", "txt_8"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_txtbox("txt_8", "txtinput", "0"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblError_8", "Error Message goes here; so on for other elements.", "errorlabel", "", false));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblHelp_8", "Help link will go here.", "helplabel"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_linebreak());

                pnlInput.Controls.Add(DynControls.html_label("lbl_9", "Is this a Bring-Up (BU) Board?", "fldlabel", "cbo_9"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_combobox_YESNO("cbo_9", "cboInput", true));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblError_9", "Error Message goes here; so on for other elements.", "errorlabel", "", false));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblHelp_9", "Help link will go here.", "helplabel"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_linebreak());

                pnlInput.Controls.Add(DynControls.html_label("lbl_10", "Do you need a Part Number for a SOCKET (SKT) BU Board?", "fldlabel", "cbo_10"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_combobox_YESNO("cbo_10", "cboInput", true));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblError_10", "Error Message goes here; so on for other elements.", "errorlabel", "", false));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblHelp_10", "Help link will go here.", "helplabel"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_linebreak());

                pnlInput.Controls.Add(DynControls.html_label("lbl_11", "Do you need a Part Number for a SOLDER (SOL) BU Board?", "fldlabel", "cbo_11"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_combobox_YESNO("cbo_11", "cboInput", true));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblError_11", "Error Message goes here; so on for other elements.", "errorlabel", "", false));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_label("lblHelp_11", "Help link will go here.", "helplabel"));
                pnlInput.Controls.Add(DynControls.html_linebreak());
                pnlInput.Controls.Add(DynControls.html_linebreak());
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //check for any url encoded parameters
            string foundIDData = "";

            if (Request.QueryString.HasKeys())
            {
                try
                {
                    CustomCode x        = new CustomCode();
                    string     targetID = Request.QueryString["ID"];
                    //The following is a bogus division that will go at the end of the displayed page so that the client can't obtain the ID
                    string htmlForID = "<div " +
                                       DynControls.encodeProperty("id", "x_" + targetID) +
                                       DynControls.encodeProperty("class", "getID") + " ></div>";
                    //Get the PN associated with the targetID
                    clsDB               myDB = new clsDB();
                    SqlCommand          cmd  = new SqlCommand();
                    List <SqlParameter> ps   = new List <SqlParameter>();
                    ps.Add(new SqlParameter("@pnID", Int64.Parse(targetID)));
                    string pageHeader = "";
                    using (myDB.OpenConnection())
                    {
                        using (SqlDataReader dR = (SqlDataReader)myDB.ExecuteSP(DBK.SP.spOTSGETPNINFO, ps, clsDB.SPExMode.READER, ref cmd))
                        {
                            if (dR != null && dR.HasRows)
                            {
                                dR.Read();
                                pageHeader = myDB.Fld2Str(dR[DBK.strPARTNUMBER]);
                            }
                        }
                    }

                    if (Request.QueryString["INV"] != null)
                    {
                        pageHeader  = DynControls.html_header_string(pageHeader + " Inventory", 1);
                        foundIDData = pageHeader + x.InvForPN(targetID) + htmlForID;
                    }
                    else if (Request.QueryString["INVH"] != null)
                    {
                        pageHeader  = DynControls.html_header_string(pageHeader + " Inventory History", 1);
                        foundIDData = pageHeader + x.MakePartNumberInventoryHistoryTable(Int64.Parse(targetID)) + htmlForID;
                    }
                    else
                    {
                        foundIDData = x.getHTMLForPartNumberID(targetID);
                    }
                    otsdivs.Controls.Add(new LiteralControl(foundIDData));
                    foreach (Control c in divMenuButtons.Controls)
                    {
                        divMenuButtons.Controls.Remove(c);
                    }
                    return;
                } catch (Exception ex)
                {
                    string x = ex.Message + ex.StackTrace;
                }
            }
            //Create three panels and add them to the existing div
            Panel divOTSNew = new Panel();

            divOTSNew.ID = "divOTSNew";
            divOTSNew.Style.Add(HtmlTextWriterStyle.Display, "none");
            otsdivs.Controls.Add(divOTSNew);

            //There are two panels in divOTSNew: divOTSNewIn and divOTSNewOut

            Panel divOTSNewIn = new Panel();

            divOTSNewIn.ID = "divOTSNewIn";
            //Get the input controls from the database for divOTSNewIn...
            DynControls.GenerateControlsFromDatabase(DBK.AppKeys.GET_NEWOTSPN, divOTSNewIn);
            //Add a Submit button
            divOTSNewIn.Controls.Add(DynControls.html_button("btnOTSNewIn", "SUBMIT", "inputButton",
                                                             true, AAAK.DISPLAYTYPES.BLOCK, "Create an OTS Part Number", "frmNewOTS"));
            //...and add a div for the ajax output
            Panel divOTSNewOut = new Panel();

            divOTSNewOut.ID = "divOTSNewOut";
            divOTSNewOut.Controls.Add(new LiteralControl("<p>Enter the information on the left, then press Submit to get your new OTS Part Number.</p>"));
            //Add these two sub panels
            divOTSNew.Controls.Add(divOTSNewIn);
            divOTSNew.Controls.Add(divOTSNewOut);
            //***** End divOTSNew

            //***** Start divOTSFind
            Panel divOTSFind = new Panel();

            divOTSFind.ID = "divOTSFind";
            divOTSFind.Style.Add(HtmlTextWriterStyle.Display, "none");
            //divOTSFind.Style.Add(HtmlTextWriterStyle.OverflowX, "auto");
            otsdivs.Controls.Add(divOTSFind);
            //Now: The html in this div is simple, but as the user make selections, the AJAX calls increase the
            //complexity of the children's html.
            //This div has 3 divs.
            ///divOTSFind Child Div 1:
            Panel divSearch = new Panel();

            divSearch.ID = "divSearch";

            DynControls.GenerateControlsFromDatabase(DBK.AppKeys.SEARCH_OTS, divSearch, null, "", -1, true);
            //Create the search button
            string btnSearchHtmlString = DynControls.html_button_string("btnLook", "SEARCH", "searchButton",
                                                                        true, AAAK.DISPLAYTYPES.BLOCK, form: "frmSearchOTS");

            divSearch.Controls.Add(new LiteralControl(btnSearchHtmlString));

            ///divOTSFind Child Div 2:
            ///The message div
            Panel divSearchMsg = new Panel();

            divSearchMsg.Style.Add(HtmlTextWriterStyle.Display, "block");
            divSearchMsg.ID = "divMessage";
            divSearchMsg.Controls.Add(new LiteralControl("<p " + DynControls.encodeProperty("id", "searchmsg") + ">" +
                                                         "Enter search criteria above to find Part Number Information.</p>"));
            ///divOTSFind Child Div 3:
            ///
            Panel divLook = new Panel();

            divLook.Style.Add(HtmlTextWriterStyle.Display, "block");
            divLook.Style.Add(HtmlTextWriterStyle.OverflowX, "auto");
            divLook.ID = "divLook";
            /// divLook's html will be determine when user presses SEARCH

            ///Add the three divs to divOTSFind
            divOTSFind.Controls.Add(divSearch);
            divOTSFind.Controls.Add(new LiteralControl("<div></div>"));
            divOTSFind.Controls.Add(divSearchMsg);
            divOTSFind.Controls.Add(divLook);

            Panel divOTSAdmin = new Panel();

            divOTSAdmin.ID = "divOTSAdmin";
            divOTSAdmin.Controls.Add(new LiteralControl("<p>Admin</p>"));
            divOTSAdmin.Style.Add(HtmlTextWriterStyle.Display, "none");
            otsdivs.Controls.Add(divOTSAdmin);
        }