Ejemplo n.º 1
0
        /// <summary>
        /// Page Load
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            this.txt_indexSel = Request.QueryString["index"];
            schedaDocumento   = (DocsPAWA.DocsPaWR.SchedaDocumento)DocumentManager.getDocumentoSelezionato(this);

            Utils.SetFocus(TextNote.ID, this);

            this.descDoc.Text = schedaDocumento.oggetto.descrizione;

            if (this.txt_indexSel != null)
            {
                indexSel = Int32.Parse(txt_indexSel);
                if (indexSel >= 0)
                {
                    //Reperisce la versione selezionata
                    if (schedaDocumento != null)
                    {
                        docSel = schedaDocumento.documenti[indexSel];

                        if (!this.Page.IsPostBack)
                        {
                            if (docSel != null)
                            {
                                this.TextCodice.Text = docSel.version;
                                this.TextNote.Text   = docSel.descrizione;
                                this.Label.Text      = "Modifica versione";
                            }
                            else
                            {
                                this.btn_ok.Enabled = false;
                            }
                        }
                    }
                }
            }
            else
            {
                this.LabelCodice.Visible = false;
                this.TextCodice.Visible  = false;
            }

            //variabile utilizzata per impedire il ripetuto click del bottone ok
            if (!IsPostBack)
            {
                DocsPAWA.DocsPaWR.InfoUtente info = new DocsPAWA.DocsPaWR.InfoUtente();
                info = UserManager.getInfoUtente(this.Page);


                string valoreChiave = utils.InitConfigurationKeys.GetValue(info.idAmministrazione, "FE_MAX_LENGTH_NOTE");
                if (!string.IsNullOrEmpty(valoreChiave))
                {
                    Session.Remove("gestioneVersione");
                }
                TextNote.MaxLength = caratteriDisponibili;
                clTesto.Value      = caratteriDisponibili.ToString();
                TextNote.Attributes.Add("onKeyUp", "calcTesto(this,'" + caratteriDisponibili.ToString() + " ','NOTE'," + clTesto.ClientID + ")");
                TextNote.Attributes.Add("onchange", "calcTesto(this,'" + caratteriDisponibili.ToString() + " ','NOTE'," + clTesto.ClientID + ")");
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// gestione della versione
        /// </summary>
        private void gestioneVersione()
        {
            string funct = " window.opener.top.principale.iFrame_sx.document.location='../documento/tabGestioneDoc.aspx?tab=versioni'; ";

            //controllo il tipo di operazione da effettuare
            if (this.txt_indexSel != null && indexSel >= 0)
            {
                //salvo le nuove informazioni
                if (docSel != null)
                {
                    docSel.descrizione = this.TextNote.Text;
                    DocumentManager.modificaVersione(this, docSel);
                    schedaDocumento.documenti[indexSel] = docSel;
                    DocumentManager.setDocumentoSelezionato(this, schedaDocumento);
                }
            }
            else
            {
                //creo la nuova versione
                DocsPaWR.Documento fileReq = new DocsPAWA.DocsPaWR.Documento();
                fileReq.descrizione = this.TextNote.Text;
                fileReq.docNumber   = schedaDocumento.docNumber;

                //parte relativa alla data arrivo
                fileReq.dataArrivo = schedaDocumento.documenti[schedaDocumento.documenti.Length - 1].dataArrivo;

                fileReq = (DocsPAWA.DocsPaWR.Documento)DocumentManager.aggiungiVersione(this, fileReq, true, true);
            }

            funct += " window.close(); ";
            Response.Write("<script> " + funct + "</script>");
        }