Example #1
0
        /// <summary>
        /// Creazione oggetto "FileRequest" relativamente all'allegato del documento
        /// </summary>
        /// <returns></returns>
        private DocsPAWA.DocsPaWR.FileRequest GetFileRequestAllegato()
        {
            DocsPAWA.DocsPaWR.Allegato retValue = new DocsPAWA.DocsPaWR.Allegato();
            retValue.numeroPagine = 0;
            retValue.descrizione  = string.Empty;

            ProtocollazioneIngresso.Protocollo.ProtocolloMng protocolloMng = new ProtocollazioneIngresso.Protocollo.ProtocolloMng(this._page);
            retValue.docNumber = protocolloMng.GetDocumentoCorrente().docNumber;

            DocsPAWA.DocsPaWR.DocsPaWebService     ws       = new DocsPAWA.DocsPaWR.DocsPaWebService();
            ProtocollazioneIngresso.Login.LoginMng loginMng = new ProtocollazioneIngresso.Login.LoginMng(this._page);
            retValue = ws.DocumentoAggiungiAllegato(loginMng.GetInfoUtente(), retValue);

            retValue.version = "0";

            loginMng = null;
            ws       = null;

            // Impostazione della descrizione dell'allegato
            retValue.descrizione = "Allegato " + retValue.versionLabel;

            // Inserimento del file request nella scheda documento
            this.AppendFileRequestAllegati(protocolloMng.GetDocumentoCorrente(), retValue);

            return(retValue);
        }
Example #2
0
        /// <summary>
        /// Creazione oggetto "FileRequest" relativamente ad una nuova versione del documento
        /// </summary>
        /// <returns></returns>
        private DocsPAWA.DocsPaWR.Documento GetFileRequestVersione()
        {
            DocsPAWA.DocsPaWR.Documento retValue = new DocsPAWA.DocsPaWR.Documento();
            retValue.descrizione = string.Empty;

            ProtocollazioneIngresso.Protocollo.ProtocolloMng protocolloMng = new ProtocollazioneIngresso.Protocollo.ProtocolloMng(this._page);

            DocsPAWA.DocsPaWR.SchedaDocumento schedaDocumento = protocolloMng.GetDocumentoCorrente();
            retValue.docNumber = schedaDocumento.docNumber;

            DocsPAWA.DocsPaWR.DocsPaWebService     ws       = new DocsPAWA.DocsPaWR.DocsPaWebService();
            ProtocollazioneIngresso.Login.LoginMng loginMng = new ProtocollazioneIngresso.Login.LoginMng(this._page);
            retValue = (DocsPAWA.DocsPaWR.Documento)ws.DocumentoAggiungiVersione(retValue, loginMng.GetInfoUtente());
            loginMng = null;
            ws       = null;

            // Inserimento del file request nella scheda documento
            this.AppendFileRequestDocumenti(schedaDocumento, retValue);

            return(retValue);
        }
Example #3
0
        //Valorizzo la descrizione oggetto in base al codice se esiste!
        protected void txt_cod_oggetto_TextChanged(object sender, EventArgs e)
        {
            DocsPAWA.DocsPaWR.Registro[] listaRF;
            if (CodOggPostBack)
            {
                //Recupero la scheda corrente
                DocsPaWR.SchedaDocumento schedaDoc = DocumentManager.getDocumentoInLavorazione(this.Page);
                if (schedaDoc == null)
                {
                    //Valorizzazione della schedaDoc nel caso di protocollazione semplice
                    ProtocollazioneIngresso.Protocollo.ProtocolloMng protoMng = new ProtocollazioneIngresso.Protocollo.ProtocolloMng(this.Page);
                    schedaDoc = protoMng.GetDocumentoCorrente();
                }

                ////Valorizzo il registro corrente
                string[] listaReg = { "" };
                try
                {
                    //recupero la lista di registri per passarli allo user control oggetto ai fini della ricerca
                    if (wnd == "proto")
                    {
                        //registro in sessione
                        listaReg = UserManager.getListaIdRegistri(this.Page);
                    }
                    else
                    {
                        //se vengo dal protocollo Semplificato
                        if (wnd == "protoSempl")
                        {
                            ProtocollazioneIngresso.Registro.RegistroMng regMng = new ProtocollazioneIngresso.Registro.RegistroMng(this.Page);
                            listaReg    = new String[1];
                            listaReg[0] = regMng.GetRegistroCorrente().systemId;
                        }
                        else
                        {
                            listaReg = null; // ricerche e profilo
                        }
                    }

                    ArrayList aL = new ArrayList();
                    if (listaReg != null)
                    {
                        for (int i = 0; i < listaReg.Length; i++)
                        {
                            aL.Add(listaReg[i]);
                            listaRF = UserManager.getListaRegistriWithRF(this.Page, "1", listaReg[i]);
                            for (int j = 0; j < listaRF.Length; j++)
                            {
                                aL.Add(listaRF[j].systemId);
                            }
                        }

                        listaReg = new string[aL.Count];
                        aL.CopyTo(listaReg);
                    }
                }
                catch (Exception ex)
                {
                    throw new Exception("Registro non settato!");
                }
                DocsPaWR.Oggetto[] listaObj;

                // E' inutile finire nel backend se la casella di testo è vuota (a parte il fatto che
                // la funzione, in questo caso, restituisce tutto l'oggettario)
                if (!String.IsNullOrEmpty(this.txt_cod_oggetto.Text.Trim()))
                {
                    //In questo momento tralascio la descrizione oggetto che metto come stringa vuota
                    listaObj = DocumentManager.getListaOggettiByCod(this.Page, listaReg, "", this.txt_cod_oggetto.Text);
                }
                else
                {
                    listaObj = new DocsPaWR.Oggetto[] {
                        new DocsPaWR.Oggetto()
                        {
                            descrizione = String.Empty,
                            codOggetto  = String.Empty
                        }
                    }
                };

                if (listaObj.Length > 0)
                {
                    this.txt_oggetto.Text = listaObj[0].descrizione;
                    //this.txt_cod_oggetto.Text = listaObj[0].codOggetto;
                    schedaDoc.oggetto.codOggetto   = listaObj[0].codOggetto;
                    schedaDoc.oggetto.descrizione  = listaObj[0].descrizione;
                    schedaDoc.oggetto.daAggiornare = true;
                    DocumentManager.setDocumentoInLavorazione(schedaDoc);
                }
                else
                {
                    RegisterClientScript("Codice_error", "alert('codice oggetto inesistente!');");
                    this.txt_oggetto.Text     = "";
                    this.txt_cod_oggetto.Text = "";
                    //Azzero anche i dati nella scheda corrente in modo che non rimanga in memoria il vecchio
                    //campo e codice oggetto!!!
                    schedaDoc.oggetto.codOggetto  = "";
                    schedaDoc.oggetto.descrizione = "";
                    DocumentManager.setDocumentoInLavorazione(schedaDoc);
                }
            }
        }
Example #4
0
        /// <summary>
        /// Upload del documento
        /// </summary>
        /// <param name="fileDoc"></param>
        /// <param name="errorMessage"></param>
        /// <returns></returns>
        public bool Upload(DocsPAWA.DocsPaWR.FileDocumento fileDoc, bool conversionePDFServer, out string errorMessage)
        {
            bool retValue = false;

            errorMessage = string.Empty;

            try
            {
                ProtocollazioneIngressoLog.WriteLogEntry(
                    string.Format("UploadDocumento (FileName: {0} - Dim: {1}", fileDoc.name, fileDoc.content.Length.ToString()));
            }
            catch
            {
            }

            DocsPAWA.DocsPaWR.FileRequest fileReq = this.GetFileRequest(fileDoc.name);

            // Booleano utilizzato per indicare se è necessario convertire in PDF in modalità Asincrona
            bool convertAsync = false;

            if (fileReq != null)
            {
                fileReq.cartaceo = fileDoc.cartaceo;

                ProtocollazioneIngresso.Login.LoginMng loginMng = new ProtocollazioneIngresso.Login.LoginMng(this._page);

                DocsPAWA.DocsPaWR.DocsPaWebService ws = new DocsPAWA.DocsPaWR.DocsPaWebService();
                ws.Timeout = System.Threading.Timeout.Infinite;

                // Se è attiva la conversione PDF sincrona, si prova a convertire il file facendo vincere lei
                // se la conversione va a buon fine, viene associato il file pdf al documento altrimenti viene
                // acquisito il TIF e si prova ad eseguire la conversione asincrona
                if (Utils.IsEbabledConversionePdfLatoServerSincrona().ToLower() == "true")
                {
                    FileDocumento convertedDoc = ws.GeneratePDFInSyncMod(fileDoc);

                    if (convertedDoc == null)
                    {
                        convertAsync = true;
                    }

                    if (convertedDoc != null && convertedDoc.content.Length > 0)
                    {
                        fileDoc = convertedDoc;
                    }
                }


                retValue = ws.DocumentoPutFileNoException(ref fileReq, fileDoc, loginMng.GetInfoUtente(), out errorMessage);
            }

            //Se abilitata la conversione lato server ed è necessario effettuare la conversione asincrona,
            // chiamo il webmethod che mette in coda il file da convertire
            if (retValue && conversionePDFServer && convertAsync)
            {
                DocsPAWA.DocsPaWR.SchedaDocumento documento = null;

                if (fileReq.GetType() == typeof(DocsPAWA.DocsPaWR.Allegato))
                {
                    // Il documento acquisito è un allegato: reperimento della scheda documento
                    documento = DocumentManager.getDettaglioDocumento(this._page, fileReq.docNumber, fileReq.docNumber);
                }
                else
                {
                    ProtocollazioneIngresso.Protocollo.ProtocolloMng protocolloMng = new ProtocollazioneIngresso.Protocollo.ProtocolloMng(this._page);

                    documento = protocolloMng.GetDocumentoCorrente();
                }

                FileManager.EnqueueServerPdfConversion(this._page,
                                                       UserManager.getInfoUtente(this._page),
                                                       fileDoc.content,
                                                       fileDoc.name,
                                                       documento);
            }

            return(retValue);
        }
Example #5
0
 /// <summary>
 /// Reperimento oggetto "FileRequest" relativamente al documento principale
 /// dalla scheda documento
 /// </summary>
 /// <returns></returns>
 private DocsPAWA.DocsPaWR.FileRequest GetFileRequestDocumentoPrincipale()
 {
     ProtocollazioneIngresso.Protocollo.ProtocolloMng protocolloMng = new ProtocollazioneIngresso.Protocollo.ProtocolloMng(this._page);
     return(protocolloMng.GetDocumentoCorrente().documenti[0]);
 }
Example #6
0
        private void btn_ok_Click(object sender, System.EventArgs e)
        {
            string desc;

            Session.Add("oggettario.retValue", true);
            DocsPaWR.SchedaDocumento schedaDocumento;
            DocsPaWR.Oggetto         oggettoDoc = new DocsPAWA.DocsPaWR.Oggetto();
            int selIndex = dg_Oggetti.SelectedIndex;

            if (selIndex > -1 && selIndex < this.dg_Oggetti.Items.Count)
            {
                oggettoDoc.systemId     = ((Label)this.dg_Oggetti.Items[selIndex].Cells[2].Controls[1]).Text;
                oggettoDoc.descrizione  = ((Label)this.dg_Oggetti.Items[selIndex].Cells[1].Controls[1]).Text;
                oggettoDoc.daAggiornare = true;

                string codOgg = ((Label)this.dg_Oggetti.Items[selIndex].Cells[0].Controls[1]).Text;
                if (codOgg != null && codOgg != string.Empty)
                {
                    oggettoDoc.codOggetto = codOgg;
                }
            }

            //in questo caso può leggere anche dalla textBox ed eventualmente modificare l'oggetto!!!
            string msg;

            //controllo sull'inserimento dell'oggetto
            if ((this.ctrl_oggetto.oggetto_text.Equals("") || this.ctrl_oggetto.oggetto_text == null) && (oggettoDoc.descrizione == null || oggettoDoc.descrizione == ""))
            {
                msg = "Selezionare un oggetto";
                Response.Write("<script>alert('" + msg + "');</script>");
                return;
            }

            //controllo sulla lunghezza dell'oggetto (max 2000 car.)
            if (this.ctrl_oggetto.oggetto_text.Length > 2000)
            {
                msg = "La lunghezza massima del campo oggetto non deve superare i 2000 caratteri.";
                ctrl_oggetto.oggetto_SetControlFocus();
                return;
            }

            if (ctrl_oggetto.oggetto_text != null && ctrl_oggetto.oggetto_text != "")
            {
                //replace dell'apice singolo
                oggettoDoc.descrizione = this.ctrl_oggetto.oggetto_text;
            }

            //Aggiunta del codice oggetto se esiste!!!
            if (ctrl_oggetto.cod_oggetto_text != null && ctrl_oggetto.cod_oggetto_text != string.Empty)
            {
                oggettoDoc.codOggetto = ctrl_oggetto.cod_oggetto_text;
            }
            else
            {
                //se è null lo pongo uguale alla stringa vuota per svuotare il campo codice oggetto!!!
                if (oggettoDoc.codOggetto == null && codOgg_enable)
                {
                    oggettoDoc.codOggetto = "";
                }
            }

            desc = oggettoDoc.descrizione;
            if (desc != null)
            {
                desc = desc.Replace("'", @"\'").Replace("\"", "\\\"").Replace("\n", @"\n");
                desc = desc.Replace("\r", @"\r").Replace("\t", @"\t");
            }
            else
            {
                desc = "";
            }
            if (wnd != null && (wnd.Equals("proto") || wnd.Equals("doc_Prof") || wnd.Equals("protoSempl")))
            {
                if (!wnd.Equals("protoSempl"))
                {
                    schedaDocumento                   = (DocsPAWA.DocsPaWR.SchedaDocumento)Session["tabDoc.schedaDocumento"];
                    schedaDocumento.oggetto           = oggettoDoc;
                    Session["tabDoc.schedaDocumento"] = schedaDocumento;
                    Session.Remove("saveButtonEnabled");
                    Session.Add("saveButtonEnabled", true);

                    DocumentManager.setDocumentoInLavorazione(schedaDocumento);
                    Response.Write("<script>var k=window.opener.document.forms[0].submit(); window.close();</script>");

                    //string fld_oggetto = (wnd == "doc_Prof") ? "txt_oggetto" : "txt_oggetto_P";
                    //Response.Write("<script>window.opener.document.getElementById('" + fld_oggetto + "').value='" + desc + "'; var k=window.opener.document.forms[0].submit(); window.close();</script>");
                }
                else
                {
                    ProtocollazioneIngresso.Protocollo.ProtocolloMng protoMng = new ProtocollazioneIngresso.Protocollo.ProtocolloMng(this);
                    DocsPAWA.DocsPaWR.SchedaDocumento currentDocument         = protoMng.GetDocumentoCorrente();
                    currentDocument.oggetto = oggettoDoc;
                    Response.Write("<script>window.close();</script>");
                }
            }
            if (wnd == "ric_E" || wnd == "ric_C" || wnd == "ric_CT" || wnd == "ric_G")
            {
                string nomeFunc = "setOggetto('" + wnd + "','" + desc + "');";
                ClientScript.RegisterStartupScript(this.GetType(), "setOggetto", nomeFunc.ToString(), true);
            }
            if (wnd == "ric_Classifica")
            {
                Response.Write("<script>window.returnValue = '" + desc + "'; window.close();</script>");
            }
        }