Пример #1
0
        public static void verificaCampiPersonalizzati(Page page, SAAdminTool.DocsPaWR.Fascicolo fascicolo, Microsoft.Web.UI.WebControls.TreeView Folders, bool editMode)
        {
            System.Web.UI.WebControls.DropDownList ddl_tipoFasc            = (System.Web.UI.WebControls.DropDownList)page.FindControl("ddl_tipologiaFasc");
            System.Web.UI.WebControls.ImageButton  btn_CampiPersonalizzati = (System.Web.UI.WebControls.ImageButton)page.FindControl("img_btnDettagliProf");
            System.Web.UI.WebControls.TextBox      txt_fascdesc            = (System.Web.UI.WebControls.TextBox)page.FindControl("txt_fascdesc");

            //Fascicolo senza tipologia (Apro la lista documenti in fascicolo)
            if (fascicolo != null && (fascicolo.template == null || fascicolo.template.SYSTEM_ID == 0) && string.IsNullOrEmpty(ddl_tipoFasc.SelectedValue))
            {
                ddl_tipoFasc.Enabled            = editMode;
                btn_CampiPersonalizzati.Enabled = editMode;

                page.Session["ListaDocs-CampiProf"] = "ListaDocs";
                string urlFormattata = System.Text.RegularExpressions.Regex.Replace(txt_fascdesc.Text, @"[\000\010\011\012\015\032\042\047\134\140]", "\\$0");
                string newUrl        = "tabPulsantiDoc.aspx?idFolder=" + getSelectedNodeFolder(page, Folders).ID.ToString() + "&AclRevocata=" + GetControlAclFascicolo(page).AclRevocata.ToString();// + "&codFasc=" + urlFormattata;
                page.ClientScript.RegisterStartupScript(page.GetType(), "apriPopUp", "top.principale.iFrame_dx.document.location='" + newUrl + "';", true);
            }

            //Fascicolo con tipologia (Apro i campi profilati del fascicolo)
            if (System.Configuration.ConfigurationManager.AppSettings["ProfilazioneDinamicaFasc"] != null && System.Configuration.ConfigurationManager.AppSettings["ProfilazioneDinamicaFasc"] == "1" && fascicolo.tipo.Equals("P"))
            {
                //Fasciolo con template salvato
                if (fascicolo != null && fascicolo.template != null && fascicolo.template.SYSTEM_ID != 0)
                {
                    ddl_tipoFasc.Enabled            = false;
                    btn_CampiPersonalizzati.Enabled = true;

                    System.Web.UI.WebControls.ListItem item = new System.Web.UI.WebControls.ListItem(fascicolo.template.DESCRIZIONE, fascicolo.template.SYSTEM_ID.ToString());
                    if (!ddl_tipoFasc.Items.Contains(item))
                    {
                        ddl_tipoFasc.Items.Add(item);
                        ddl_tipoFasc.SelectedValue = item.Value;
                    }

                    page.Session["Template"]            = fascicolo.template;
                    page.Session["ListaDocs-CampiProf"] = "CampiProf";
                    string newUrl = "tabPulsantiDoc.aspx?tipoFascicolo=" + fascicolo.tipo + "&codTipologiaFasc=" + ddl_tipoFasc.SelectedValue.ToString() + "&editMode=" + editMode.ToString() + "&AclRevocata=" + GetControlAclFascicolo(page).AclRevocata.ToString();// + "&codFasc=" + txt_fascdesc.Text;
                    page.ClientScript.RegisterStartupScript(page.GetType(), "apriPopUp", "top.principale.iFrame_dx.document.location='" + newUrl + "';", true);
                }

                //Fasciolo con template appena selezionato
                if (fascicolo != null && fascicolo.template != null && fascicolo.template.SYSTEM_ID == 0 && !string.IsNullOrEmpty(ddl_tipoFasc.SelectedValue))
                {
                    ddl_tipoFasc.Enabled            = true;
                    btn_CampiPersonalizzati.Enabled = true;

                    page.Session["ListaDocs-CampiProf"] = "CampiProf";
                    string newUrl = "tabPulsantiDoc.aspx?tipoFascicolo=" + fascicolo.tipo + "&codTipologiaFasc=" + ddl_tipoFasc.SelectedValue.ToString() + "&editMode=" + editMode.ToString() + "&AclRevocata=" + GetControlAclFascicolo(page).AclRevocata.ToString();// + "&codFasc=" + txt_fascdesc.Text;
                    page.ClientScript.RegisterStartupScript(page.GetType(), "apriPopUp", "top.principale.iFrame_dx.document.location='" + newUrl + "';", true);
                }
            }
            else
            {
                if (fascicolo != null)
                {
                    string newUrl = "tabPulsantiDoc.aspx?tipoFascicolo=" + fascicolo.tipo + "&editMode=" + editMode.ToString() + "&AclRevocata=" + GetControlAclFascicolo(page).AclRevocata.ToString();
                    page.ClientScript.RegisterStartupScript(page.GetType(), "apriPopUp", "top.principale.iFrame_dx.document.location='" + newUrl + "';", true);
                }
            }
        }
Пример #2
0
 /// <summary>
 ///  Reperisce il codice del fascicolo
 /// </summary>
 private void getFascDocumenti()
 {
     this._folder = FascicoliManager.getFolderSelezionato();
     //this._fascicolo = FascicoliManager.getFascicoloSelezionato(null);
     SAAdminTool.DocsPaWR.Fascicolo fascicolo = null;
     fascicolo    = FascicoliManager.getFascicoloSelezionato(null);
     this.codFasc = fascicolo.codice;
 }