예제 #1
0
        private void DataGrid1_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            DocsPaWR.Corrispondente[] listaCorrTo = null;
            DocsPaWR.Corrispondente[] listaCorrCC = null;

            if (this.DataGrid1.SelectedIndex >= 0)
            {
                str_indexSel = ((Label)this.DataGrid1.Items[this.DataGrid1.SelectedIndex].Cells[5].Controls[1]).Text;
                int indexSel = Int32.Parse(str_indexSel);
                //this.infoDoc = (DocsPAWA.DocsPaWR.InfoDocumento[]) Session["RicercaProtocolliUscita.ListaInfoDoc"];
                this.infoDoc = RicercaNonProtocollatiSessionMng.GetListaInfoDocumenti(this);

                if (indexSel > -1)
                {
                    infoDocSel = (DocsPAWA.DocsPaWR.InfoDocumento) this.infoDoc[indexSel];
                }

                if (infoDocSel != null)
                {
                    //prendo il dettaglio del documento e estraggo i destinatari del protocollo
                    DocsPaWR.SchedaDocumento schedaDocUscita = new DocsPAWA.DocsPaWR.SchedaDocumento();
                    schedaDocUscita = DocumentManager.getDettaglioDocumento(this, infoDocSel.idProfile, infoDocSel.docNumber);
                    //prendo i destinatari in To
                    listaCorrTo = ((DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDocUscita.protocollo).destinatari;
                    //prendo i destinatari in CC
                    listaCorrCC = ((DocsPAWA.DocsPaWR.ProtocolloUscita)schedaDocUscita.protocollo).destinatariConoscenza;

                    FillDataGrid(listaCorrTo, listaCorrCC);
                    DocumentManager.setInfoDocumento(this, infoDocSel);
                }
            }
        }
예제 #2
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                // Reperimento parametri query string
                this.idProfile = this.GetQueryStringParameter("iddoc");
                this.docNum    = this.GetQueryStringParameter("docnum");

                if (idProfile != string.Empty && docNum != string.Empty)
                {
                    DocumentoHandler handler = new DocumentoHandler();
                    this._schedaDocumento = handler.GetDocumento(this.idProfile, this.docNum);

                    this.InitializeControlMenuDocumento();

                    this.InitializeControlsDettagliDocumento();
                }
                else
                {
                    throw new ApplicationException("Parametri mancanti");
                }

                this.ShowButtonBackToSearchResult();

                this.ShowButtonVisualizzaDocumento();
            }
            catch (Exception ex)
            {
                ErrorManager.redirect(this, ex);
            }
        }
예제 #3
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                // Reperimento parametri query string
                this.idProfile = this.GetQueryStringParameter("iddoc");
                this.docNum    = this.GetQueryStringParameter("docnum");

                if (idProfile != string.Empty && docNum != string.Empty)
                {
                    this._schedaDocumento = DocumentManager.getDettaglioDocumento(this, this.idProfile, this.docNum);

                    this.InitializeControlMenuDocumento();

                    // Caricamento dati
                    this.Fetch();

                    // Impostazione visibilità campi
                    this.SetFieldsVisibility();
                }
                else
                {
                    throw new ApplicationException("Parametri mancanti");
                }
            }
            catch (Exception ex)
            {
                ErrorManager.redirect(this, ex);
            }
        }
예제 #4
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            Response.Expires = -1;

            // Impostazione pulsante di default
            this.SetDefaultButton();

            if (!this.IsPostBack)
            {
                // Caricamento tipi di file
                this.FetchFileTypes();

                // Ripristino dati salvati sul client relativamente a:
                // - percorso in cui è stato salvato l'ultima volta il file in checkout
                // - nome dell'ultimo file in checkout
                this.RegisterClientScript("RestoreClientData", "RestoreClientData();");

                // Inizializzazione script client
                this.InitializeClientScript();
                string nomeOriginale = null;
                DocsPAWA.DocsPaWR.SchedaDocumento schedaDocumento = DocumentManager.getDocumentoSelezionato();

                if (schedaDocumento != null)
                {
                    FileDocumento fd = new FileManager().getInfoFile(this.Page);
                    if (fd != null)
                    {
                        nomeOriginale = fd.nomeOriginale;
                    }
                }
                if (schedaDocumento != null && schedaDocumento.protocollo != null && schedaDocumento.protocollo.segnatura != null && !string.IsNullOrEmpty(schedaDocumento.protocollo.segnatura))
                {
                    if (string.IsNullOrEmpty(nomeOriginale))
                    {
                        string nome_file_segnatura = schedaDocumento.protocollo.segnatura;
                        this.txtFileName.Text = DocsPAWA.UserManager.normalizeStringPropertyValue(nome_file_segnatura);
                    }
                    else
                    {
                        this.txtFileName.Text = cleanFileName(nomeOriginale);
                    }
                }
                else
                {
                    if (schedaDocumento != null && schedaDocumento.docNumber != null && !string.IsNullOrEmpty(schedaDocumento.docNumber))
                    {
                        if (string.IsNullOrEmpty(nomeOriginale))
                        {
                            this.txtFileName.Text = schedaDocumento.docNumber;
                        }
                        else
                        {
                            this.txtFileName.Text = cleanFileName(nomeOriginale);
                        }
                    }
                }
            }
        }
예제 #5
0
        private void LoadData(bool updateGrid)
        {
            SearchResultInfo[]  idProfileList;
            DocsPaWR.InfoUtente infoUt = new DocsPAWA.DocsPaWR.InfoUtente();
            infoUt      = UserManager.getInfoUtente(this);
            ListaFiltri = DocumentManager.getFiltroRicDoc(this);
            if (!this.chk_ADL.Checked == true)
            {
                infoDoc = DocumentManager.getQueryInfoDocumentoPaging(infoUt.idGruppo, infoUt.idPeople, this, this.ListaFiltri, currentPage, out numTotPage, out nRec, true, false, true, false, out idProfileList);

                //Controllo inserito per non far visualizzare se stesso
                DocsPAWA.DocsPaWR.SchedaDocumento schedaDocumentoLav = DocumentManager.getDocumentoInLavorazione();
                if (schedaDocumentoLav != null)
                {
                    List <DocsPaWR.InfoDocumento> tempDoc = new List <DocsPaWR.InfoDocumento>();
                    tempDoc = infoDoc.ToList <DocsPaWR.InfoDocumento>();
                    foreach (DocsPaWR.InfoDocumento infDocTemp in infoDoc)
                    {
                        if (infDocTemp.docNumber == schedaDocumentoLav.docNumber)
                        {
                            tempDoc.Remove(infDocTemp);
                            break;
                        }
                    }
                    infoDoc = tempDoc.ToArray();
                }
                //FINE CONTROLLO INSERIMENTO PER NON FAR VISUALIZZARE SE STESSO
            }
            else
            {
                DocsPaWR.AreaLavoro areaLavoro = DocumentManager.getListaAreaLavoro(this, "G", "1", currentPage, out numTotPage, out nRec, UserManager.getRegistroSelezionato(this).systemId);

                infoDoc = new DocsPAWA.DocsPaWR.InfoDocumento[areaLavoro.lista.Length];

                for (int i = 0; i < areaLavoro.lista.Length; i++)
                {
                    infoDoc[i] = (DocsPAWA.DocsPaWR.InfoDocumento)areaLavoro.lista[i];
                }
            }


            this.lbl_countRecord.Visible = true;
            this.lbl_countRecord.Text    = "Documenti tot:  " + nRec;

            this.DataGrid1.VirtualItemCount = nRec;
            this.DataGrid1.CurrentPageIndex = currentPage - 1;

            //appoggio il risultato in sessione
            //Session["RicercaProtocolliUscita.ListaInfoDoc"] =infoDoc;
            RicercaNonProtocollatiSessionMng.SetListaInfoDocumenti(this, infoDoc);

            if (infoDoc != null && infoDoc.Length > 0)
            {
                this.BindGrid(infoDoc);
            }
        }
예제 #6
0
        /// <summary>
        /// Inserimento del file request nella scheda documento
        /// </summary>
        /// <param name="schedaDocumento"></param>
        /// <param name="fileRequestAllegato"></param>
        private void AppendFileRequestAllegati(DocsPAWA.DocsPaWR.SchedaDocumento schedaDocumento, DocsPAWA.DocsPaWR.Allegato fileRequestAllegato)
        {
            ArrayList list = new ArrayList(schedaDocumento.allegati);

            list.Add(fileRequestAllegato);

            schedaDocumento.allegati = null;

            schedaDocumento.allegati = new DocsPAWA.DocsPaWR.Allegato[list.Count];
            list.CopyTo(schedaDocumento.allegati);
        }
예제 #7
0
        /// <summary>
        /// Inserimento del file request nella scheda documento
        /// </summary>
        /// <param name="schedaDocumento"></param>
        /// <param name="fileRequest"></param>
        private void AppendFileRequestDocumenti(DocsPAWA.DocsPaWR.SchedaDocumento schedaDocumento, DocsPAWA.DocsPaWR.FileRequest fileRequest)
        {
            ArrayList list = new ArrayList(schedaDocumento.documenti);

            list.Add(fileRequest);

            schedaDocumento.documenti = null;

            schedaDocumento.documenti = new DocsPAWA.DocsPaWR.Documento[list.Count];
            list.CopyTo(schedaDocumento.documenti);
        }
예제 #8
0
        /// <summary>
        ///
        /// </summary>
        protected void WriteContatoreStampeEffettuate()
        {
            DocsPAWA.DocsPaWR.SchedaDocumento schedaDocumento = DocumentManager.getDocumentoInLavorazione();

            DocsPAWA.DocsPaWR.DocsPaWebService ws = ProxyManager.getWS();
            ws.updateStampeDocumentoEffettuate(UserManager.getInfoUtente(),
                                               this.NumeroStampeEffettuate,
                                               this.NumeroStampeDaEffettuare,
                                               schedaDocumento.systemId);

            string numStampe = (this.NumeroStampeEffettuate + this.NumeroStampeDaEffettuare).ToString();

            schedaDocumento.protocollo.stampeEffettuate = numStampe;
        }
예제 #9
0
        /// <summary>
        /// Visualizzazione del documento
        /// </summary>
        private void ShowFileDocument(DocsPAWA.DocsPaWR.SchedaDocumento schedaDocumento, string versionId, bool isAllegato)
        {
            DocsPaWR.FileRequest fileRequest = this.GetFileRequest(schedaDocumento, versionId, isAllegato);

            DocsPaWR.FileDocumento fileDocument = this.GetFileDocument(fileRequest);

            if (fileDocument != null)
            {
                this.RenderDocumentContent(fileDocument);
            }
            else
            {
                // Documento non trovato
            }
        }
예제 #10
0
        private void DataGrid1_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            string key = ((Label)this.DataGrid1.Items[this.DataGrid1.SelectedIndex].Cells[3].Controls[1]).Text;

            DocsPaWR.InfoDocumento infoDoc = new DocsPAWA.DocsPaWR.InfoDocumento();
            //Celeste
            //infoDoc = (DocsPAWA.DocsPaWR.InfoDocumento)ListaDoc[Int32.Parse(key)];
            infoDoc = DocumentManager.getListaDocProt(this)[Int32.Parse(key)];
            //Fine Celeste
            DocsPaWR.SchedaDocumento schedaDoc = new DocsPAWA.DocsPaWR.SchedaDocumento();
            schedaDoc = DocumentManager.getDettaglioDocumento(this, infoDoc.idProfile, infoDoc.docNumber);
            FileManager.setSelectedFileReg(this, schedaDoc.documenti[0], "../popup");
            string sval = @"../popup/ModalVisualStampaReg.aspx?id=" + this.Session.SessionID;

            RegisterStartupScript("ApriModale", "<script>OpenMyDialog('" + sval + "');</script>");
        }
예제 #11
0
 private DocsPAWA.DocsPaWR.DocumentoParolaChiave[] addParoleChiaveToDoc(DocsPAWA.DocsPaWR.SchedaDocumento schedaDocumento, DocsPAWA.DocsPaWR.DocumentoParolaChiave[] listaDocParoleChiave)
 {
     DocsPaWR.DocumentoParolaChiave[] listaPC;
     listaPC = schedaDocumento.paroleChiave;
     if (listaDocParoleChiave != null)
     {
         for (int i = 0; i < listaDocParoleChiave.Length; i++)
         {
             if (!listaContains(schedaDocumento.paroleChiave, listaDocParoleChiave[i]))
             {
                 listaPC = Utils.addToArrayParoleChiave(listaPC, listaDocParoleChiave[i]);
             }
         }
     }
     return(listaPC);
 }
예제 #12
0
        /// <summary>
        /// Aggiornamento dello statto di checkout della scheda documento correntemente visualizzata

        /// </summary>
        /// <remarks>
        /// Qualora sia attivata la gestione degli allegati profilati, la scheda documento sarà relativa
        /// all'allegato correntemente selezionato da tab allegati
        /// </remarks>
        public static void RefreshCheckOutStatus()
        {
            DocsPAWA.DocsPaWR.SchedaDocumento schedaDocumento = null;

            //if (IsEnabledProfilazioneAllegati && IsSelectedTabAllegati())
            if (IsSelectedTabAllegati())
            {
                // Tab "allegati" correntemente selezionato,
                // reperimento dello stato checkout dell'allegato selezionato.
                // Solo se attiva la profilazione allegati.
                DocsPaWR.FileRequest fileRequest = FileManager.getSelectedFile();

                if (fileRequest != null && fileRequest.GetType() == typeof(DocsPaWR.Allegato))
                {
                    SiteNavigation.CallContext context = SiteNavigation.CallContextStack.CurrentContext;

                    schedaDocumento = context.ContextState["schedaAllegatoSelezionato"] as DocsPaWR.SchedaDocumento;

                    if (schedaDocumento != null)
                    {
                        schedaDocumento = _webServices.DocumentoGetDettaglioDocumento(GetInfoUtente(), schedaDocumento.systemId, schedaDocumento.docNumber);

                        context.ContextState["schedaAllegatoSelezionato"] = schedaDocumento;
                    }
                }
            }
            else
            {
                schedaDocumento = DocumentManager.getDocumentoSelezionato();

                // Reperimento scheda documento per l'allegato
                schedaDocumento = _webServices.DocumentoGetDettaglioDocumento(GetInfoUtente(), schedaDocumento.systemId, schedaDocumento.docNumber);

                DocumentManager.setDocumentoSelezionato(schedaDocumento);
            }

            if (schedaDocumento != null)
            {
                //Inizializzazione del contesto di checkout del documento
                DocsPAWA.CheckInOut.CheckOutContext.Current = new DocsPAWA.CheckInOut.CheckOutContext(schedaDocumento);
            }
            else
            {
                DocsPAWA.CheckInOut.CheckOutContext.Current = null;
            }
        }
예제 #13
0
        protected SchedaDocumento getDettaglioDocumento(string idProfile, string docNumber)
        {
            DocsPaWR.SchedaDocumento sd = new DocsPAWA.DocsPaWR.SchedaDocumento();

            try
            {
                if (idProfile == null && docNumber == null)
                {
                    sd = null;
                }
                else
                {
                    AdminTool.Manager.SessionManager sessionManager = new DocsPAWA.AdminTool.Manager.SessionManager();
                    sd = ProxyManager.getWS().DocumentoGetDettaglioDocumentoNoSecurity(sessionManager.getUserAmmSession(), idProfile, docNumber);
                    if ((sd == null))// || (sd.inCestino != null && sd.inCestino == "1"))
                    {
                        string errorMessage = string.Empty;

                        if (sd == null)
                        {
                            errorMessage = "Attenzione, non è stato possibile recuperare i dati del documento richiesto.\\nConsultare il log per maggiori dettagli.";
                            Page.Response.Write("<script>alert('" + errorMessage + "');</script>");
                            if (Page.Session["protocolloEsistente"] != null && (bool)Page.Session["protocolloEsistente"])
                            {
                                Page.Session.Remove("protocolloEsistente");
                            }
                            else
                            {
                                // Redirect alla homepage di docspa
                                SiteNavigation.CallContextStack.Clear();
                                SiteNavigation.NavigationContext.RefreshNavigation();
                                string script = "<script>window.open('../GestioneRuolo.aspx','principale','width=410,height=300,scrollbars=NO');</script>";
                                Page.Response.Write(script);
                            }
                        }
                    }
                }
            }
            catch (Exception es)
            {
                return(null);
            }

            return(sd);
        }
예제 #14
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);
        }
예제 #15
0
        /// <summary>
        /// Reperimento oggetto "DocsPaWR.FileRequest" richiesto per la visualizzazione
        /// </summary>
        /// <param name="schedaDocumento"></param>
        /// <returns></returns>
        private DocsPAWA.DocsPaWR.FileRequest GetFileRequest(DocsPAWA.DocsPaWR.SchedaDocumento schedaDocumento, string versionId, bool isAllegato)
        {
            DocsPaWR.FileRequest retValue = null;

            DocsPaWR.FileRequest[] listDocuments = schedaDocumento.documenti;
            if (isAllegato)
            {
                listDocuments = schedaDocumento.allegati;
            }

            foreach (DocsPAWA.DocsPaWR.FileRequest fileRequest in listDocuments)
            {
                if (fileRequest.versionId.Equals(versionId))
                {
                    retValue = fileRequest;
                    break;
                }
            }

            return(retValue);
        }
예제 #16
0
        private string GestioneAvvisoModale(string valore)
        {
            string retValue = string.Empty;

            try
            {
                //prendo il documento in sessione
                schedaDocInLavorazione = DocumentManager.getDocumentoInLavorazione(this);

                //prendo il protocollo in uscita selezionato dal datagrid
                infoDocSel = DocumentManager.getInfoDocumento(this);

                retValue = valore;

                switch (valore)
                {
                case "Y":     //Gestione pulsante SI, CONTINUA

                    /* Alla pressione del pulsante CONTINUA l'utente vuole proseguire il
                     * collegamento nonostante oggetto sia diverso */

                    if (schedaDocInLavorazione != null)
                    {
                        if (infoDocSel != null)
                        {
                            schedaDocInLavorazione.rispostaDocumento         = infoDocSel;
                            schedaDocInLavorazione.modificaRispostaDocumento = true;
                        }

                        this.hd_returnValueModal.Value = "";

                        //if (((DocsPAWA.DocsPaWR.ProtocolloEntrata)schedaDocIngresso.protocollo).mittente == null)
                        //{
                        //   if (RicercaProtocolliUscitaSessionMng.getCorrispondenteRisposta(this) != null)
                        //   {
                        //      ((DocsPAWA.DocsPaWR.ProtocolloEntrata)schedaDocIngresso.protocollo).mittente = RicercaProtocolliUscitaSessionMng.getCorrispondenteRisposta(this);
                        //   }
                        //}
                        DocumentManager.setDocumentoSelezionato(this, schedaDocInLavorazione);
                        DocumentManager.setDocumentoInLavorazione(this, schedaDocInLavorazione);
                        //metto in sessione la scheda documento con le informazioni del protocollo a cui risponde

                        Page.RegisterStartupScript("", "<script>window.close();</script>");
                    }

                    break;

                case "N":

                    /* Alla pressione del pulsante NO, RESETTA l'utente vuole proseguire il collegamento
                     * con i dati che ha digitato sulla pagina di protocollo */


                    if (schedaDocInLavorazione != null)
                    {
                        if (infoDocSel != null)
                        {
                            schedaDocInLavorazione.rispostaDocumento         = infoDocSel;
                            schedaDocInLavorazione.modificaRispostaDocumento = true;
                        }

                        if (schedaDocInLavorazione.oggetto != null)
                        {
                            schedaDocInLavorazione.oggetto.descrizione = infoDocSel.oggetto.ToString();
                        }
                        else
                        {
                            DocsPaWR.Oggetto ogg = new DocsPAWA.DocsPaWR.Oggetto();
                            ogg.descrizione = infoDocSel.oggetto.ToString();
                            schedaDocInLavorazione.oggetto = ogg;
                        }

                        //if (RicercaProtocolliUscitaSessionMng.getCorrispondenteRisposta(this) != null)
                        //{
                        //   ((DocsPAWA.DocsPaWR.ProtocolloEntrata)schedaDocIngresso.protocollo).mittente = RicercaProtocolliUscitaSessionMng.getCorrispondenteRisposta(this);
                        //}

                        //	popolo il campo mittente con il destinatario selezionato dal protocollo a cui ri risponde
                        //((DocsPAWA.DocsPaWR.ProtocolloEntrata)schedaDocIngresso.protocollo).mittente = destSelected;

                        //metto in sessione la scheda documento con le informazioni del protocollo a cui risponde
                        DocumentManager.setDocumentoSelezionato(this, schedaDocInLavorazione);
                        DocumentManager.setDocumentoInLavorazione(this, schedaDocInLavorazione);
                        Page.RegisterStartupScript("", "<script>window.close();</script>");

                        this.hd_returnValueModal.Value = "";
                    }

                    break;

                case "S":
                    //non posso modificare il mittente o oggetto, quindi il pulsante continua
                    //si limiterà a popolare il campo risposta al protocollo con l'infoDoc corrente
                    if (schedaDocInLavorazione != null)
                    {
                        if (infoDocSel != null)
                        {
                            schedaDocInLavorazione.rispostaDocumento         = infoDocSel;
                            schedaDocInLavorazione.modificaRispostaDocumento = true;
                        }
                    }
                    DocumentManager.setDocumentoSelezionato(this, schedaDocInLavorazione);
                    DocumentManager.setDocumentoInLavorazione(this, schedaDocInLavorazione);
                    Page.RegisterStartupScript("", "<script>window.close();</script>");

                    break;
                }
            }
            catch
            {
            }

            return(retValue);
        }
예제 #17
0
        private void btn_ok_Click(object sender, System.EventArgs e)
        {
            int    itemIndex;
            bool   oggettoOK     = false;
            string oggettoDocSel = "";
            bool   avanzaDoc     = verificaSelezioneDocumento(out itemIndex);

            if (avanzaDoc)
            {
                this.infoDoc = RicercaNonProtocollatiSessionMng.GetListaInfoDocumenti(this);

                if (itemIndex > -1)
                {
                    infoDocSel    = (DocsPAWA.DocsPaWR.InfoDocumento) this.infoDoc[itemIndex];
                    oggettoDocSel = ((Label)DataGrid1.Items[itemIndex].Cells[3].Controls[1]).Text;
                    DocumentManager.setInfoDocumento(this, infoDocSel);
                }

                schedaDocInLavorazione = DocumentManager.getDocumentoInLavorazione(this);
                if (schedaDocInLavorazione != null)
                {
                    //if (schedaDocInLavorazione.docNumber != null)
                    //{
                    //CASO DOC GRIGIO CREATO

                    //inizio verifica congruenza campo oggetto
                    if (schedaDocInLavorazione.oggetto != null && schedaDocInLavorazione.oggetto.descrizione != null && schedaDocInLavorazione.oggetto.descrizione != String.Empty)
                    {
                        if (oggettoDocSel != null && oggettoDocSel != String.Empty)
                        {
                            if (schedaDocInLavorazione.oggetto.descrizione.ToUpper().Equals(oggettoDocSel.ToUpper()))
                            {
                                oggettoOK = true;
                            }
                        }
                    }
                    else
                    {
                        oggettoOK = true;
                        if (oggettoDocSel != null && oggettoDocSel != String.Empty)
                        {
                            DocsPaWR.Oggetto ogg = new DocsPAWA.DocsPaWR.Oggetto();
                            ogg.descrizione = oggettoDocSel.ToString();
                            schedaDocInLavorazione.oggetto = ogg;
                        }
                    }

                    if (!oggettoOK)
                    {
                        //se oggetto non coincide si lancia un avviso	all'utente
                        if (!this.Page.IsStartupScriptRegistered("avvisoModale"))
                        {
                            string scriptString = "";
                            if (schedaDocInLavorazione.docNumber != null)
                            {
                                scriptString = "<SCRIPT>OpenAvvisoModale( '" + oggettoOK + "' , 'True');</SCRIPT>";
                            }
                            else
                            {
                                scriptString = "<SCRIPT>OpenAvvisoModale( '" + oggettoOK + "' , 'False');</SCRIPT>";
                            }
                            this.Page.RegisterStartupScript("avvisoModale", scriptString);
                        }
                    }
                    else
                    {
                        schedaDocInLavorazione.rispostaDocumento         = infoDocSel;
                        schedaDocInLavorazione.modificaRispostaDocumento = true;

                        DocumentManager.setDocumentoSelezionato(this, schedaDocInLavorazione);
                        DocumentManager.setDocumentoInLavorazione(this, schedaDocInLavorazione);

                        RicercaNonProtocollatiSessionMng.SetDialogReturnValue(this, true);

                        Page.RegisterStartupScript("", "<script>window.close();</script>");
                    }
                }
                //}
            }
        }
예제 #18
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);
        }