Ejemplo n.º 1
0
        protected void SearchProject()
        {
            // Lista dei fascicoli restituiti dalla ricerca
            Fascicolo[] projectList;

            projectList = FascicoliManager.GetFascicoloDaCodiceNoSecurity(this.txtCodFascicolo.Text, this.IdAmministrazione.ToString(), this.ddl_titolari.SelectedValue, true);

            if (projectList == null || projectList.Length == 0)
            {
                this.FascicoliSelezionati = null;
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "no_project", "alert('Nessun fascicolo trovato con questo codice');", true);
            }
            else
            {
                this.FascicoliSelezionati = null;
                if (projectList.Length == 1)
                {
                    txtCodFascicolo.Text  = projectList[0].codice;
                    txtDescFascicolo.Text = projectList[0].descrizione;
                    this.id_Fasc.Value    = projectList[0].systemID;
                    if (!string.IsNullOrEmpty(projectList[0].idTitolario))
                    {
                        ListItem temp = new ListItem();
                        temp.Value = projectList[0].idTitolario;
                        if (this.ddl_titolari.Items.FindByValue(temp.Value) != null)
                        {
                            this.ddl_titolari.SelectedValue = projectList[0].idTitolario;
                        }
                    }
                    this.chk_tipo_class.Enabled       = true;
                    this.rbl_1.Selected               = false;
                    this.rbl_2.Selected               = false;
                    this.rbl_3.Selected               = false;
                    this.chk_includiSottoNodi.Enabled = true;
                }
                else
                {
                    this.FascicoliSelezionati = new Fascicolo[projectList.Length];
                    this.FascicoliSelezionati = projectList;

                    ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "no_project", "OpenSceltaFascicoli();", true);
                    txtCodFascicolo.Text              = string.Empty;
                    txtDescFascicolo.Text             = string.Empty;
                    this.id_Fasc.Value                = string.Empty;
                    this.chk_tipo_class.Enabled       = false;
                    this.rbl_1.Selected               = false;
                    this.rbl_2.Selected               = false;
                    this.rbl_3.Selected               = false;
                    this.chk_includiSottoNodi.Enabled = false;
                }
            }
        }