Example #1
0
 protected void btnAddTemplateAtt_Click(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(this.txtModelNameAtt.Text))
     {
         try
         {
             String mTextBindingName = MTextUtils.GetNameFromQualifiedName(this.txtModelNameAtt.Text);
             this.ddlMTextModelAtt.Items.Add(new ListItem(mTextBindingName, this.txtModelNameAtt.Text));
         }
         catch (Exception ex)
         {
             ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert('Nome del data bind non valido.');", true);
         }
     }
 }
Example #2
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            Modello1.Enabled  = false;
            Modello2.Enabled  = false;
            Allegato.Enabled  = false;
            ModelloSU.Enabled = false;

            // Se i modelli M/Text sono attivi e non si è in postback vengono rese visibili le righe con
            // le drop down per la scelta del tipo del modello e vengono popolate le liste dei modelli
            if (MTextUtils.IsActiveMTextIntegration() && !IsPostBack)
            {
                this.trGenerateMTextSourceModel.Visible = true;
                this.trModelChoiceMainDocument.Visible  = true;
                //this.trModelChoiceAtt.Visible = true;
                try
                {
                    List <ModelInfo> models = ModelProviderFactory <MTextModelProvider> .GetInstance().GetModels();

                    foreach (ModelInfo model in models)
                    {
                        this.ddlMTextModelMain.Items.Add(new ListItem(model.Name, model.Path));
                        this.ddlMTextModelAtt.Items.Add(new ListItem(model.Name, model.Path));
                    }
                }
                catch (Exception ex)
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Errore durante il reperimento dei modelli M/Text');", true);
                }
            }


            this.linkTag.NavigateUrl = "metaTagsCampiWORD_PITRE.doc";
            string valoreChiave;

            valoreChiave = utils.InitConfigurationKeys.GetValue("0", "FE_EXPORT_DA_MODELLO");
            if (!string.IsNullOrEmpty(valoreChiave) && valoreChiave.Equals("1"))
            {
                Tr2.Visible = true;
            }
            else
            {
                Tr2.Visible = false;
            }


            DocsPaWR.Templates template = (SAAdminTool.DocsPaWR.Templates)Session["templateSelPerModelli"];

            // Se l'estensione del modello 1 è MTXT viene attivata la visualizzazione M/Text
            // altrimenti quella normale
            if (!String.IsNullOrEmpty(template.PATH_MODELLO_1_EXT) && template.PATH_MODELLO_1_EXT == "MTXT" && !IsPostBack)
            {
                this.ddlModelTypeMain.SelectedIndex = 1;
                this.CheckBox1.Checked        = true;
                this.pnlModelTypeMain.Visible = true;
                this.uploadPathUno.Visible    = false;

                // Toppa temporanea in attesa di prox versione M/Text
                int index = this.ddlMTextModelMain.Items.IndexOf(new ListItem(MTextUtils.GetNameFromQualifiedName(template.PATH_MODELLO_1), template.PATH_MODELLO_1));
                if (index == -1)
                {
                    this.ddlMTextModelMain.Items.Add(new ListItem(MTextUtils.GetNameFromQualifiedName(template.PATH_MODELLO_1), template.PATH_MODELLO_1));
                    index = this.ddlMTextModelMain.Items.Count - 1;
                }
                // Fine toppa temporanea

                this.ddlMTextModelMain.SelectedIndex = index;
            }
            else
            if (template.PATH_MODELLO_1 != "")
            {
                CheckBox1.Checked = true;
                Modello1.Enabled  = true;
            }

            // Se l'estensione del modello 2 è MTXT viene attivata la visualizzazione M/Text
            // altrimenti quella normale
            if (!String.IsNullOrEmpty(template.PATH_MODELLO_2_EXT) && template.PATH_MODELLO_2_EXT == "MTXT" && !IsPostBack)
            {
                this.ddlModelTypeAtt.SelectedIndex = 1;
                this.CheckBox2.Checked             = true;
                this.pnlModelTypeAtt.Visible       = true;
                this.uploadPathDue.Visible         = false;

                // Toppa temporanea in attesa di prox versione M/Text
                int index = this.ddlMTextModelAtt.Items.IndexOf(new ListItem(MTextUtils.GetNameFromQualifiedName(template.PATH_MODELLO_2), template.PATH_MODELLO_2));
                if (index == -1)
                {
                    this.ddlMTextModelAtt.Items.Add(new ListItem(MTextUtils.GetNameFromQualifiedName(template.PATH_MODELLO_2), template.PATH_MODELLO_2));
                    index = this.ddlMTextModelAtt.Items.Count - 1;
                }
                // Fine toppa temporanea

                this.ddlMTextModelAtt.SelectedIndex = index;
            }
            else
            if (template.PATH_MODELLO_2 != "")
            {
                CheckBox2.Checked = true;
                Modello2.Enabled  = true;
            }

            if (template.PATH_MODELLO_STAMPA_UNIONE != "")
            {
                CheckBox4.Checked = true;
                ModelloSU.Enabled = true;
            }
            if (template.PATH_ALLEGATO_1 != "")
            {
                CheckBox3.Checked = true;
                Allegato.Enabled  = true;
            }

            if (!string.IsNullOrEmpty(template.PATH_MODELLO_EXCEL))
            {
                CheckBox5.Checked  = true;
                ModelloExc.Enabled = true;
            }

            if (System.Configuration.ConfigurationManager.AppSettings["MODELLO_DOCUMENTO"] != null && System.Configuration.ConfigurationManager.AppSettings["MODELLO_DOCUMENTO"] == "1")
            {
                uploadPathDue.Visible = false;
                CheckBox2.Visible     = false;
                ImageButton2.Visible  = false;
            }

            if (SHOW_STAMPA_UNIONE)
            {
                this.PanelSU.Visible = true;
            }
            else
            {
                this.PanelSU.Visible = false;
            }
        }