Esempio n. 1
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            if (Page is IDataGridDinamico)
            {
                nomeScript = Request.ServerVariables["SCRIPT_NAME"];
                if (Request.QueryString["clear"] != null)
                {
                    WebCad.ParametriRicerca parametri = (WebCad.ParametriRicerca)Session["parametri"];
                    parametri.eqIds      = string.Empty;
                    parametri.rmIds      = string.Empty;
                    parametri.stdEqIds   = string.Empty;
                    Session["parametri"] = parametri;
                    this.Visible         = false;
                }
                else
                {
                    if (Session["parametri"] != null)
                    {
                        setTemplate(((WebCad.ParametriRicerca)Session["parametri"]).tipoDataSet);
                        bottomFrame pg = (bottomFrame)Page;

                        dataSet1 = pg.Popola((WebCad.ParametriRicerca)Session["parametri"]);
                        SetDataSet(dataSet1, ((WebCad.ParametriRicerca)Session["parametri"]).tipoDataSet);
                        this.Visible = true;
                    }
                    else
                    {
                        this.Visible = false;
                    }
                }
            }
            else
            {
                throw new ApplicationException("FEDERICO DISSE: Chi usa il datagrid dinamico deve implementare IDataGridDinamico");
            }
        }
Esempio n. 2
0
        private void SetParametri(string tipo, int td)
        {
            ParametriRicerca parametri = new ParametriRicerca();

            parametri.tipoDataSet = td;
            parametri.tipo        = tipo;
            //parametri.blId= Convert.ToInt32(WebUserControlTreeView1.getSelectedEdificio());
            //parametri.flId= Convert.ToInt32(WebUserControlTreeView1.getSelectedPiano());

            parametri.blId    = Convert.ToInt32(idEdif.Text);
            parametri.flId    = Convert.ToInt32(idPian.Text);
            parametri.fileDwg = hiddenPlanimetria.Value;

            SetBlFl(Convert.ToInt32(idEdif.Text), Convert.ToInt32(idPian.Text));

            LoadListStanze();
            string stringaRm = "";

            foreach (ListItem rm in ListBoxStanze.Items)
            {
                if (stringaRm == "")
                {
                    stringaRm += rm.Value;
                }
                else
                {
                    stringaRm += "," + rm.Value;
                }
            }
            parametri.rmIds = stringaRm;


            if (CategorieDropDownList.getTesto() != "")
            {
                parametri.catId = Convert.ToInt32(CategorieDropDownList.getTesto());
            }
            else
            {
                parametri.catId = 0;
            }
            if (repartiDropDownList.getTesto() != "")
            {
                parametri.repartoId = Convert.ToInt32(repartiDropDownList.getTesto());
            }
            else
            {
                parametri.repartoId = 0;
            }
            if (destUsoDropDownList.getTesto() != "")
            {
                parametri.destUsoId = Convert.ToInt32(destUsoDropDownList.getTesto());
            }
            else
            {
                parametri.destUsoId = 0;
            }

            LoadListEq();
            string stringaEq = "";

            foreach (ListItem eq in listBoxEQ.Items)
            {
                if (stringaEq == "")
                {
                    stringaEq += eq.Value;
                }
                else
                {
                    stringaEq += "," + eq.Value;
                }
            }
            parametri.eqIds = stringaEq;

            LoadListEqStd();
            string stringaEqStd = "";

            foreach (ListItem eq in ListBoxEQSTD.Items)
            {
                if (stringaEqStd == "")
                {
                    stringaEqStd += eq.Value;
                }
                else
                {
                    stringaEqStd += "," + eq.Value;
                }
            }
            parametri.stdEqIds   = stringaEqStd;
            Session["parametri"] = parametri;
        }