Ejemplo n.º 1
0
        private void ShowFrame2(int NumDirectory)
        {
            string dir = "";

            for (int i = 0; i < NumDirectory; i++)
            {
                dir += "../";
            }
            System.Text.StringBuilder _StrBld = new System.Text.StringBuilder();
            _StrBld.Append("<script language=\"javascript\">\n");
            _StrBld.Append("function ShowFrame2(sender,e){\n");
            _StrBld.Append("var ctrl = document.getElementById(\"PopupApp\").style;\n");
            _StrBld.Append("x = e.clientX;\n");
            _StrBld.Append("y = e.clientY;\n");
            _StrBld.Append("ctrl.left = 50;\n");
            _StrBld.Append("ctrl.top = y+30;\n");
            _StrBld.Append("if (ctrl.display =='none') ctrl.display='block';\n");

            _StrBld.Append("ctrl2= document.getElementById(\"" + S_txtcodStdapparecchiatura.ClientID + "\").value;\n");
            //Se l'user control esiste ricerco nei campi i valori nella query string
            if (NameUserControlRicercaModulo != "")
            {
                RicercaModulo Ric = (RicercaModulo)this.Page.FindControl(NameUserControlRicercaModulo);
                if (Ric != null)
                {
                    //Recupero BLID e IL Campo Campus
                    _StrBld.Append("var ctrl3=\"&blid=\" + document.getElementById(\"" + Ric.TxtCodice.ClientID + "\").value;\n");
                    _StrBld.Append("var ctrl4=\"&campus=\" + document.getElementById(\"" + Ric.TxtRicerca.ClientID + "\").value;\n");
                    _StrBld.Append("ctrl2+= ctrl3 + ctrl4;\n");
                }
            }
            //Verivico se è presente la combo servizio e presente e la aggiungo come parametro
            if (NameComboServizio != "")
            {
                DropDownList cbs = (DropDownList)this.Page.FindControl(NameComboServizio);
                if (cbs != null)
                {
                    _StrBld.Append("var val1=\"&servizioid=\";\n");
                    _StrBld.Append("var ctrl5= document.getElementById(\"" + cbs.ClientID + "\");\n");
                    _StrBld.Append("if (ctrl5!=\"undefined\" && ctrl5!=null){\n");
                    _StrBld.Append("    if (ctrl5.selectedIndex!=-1) val1+=ctrl5.options[ctrl5.selectedIndex].value;\n");
                    _StrBld.Append("}\n");
                    _StrBld.Append("ctrl2+=val1;\n");
                }
            }

            _StrBld.Append("var idUsercontrol=\"&idUsercontrol=\" + \"" + this.ClientID + "\";\n");
            _StrBld.Append("document.getElementById(\"docapp\").src=\"" + dir + "CommonPage/ListaStdApparecchiature.aspx?codapp=\" + ctrl2 + idUsercontrol;\n");
            //			_StrBld.Append("alert(document.getElementById(\"docapp\").src);\n");
            _StrBld.Append("}\n");
            _StrBld.Append("</script>\n");
            this.Page.RegisterStartupScript("startsc", _StrBld.ToString());
        }
Ejemplo n.º 2
0
        private void ShowFramest(int NumDirectory)
        {
            string dir = "";

            for (int i = 0; i < NumDirectory; i++)
            {
                dir += "../";
            }
            System.Text.StringBuilder _StrBld = new System.Text.StringBuilder();
            _StrBld.Append("<script language=\"javascript\">\n");
            _StrBld.Append("function ShowFramest(sender,e){\n");
            _StrBld.Append("var ctrl = document.getElementById(\"PopupAppst\").style;\n");
            _StrBld.Append("x = e.clientX;\n");
            _StrBld.Append("y = e.clientY;\n");
            _StrBld.Append("ctrl.left = 50;\n");
            _StrBld.Append("ctrl.top = y+30;\n");
            _StrBld.Append("if (ctrl.display =='none') ctrl.display='block';\n");

            _StrBld.Append("ctrl2= document.getElementById(\"" + s_txtDescStanza.ClientID + "\").value;\n");
            //Se l'user control esiste ricerco nei campi i valori nella query string
            if (NameUserControlRicercaModulo != "")
            {
                RicercaModulo Ric = (RicercaModulo)this.Page.FindControl(NameUserControlRicercaModulo);
                if (Ric != null)
                {
                    //Recupero BLID e IL Campo Campus
                    _StrBld.Append("var ctrl3=\"&blid=\" + document.getElementById(\"" + Ric.TxtCodice.ClientID + "\").value;\n");
                    _StrBld.Append("var ctrl4=\"&campus=\" + document.getElementById(\"" + Ric.TxtRicerca.ClientID + "\").value;\n");
                    _StrBld.Append("ctrl2+= ctrl3 + ctrl4;\n");
                }
            }

            if (NameLblId != "")
            {
                S_Label lblid = (S_Label)this.Page.FindControl(NameLblId);
                if (lblid != null)
                {
                    _StrBld.Append("var ctrl3=\"&blid=\" +  document.getElementById(\"" + lblid.ClientID + "\").innerText;\n");
                    _StrBld.Append("var ctrl4=\"&campus=\" + document.getElementById(\"" + lblid.ClientID + "\").innerText;\n");
                    _StrBld.Append("ctrl2+= ctrl3 + ctrl4;\n");
                }
            }
            //Verivico se è presente la combo Piano e presente e la aggiungo come parametro
            if (NameComboPiano != "")
            {
                DropDownList cbp = (DropDownList)this.Page.FindControl(NameComboPiano);
                if (cbp != null)
                {
                    _StrBld.Append("var val3=\"&piano=\";\n");
                    _StrBld.Append("var ctrl7= document.getElementById(\"" + cbp.ClientID + "\");\n");
                    _StrBld.Append("if (ctrl7!=\"undefined\" && ctrl7!=null){\n");
                    _StrBld.Append("    if (ctrl7.selectedIndex!=-1) val3+=ctrl7.options[ctrl7.selectedIndex].value;\n");
                    _StrBld.Append("}\n");
                    _StrBld.Append("ctrl2+=val3;\n");
                }
            }


            _StrBld.Append("var idUsercontrol1=\"&idUsercontrol1=\" + \"" + this.ClientID + "\";\n");
            _StrBld.Append("document.getElementById(\"docstanza\").src=\"" + dir + "CommonPage/ListaStanze.aspx?codstanza=\" + ctrl2 + idUsercontrol1;\n");
            //			_StrBld.Append("alert(document.getElementById(\"docstanza\").src);\n");
            _StrBld.Append("}\n");
            _StrBld.Append("</script>\n");
            this.Page.RegisterStartupScript("startst", _StrBld.ToString());
        }