Пример #1
0
        public static string convertiTipoPoto(DocsPaVO.documento.SchedaDocumento schDoc)
        {
            string retval = schDoc.tipoProto;

            switch (schDoc.tipoProto)
            {
            case "A":
            case "P":
            case "I":
            {
                retval = "Protocollato";
                if (schDoc.protocollo != null)
                {
                    if (string.IsNullOrEmpty(schDoc.protocollo.segnatura))
                    {
                        retval = "Predisposto";
                    }
                }
            }
            break;

            case "G":
                retval = "Grigio";
                break;
            }
            return(retval);
        }
Пример #2
0
        public override string verifyTipoDoc(DocsPaVO.utente.InfoUtente infoUtente, ref DocsPaVO.documento.SchedaDocumento schedaDocumento)
        {
            string message = string.Empty;

            if (schedaDocumento != null)
            {
                DocsPaVO.documento.SchedaDocumento schedaDocumentoDaVerificare = schedaDocumento;

                //Controllo Preventivo
                if (schedaDocumentoDaVerificare != null &&
                    schedaDocumentoDaVerificare.template != null &&
                    schedaDocumentoDaVerificare.template.DESCRIZIONE.ToUpper().Equals("DOCUMENTOUBR")
                    )
                {
                    ControlloTipologiaDocControlloPreventivo(ref schedaDocumentoDaVerificare, ref message, infoUtente);

                    //Se i controlli sono andati tutti a buon fine aggiorno la scheda documento
                    if (string.IsNullOrEmpty(message))
                    {
                        schedaDocumento = schedaDocumentoDaVerificare;
                    }
                }
            }

            return(message);
        }
Пример #3
0
        private static DocsPaVO.documento.FileDocumento CreaRicevutaPresaVisione(DocsPaVO.utente.InfoUtente userInfo, string idDocument)
        {
            DocsPaVO.documento.FileDocumento fdoc = new DocsPaVO.documento.FileDocumento();

            try
            {
                DocsPaVO.documento.SchedaDocumento schedaDoc    = BusinessLogic.Documenti.DocManager.getDettaglioNoSecurity(userInfo, idDocument);
                DocsPaVO.documento.Documento       doc          = (DocsPaVO.documento.Documento)schedaDoc.documenti[0];
                DocsPaVO.Procedimento.Procedimento procedimento = BusinessLogic.Procedimenti.ProcedimentiManager.GetProcedimentoByIdDoc(idDocument);
                DocsPaVO.utente.Corrispondente     corr         = BusinessLogic.Utenti.UserManager.getCorrispondenteBySystemID(procedimento.Autore);

                string text = string.Format("L'utente {0}, in data {1}, ha preso visione del documento {2} sul Portale dei procedimenti amministrativi.\r\nHash del file: {3}",
                                            corr.descrizione,
                                            procedimento.Documenti[0].DataVisualizzazione,
                                            schedaDoc.protocollo.segnatura,
                                            GetImpronta(doc)
                                            );

                PdfModelProcessor processor = new PdfModelProcessor();
                fdoc                = processor.CreaRicevuta(userInfo, idDocument, text);
                fdoc.name           = "Ricevuta di presa visione.pdf";
                fdoc.fullName       = fdoc.name;
                fdoc.nomeOriginale  = fdoc.name;
                fdoc.contentType    = "application/pdf";
                fdoc.estensioneFile = "pdf";
            }
            catch (Exception ex)
            {
                fdoc = null;
                logger.Error("Errore in CreaRicevutaPresaVisione", ex);
            }

            return(fdoc);
        }
Пример #4
0
        /// <summary>
        /// Spostamento dei file dal repository di sessione temporaneo
        /// al repository documentale in cui sono stati memorizzati i metadati del documento
        /// </summary>
        /// <param name="schedaDocumento"></param>
        /// <remarks>
        /// L'operazione può essere utilizzata solamente se i metadati del documento
        /// sono stati salvati e se i file eventualmente acquisiti ancora risiedono nel repository temporaneo
        /// </remarks>
        public static void Syncronize(DocsPaVO.documento.SchedaDocumento schedaDocumento)
        {
            if (!string.IsNullOrEmpty(schedaDocumento.systemId) &&
                schedaDocumento.repositoryContext != null)
            {
                SessionRepositoryFileManager fileManager = SessionRepositoryFileManager.GetFileManager(schedaDocumento.repositoryContext);

                DocsPaVO.documento.FileRequest[] versions = (DocsPaVO.documento.FileRequest[])schedaDocumento.documenti.ToArray(typeof(DocsPaVO.documento.FileRequest));
                if (versions.Length > 0)
                {
                    schedaDocumento.documenti = new ArrayList(CopyToRepository(fileManager, versions));
                }

                versions = (DocsPaVO.documento.FileRequest[])schedaDocumento.allegati.ToArray(typeof(DocsPaVO.documento.Allegato));
                if (versions.Length > 0)
                {
                    schedaDocumento.allegati = new ArrayList(CopyToRepository(fileManager, versions));
                }

                // Imposta il repository come scaduto
                fileManager.Delete();

                schedaDocumento.repositoryContext = null;
            }
            else
            {
                throw new ApplicationException("Nessun repository di sessione definito per il documento");
            }
        }
Пример #5
0
        public static DocsPaVO.documento.SchedaDocumento getDettaglioMobile(DocsPaVO.utente.InfoUtente infoUtente, string idProfile, string docNumber)
        {
            DocsPaDB.Query_DocsPAWS.Mobile.DocumentiMobile doc       = new DocsPaDB.Query_DocsPAWS.Mobile.DocumentiMobile();
            DocsPaVO.documento.SchedaDocumento             schedaDoc = new DocsPaVO.documento.SchedaDocumento();
            schedaDoc = doc.GetDettaglioMobile(infoUtente, idProfile, docNumber, true);

            if (schedaDoc == null)
            {
                throw new Exception();
            }
            else
            {
                // Reperimento informazioni se il documento è in stato checkout,
                // solo per i documenti non di tipo stampa registro
                schedaDoc.checkOutStatus = BusinessLogic.CheckInOut.CheckInOutServices.GetCheckOutStatus(schedaDoc.systemId, schedaDoc.docNumber, infoUtente);
            }

            try
            {
                DocsPaDocumentale.Documentale.DocumentManager docManager = new DocsPaDocumentale.Documentale.DocumentManager(infoUtente);
                DocsPaVO.documento.Documento docPrinc = (schedaDoc.documenti[0] as DocsPaVO.documento.Documento);
                string ext = docManager.GetFileExtension(schedaDoc.docNumber, docPrinc.version);
                DocsPaVO.documento.Applicazione app = new DocsPaVO.documento.Applicazione();
                app.estensione         = ext;
                docPrinc.applicazione  = app;
                schedaDoc.documenti[0] = docPrinc;
            }
            catch (Exception)
            {
            }

            return(schedaDoc);
        }
Пример #6
0
        public static string getProvenienzaMitt(DocsPaVO.documento.SchedaDocumento schedaDoc)
        {
            string res = "";

            DocsPaVO.utente.Corrispondente corr = null;
            if (schedaDoc.protocollo.GetType().Equals(typeof(DocsPaVO.documento.ProtocolloEntrata)))
            {
                DocsPaVO.documento.ProtocolloEntrata pe = (DocsPaVO.documento.ProtocolloEntrata)schedaDoc.protocollo;
                corr = pe.mittente;
            }
            if (corr != null)
            {
                string systemId = null;
                if (corr.GetType().Equals(typeof(DocsPaVO.utente.Utente)) || corr.GetType().Equals(typeof(DocsPaVO.utente.UnitaOrganizzativa)))
                {
                    systemId = corr.systemId;
                    //res=getCorrectString(utente.);
                }
                if (corr.GetType().Equals(typeof(DocsPaVO.utente.Ruolo)))
                {
                    DocsPaVO.utente.Ruolo ruolo = (DocsPaVO.utente.Ruolo)corr;
                    if (ruolo.uo != null)
                    {
                        systemId = ruolo.uo.systemId;
                    }
                }
                res = getCorrectString(getCitta(systemId));
            }
            return(res);
        }
Пример #7
0
        /// <summary>
        /// </summary>
        /// <param name="schedaDoc"></param>
        /// <param name="session"></param>
        /// <param name="numDest"></param>
        /// <param name="destinatari"></param>
        /// <param name="pathFiles"></param>
        /// <param name="logger"></param>
        /// <param name="debug"></param>
        /// <returns></returns>
        private static bool creaFax(DocsPaVO.documento.SchedaDocumento schedaDoc, ZfLib.UserSession session, string numDest, System.Collections.ArrayList destinatari, string pathFiles)
        {
            try
            {
                ZfLib.NewMessage mess = session.CreateNewMsg();
//				logger.addMessage("Creazione del messaggio al numero "+numDest);
                logger.Debug("Creazione del messaggio al numero " + numDest);

                string bodyFax = "Si trasmette come file allegato il documento e gli eventuali allegati.";
                bodyFax   = bodyFax + "Registro: " + schedaDoc.registro.codRegistro + " ";
                bodyFax   = bodyFax + "Numero di protocollo: " + schedaDoc.protocollo.numero + " ";
                bodyFax   = bodyFax + "Data protocollazione: " + schedaDoc.protocollo.dataProtocollazione + " ";
                bodyFax   = bodyFax + "Segnatura: " + schedaDoc.protocollo.segnatura;
                mess.Text = bodyFax;
                string[] files = System.IO.Directory.GetFiles(pathFiles);

                for (int i = 0; i < files.Length; i++)
                {
                    if (isValidFile(files[i]))
                    {
                        mess.Attachments.Add(files[i]);
//						logger.addMessage("Attachment "+files[i]+" inserito");
                        logger.Debug("Attachment " + files[i] + " inserito");
                    }
                    else
                    {
//					    logger.addMessage("Attachment "+files[i]+" non valido");
                        logger.Debug("Attachment " + files[i] + " non valido");
                    }
                }
                ;

//				logger.addMessage("Creazione stringa destinatari");
                logger.Debug("Creazione stringa destinatari");

                string dest = "";

                for (int j = 0; j < destinatari.Count; j++)
                {
                    dest = dest + ((DocsPaVO.utente.Corrispondente)destinatari[j]).descrizione + " ";
                }

                mess.Recipients.AddFaxRecipient(dest, "", numDest);
//				logger.addMessage("Messaggio creato");
                logger.Debug("Messaggio creato");

                mess.Send();
//				logger.addMessage("Messaggio inviato");
                logger.Debug("Messaggio inviato");

                return(true);
            }
            catch (Exception e)
            {
//				logger.addMessage("Creazione ed invio fax non eseguito. Eccezione: "+e.ToString());
                logger.Debug("Creazione ed invio fax non eseguito. Eccezione: " + e.ToString());

                return(false);
            }
        }
Пример #8
0
 internal static void trasmetti(DocsPaVO.documento.SchedaDocumento schedaDocumento, DocsPaVO.Modelli_Trasmissioni.ModelloTrasmissione modello, ref DocsPaVO.documento.resultProtoEmergenza res, DocsPaVO.utente.InfoUtente infoUtente, DocsPaVO.utente.Ruolo ruolo)
 {
     try
     {
         //cerca trasmissione dal template
         //DocsPaVO.trasmissione.Trasmissione trasm =Trasmissioni.TemplateTrasmManager.creaTrasmDaTemplate(schedaDocumento, template, infoUtente, ruolo);
         DocsPaVO.trasmissione.Trasmissione trasm = creaTrasmDaModello(schedaDocumento, modello, infoUtente, ruolo);
         if (trasm == null)
         {
             res.messaggio = res.messaggio + " - " + " Trasmissione annullata!";
             return;
         }
         if (infoUtente.delegato != null)
         {
             trasm.delegato = ((DocsPaVO.utente.InfoUtente)(infoUtente.delegato)).idPeople;
         }
         //trasm = Trasmissioni.TrasmManager.saveTrasmMethod(trasm);
         //trasm = Trasmissioni.ExecTrasmManager.executeTrasmMethod(null, trasm);
         trasm           = Trasmissioni.ExecTrasmManager.saveExecuteTrasmMethod(null, trasm);
         res.isTrasmesso = true;
     }
     catch (Exception e)
     {
         res.messaggio = res.messaggio + " - " + e.Message;
         logger.Debug(e.ToString());
     }
 }
Пример #9
0
        internal static void classificaDocumento(DocsPaVO.documento.SchedaDocumento schedaDocumento, string codiceFascicolo, ref DocsPaVO.documento.resultProtoEmergenza res, DocsPaVO.utente.InfoUtente infoUtente, DocsPaVO.utente.Ruolo ruolo)
        {
            try
            {
                if (codiceFascicolo == null || codiceFascicolo.Equals(""))
                {
                    return;
                }
                //ricerca il codice classifica

                bool   outValue = false;
                string msg      = string.Empty;
                DocsPaVO.fascicolazione.Fascicolo fascicolo = Fascicoli.FascicoloManager.getFascicoloDaCodice(infoUtente, codiceFascicolo, schedaDocumento.registro, false, false);
                if (fascicolo != null)                  //classifica il doc
                {
                    outValue = Fascicoli.FascicoloManager.addDocFascicolo(infoUtente, schedaDocumento.systemId, fascicolo.systemID, false, out msg);
                }
                else                  //fascicolo non trovato
                {
                    res.messaggio = res.messaggio + " - " + "Fascicolo non trovato";
                    return;
                }
                res.isClassificato = true;
            }
            catch (Exception e)
            {
                res.messaggio = res.messaggio + " - " + e.Message;
                logger.Debug(e.ToString());
            }
        }
Пример #10
0
        private void putinfoCorr(DocsPaVO.documento.SchedaDocumento sch)
        {
            if (sch != null && sch.protocollo != null)
            {
                if (sch.tipoProto.Equals("A"))
                {
                    DocsPaVO.documento.ProtocolloEntrata pe = (DocsPaVO.documento.ProtocolloEntrata)sch.protocollo;
                    if (pe.mittente != null && pe.mittente.info != null)
                    {
                        BusinessLogic.Utenti.UserManager.addDettagliCorrOcc(pe.mittente);
                    }
                }

                if (sch.tipoProto.Equals("P"))
                {
                    DocsPaVO.documento.ProtocolloUscita pu = (DocsPaVO.documento.ProtocolloUscita)sch.protocollo;
                    if (pu.mittente != null && pu.mittente.info != null)
                    {
                        BusinessLogic.Utenti.UserManager.addDettagliCorrOcc(pu.mittente);
                    }

                    if (pu.destinatari != null && pu.destinatari.Count > 0)
                    {
                        for (int i = 0; i < pu.destinatari.Count; i++)
                        {
                            DocsPaVO.utente.Corrispondente corr = (DocsPaVO.utente.Corrispondente)pu.destinatari[i];
                            if (corr != null && corr.info != null)
                            {
                                BusinessLogic.Utenti.UserManager.addDettagliCorrOcc(corr);
                            }
                        }
                    }
                }
            }
        }
Пример #11
0
        /// <summary>
        /// Inizializzazione della trasmissione
        /// </summary>
        /// <param name="tipoOggetto"></param>
        /// <param name="idOggetto"></param>
        /// <remarks>
        /// Le classi derivate dovranno utilizzare tale metodo per inizializzare l'oggetto trasmissione piuttosto che crearne uno nuovo
        /// </remarks>
        /// <returns></returns>
        protected virtual DocsPaVO.trasmissione.Trasmissione CreateTrasmissione(DocsPaVO.trasmissione.TipoOggetto tipoOggetto, string idOggetto)
        {
            DocsPaVO.trasmissione.Trasmissione trasmissione = new DocsPaVO.trasmissione.Trasmissione();

            DocsPaVO.documento.SchedaDocumento schedaDocumento = null;
            DocsPaVO.fascicolazione.Fascicolo  schedaFascicolo = null;

            if (tipoOggetto == DocsPaVO.trasmissione.TipoOggetto.DOCUMENTO)
            {
                trasmissione.tipoOggetto = DocsPaVO.trasmissione.TipoOggetto.DOCUMENTO;

                schedaDocumento = BusinessLogic.Documenti.DocManager.getDettaglio(this._infoUtente, idOggetto, idOggetto);

                trasmissione.infoDocumento = new DocsPaVO.documento.InfoDocumento(schedaDocumento);
            }
            else if (tipoOggetto == DocsPaVO.trasmissione.TipoOggetto.FASCICOLO)
            {
                trasmissione.tipoOggetto = DocsPaVO.trasmissione.TipoOggetto.FASCICOLO;

                schedaFascicolo = BusinessLogic.Fascicoli.FascicoloManager.getFascicoloById(idOggetto, this._infoUtente);

                trasmissione.infoFascicolo = new DocsPaVO.fascicolazione.InfoFascicolo(schedaFascicolo);
            }

            trasmissione.utente = BusinessLogic.Utenti.UserManager.getUtente(this._infoUtente.idPeople);
            trasmissione.ruolo  = BusinessLogic.Utenti.UserManager.getRuoloById(this._infoUtente.idCorrGlobali);

            return(trasmissione);
        }
Пример #12
0
 /// <summary>
 /// add massimo digregorio gestione protocollatore
 /// </summary>
 /// <param name="schedaDoc"></param>
 /// <param name="objRuolo"></param>
 /// <param name="objUtente"></param>
 /// <returns></returns>
 internal static DocsPaVO.documento.SchedaDocumento getDatiProtocollatore(DocsPaVO.documento.SchedaDocumento schedaDoc, DocsPaVO.utente.Ruolo objRuolo, DocsPaVO.utente.InfoUtente objUtente)
 {
     if (schedaDoc.protocollatore == null || schedaDoc.protocollatore.utente_idPeople.Equals(String.Empty))
     {
         schedaDoc.protocollatore = new DocsPaVO.documento.Protocollatore(objUtente, objRuolo);
     }
     return(schedaDoc);
 }
Пример #13
0
 internal static DocsPaVO.documento.SchedaDocumento getDatiCreatore(DocsPaVO.documento.SchedaDocumento schedaDoc, DocsPaVO.utente.Ruolo objRuolo, DocsPaVO.utente.InfoUtente objUtente)
 {
     if (schedaDoc.creatoreDocumento == null || schedaDoc.creatoreDocumento.idPeople.Equals(String.Empty))
     {
         schedaDoc.creatoreDocumento = new DocsPaVO.documento.CreatoreDocumento(objUtente, objRuolo);
     }
     return(schedaDoc);
 }
Пример #14
0
        /// <summary>
        /// Reperimento trasmissione corrente
        /// </summary>
        /// <param name="idTrasmissione"></param>
        /// <returns></returns>
        protected virtual DocsPaVO.trasmissione.Trasmissione GetTrasmissione(string idTrasmissione,
                                                                             string idOggetto,
                                                                             DocsPaVO.trasmissione.TipoOggetto tipoOggetto)
        {
            DocsPaVO.trasmissione.Trasmissione retValue = null;

            if (!string.IsNullOrEmpty(idTrasmissione))
            {
                // Reperimento oggetto trasmissione
                DocsPaVO.trasmissione.OggettoTrasm oggettoTrasm = new DocsPaVO.trasmissione.OggettoTrasm();

                if (tipoOggetto == DocsPaVO.trasmissione.TipoOggetto.DOCUMENTO)
                {
                    DocsPaVO.documento.SchedaDocumento schedaDocumento = BusinessLogic.Documenti.DocManager.getDettaglio(this._infoUtente, idOggetto, idOggetto);

                    oggettoTrasm.infoDocumento = new DocsPaVO.documento.InfoDocumento(schedaDocumento);
                }
                else if (tipoOggetto == DocsPaVO.trasmissione.TipoOggetto.FASCICOLO)
                {
                    DocsPaVO.fascicolazione.Fascicolo schedaFascicolo = BusinessLogic.Fascicoli.FascicoloManager.getFascicoloById(idOggetto, this._infoUtente);

                    oggettoTrasm.infoFascicolo = new DocsPaVO.fascicolazione.InfoFascicolo(schedaFascicolo);
                }

                System.Collections.Generic.List <DocsPaVO.filtri.FiltroRicerca> filters = new System.Collections.Generic.List <DocsPaVO.filtri.FiltroRicerca>();
                DocsPaVO.filtri.FiltroRicerca item = new DocsPaVO.filtri.FiltroRicerca();
                item.argomento = DocsPaVO.filtri.trasmissione.listaArgomentiNascosti.ID_TRASMISSIONE.ToString();
                item.valore    = idTrasmissione;
                filters.Add(item);

                DocsPaVO.utente.Utente utente = BusinessLogic.Utenti.UserManager.getUtente(this._infoUtente.idPeople);
                DocsPaVO.utente.Ruolo  ruolo  = BusinessLogic.Utenti.UserManager.getRuoloById(this._infoUtente.idCorrGlobali);

                // Utilizzo del metodo di ricerca trasmissioni fornendo i filtri di ricerca
                int totalPageNumber;
                int recordCount;

                DocsPaVO.trasmissione.Trasmissione[] trasmissioni =
                    (DocsPaVO.trasmissione.Trasmissione[])
                    BusinessLogic.Trasmissioni.QueryTrasmManager.getQueryEffettuateDocMethodPaging(
                        oggettoTrasm,
                        utente,
                        ruolo,
                        filters.ToArray(),
                        1,
                        out totalPageNumber,
                        out recordCount).ToArray(typeof(DocsPaVO.trasmissione.Trasmissione));

                if (trasmissioni.Length == 1)
                {
                    // Reperimento prima trasmissione estratta
                    retValue = trasmissioni[0];
                }
            }

            return(retValue);
        }
Пример #15
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="schedaDoc"></param>
 /// <param name="mailAddress"></param>
 /// <param name="destinatari"></param>
 /// <param name="infoUtente"></param>
 /// <param name="confermaRic"></param>
 /// <returns></returns>
 public static DocsPaVO.Interoperabilita.SendDocumentResponse spedisci(
     DocsPaVO.documento.SchedaDocumento schedaDoc,
     string mailAddress,
     ArrayList destinatari,
     DocsPaVO.utente.InfoUtente infoUtente,
     bool confermaRic)
 {
     return(spedisci(schedaDoc, null, mailAddress, destinatari, infoUtente, confermaRic));
 }
Пример #16
0
        /// <summary>
        /// Metodo per la spedizione di un documento per interoperabilità semplificata
        /// </summary>
        /// <param name="schedaDoc">Documento da spedire</param>
        /// <param name="infoUtente">Informazioni sull'utente che sta effettuando la spedizione</param>
        /// <param name="receivers">Destinatari cui indirizzare la spedizione</param>
        /// <returns>Risultato della spedizione</returns>
        public static DocsPaVO.Interoperabilita.SendDocumentResponse SpedisciPerInteroperabilitaSemplificata(
            DocsPaVO.documento.SchedaDocumento schedaDoc,
            DocsPaVO.utente.InfoUtente infoUtente,
            IEnumerable <DocsPaVO.Spedizione.DestinatarioEsterno> receivers)
        {
            // Oggetto contenente l'esito della spedizione del documento ai destinatari.
            // Per ognuno di essi, nella tabella "DPA_STATO_INVIO",
            // deve essere impostata correttamente la data di spedizione; per gli
            // altri viene impostata a null;
            DocsPaVO.Interoperabilita.SendDocumentResponse sendDocumentResponse = null;
            //try
            //{
            //    InsertStatoInvioISPreliminare(schedaDoc, receivers);
            //}
            //catch (Exception e1)
            //{
            //    logger.Error("Errore nell'inserimento preliminare dei destinatari nella DPA_STATO_INVIO", e1);
            //}

            try
            {
                DocsPaVO.utente.Corrispondente mittente = BusinessLogic.Utenti.UserManager.getCorrispondente(infoUtente.idCorrGlobali, false);

                DocsPaVO.utente.Ruolo ruoloMitt = (DocsPaVO.utente.Ruolo)mittente;
                mittente.descrizione = ruoloMitt.descrizione;

                // Invio del documento a tutti i destinatari
                sendDocumentResponse = BusinessLogic.Interoperabilità.InteroperabilitaInvioSegnatura.SendDocumentIS(schedaDoc, infoUtente, receivers);
            }
            catch (Exception e)
            {
                logger.Error("Errore nella richiesta di interoperabilità semplificata", e);

                throw new Exception("Si è verificato un errore durante l'invio della richiesta di interoperabilità: " + e.Message);
            }

            //try
            //{
            //    List<DocsPaVO.utente.Corrispondente> c = new List<DocsPaVO.utente.Corrispondente>();
            //    foreach (DocsPaVO.Spedizione.DestinatarioEsterno de in receivers)
            //        c.AddRange(de.DatiDestinatari);

            //    InsertStatoInvioDestinatari(schedaDoc, new ArrayList(c), sendDocumentResponse);

            //    BusinessLogic.interoperabilita.Semplificata.InteroperabilitaSemplificataManager.IS_statusMaskUpdater(schedaDoc.systemId);
            //}
            //catch (Exception e)
            //{
            //    logger.Error("Errore nella gestione della spedizione", e);

            //    throw new Exception("Errore nella gestione della spedizione:\\n\\n" + e.Message);
            //}

            return(sendDocumentResponse);
        }
Пример #17
0
        /// <summary>
        /// Reperimento oggetto scheda documento
        /// </summary>
        /// <param name="infoUtente"></param>
        /// <param name="docNumber"></param>
        /// <returns></returns>
        public static DocsPaVO.documento.SchedaDocumento GetSchedaDocumento(DocsPaVO.utente.InfoUtente infoUtente, string docNumber)
        {
            DocsPaVO.documento.SchedaDocumento schedaDocumento = BusinessLogic.Documenti.DocManager.getDettaglio(infoUtente, docNumber, docNumber);

            if (schedaDocumento == null)
            {
                throw new ApplicationException(string.Format("Documento con id {0} non trovato", docNumber));
            }

            return(schedaDocumento);
        }
Пример #18
0
        private static DocsPaVO.trasmissione.Trasmissione ExecuteTransmission(DocsPaVO.documento.SchedaDocumento schedaDoc, string idGruppoDest, string idPeopleDest, DocsPaVO.utente.InfoUtente infoUtente)
        {
            DocsPaVO.trasmissione.Trasmissione trasm = new DocsPaVO.trasmissione.Trasmissione();

            DocsPaDB.Query_DocsPAWS.Utenti u = new DocsPaDB.Query_DocsPAWS.Utenti();

            trasm.ruolo  = u.GetRuoloByIdGruppo(infoUtente.idGruppo); //istanzaProcesso.RuoloProponente;
            trasm.utente = u.getUtenteById(infoUtente.idPeople);      //istanzaProcesso.UtenteProponente;
            DocsPaDB.Query_DocsPAWS.Documenti doc = new DocsPaDB.Query_DocsPAWS.Documenti();

            trasm.infoDocumento = schedaDoc.InfoDocumento;

            //INSERISCO LA RAGIONE DI TRASMISSIONE DI SISTEMA PER LIBRO FIRMA
            DocsPaVO.trasmissione.RagioneTrasmissione ragione = getRagioneTrasm(infoUtente.idAmministrazione, "D");

            //CREO LA TRASMISSIONE SINGOLA
            DocsPaVO.trasmissione.TrasmissioneSingola trasmSing = new DocsPaVO.trasmissione.TrasmissioneSingola();
            trasmSing.ragione   = ragione;
            trasmSing.tipoTrasm = "S";


            DocsPaDB.Query_DocsPAWS.Utenti utenti = new DocsPaDB.Query_DocsPAWS.Utenti();
            DocsPaVO.utente.Ruolo          ruolo  = utenti.GetRuoloByIdGruppo(idGruppoDest);
            trasmSing.corrispondenteInterno = ruolo;
            trasmSing.tipoDest = DocsPaVO.trasmissione.TipoDestinatario.RUOLO;

            System.Collections.ArrayList             listaUtenti = new System.Collections.ArrayList();
            DocsPaVO.addressbook.QueryCorrispondente qc          = new DocsPaVO.addressbook.QueryCorrispondente();
            qc.codiceRubrica = ruolo.codiceRubrica;
            System.Collections.ArrayList registri = ruolo.registri;
            qc.tipoUtente = DocsPaVO.addressbook.TipoUtente.INTERNO;
            //qc.idRegistri = registri;
            qc.idAmministrazione = ruolo.idAmministrazione;
            qc.getChildren       = true;
            qc.fineValidita      = true;
            listaUtenti          = BusinessLogic.Utenti.addressBookManager.listaCorrispondentiIntMethod(qc);
            System.Collections.ArrayList trasmissioniUt = new System.Collections.ArrayList();

            for (int k = 0; k < listaUtenti.Count; k++)
            {
                DocsPaVO.trasmissione.TrasmissioneUtente trUt = new DocsPaVO.trasmissione.TrasmissioneUtente();
                trUt.utente       = (DocsPaVO.utente.Utente)listaUtenti[k];
                trUt.daNotificare = (listaUtenti[k] as DocsPaVO.utente.Utente).idPeople.Equals(idPeopleDest);
                trasmissioniUt.Add(trUt);
            }

            trasmSing.trasmissioneUtente = trasmissioniUt;
            trasm.trasmissioniSingole    = new System.Collections.ArrayList()
            {
                trasmSing
            };
            return(BusinessLogic.Trasmissioni.ExecTrasmManager.saveExecuteTrasmMethod("", trasm));
        }
Пример #19
0
        public DocsPaVO.documento.FileDocumento[] outFileRequest(string userName, string pass, string codRuolo, string[] idDocNumber)
        {
            List <DocsPaVO.documento.FileDocumento> lista = new List <DocsPaVO.documento.FileDocumento>();

            DocsPaVO.utente.UserLogin user = new DocsPaVO.utente.UserLogin();
            user.UserName = userName;
            user.Password = pass;
            DocsPaVO.utente.UserLogin.LoginResult result;
            string ipaddress = string.Empty;

            DocsPaVO.utente.Utente utente = BusinessLogic.Utenti.Login.loginMethod(user, out result, true, null, out ipaddress);

            if (result == DocsPaVO.utente.UserLogin.LoginResult.OK)
            {
                DocsPaVO.utente.Ruolo ruolo = null;
                foreach (DocsPaVO.utente.Ruolo r in utente.ruoli)
                {
                    if (r.codiceRubrica.ToLower() == codRuolo.ToLower())
                    {
                        ruolo = r;
                        break;
                    }
                }


                if (ruolo != null)
                {
                    string token = GetToken(utente, ruolo);
                    DocsPaVO.utente.InfoUtente infoutente = null;
                    infoutente = getInfoUtenteFromToken(token);
                    DocsPaVO.documento.SchedaDocumento scheda = BusinessLogic.Documenti.DocManager.getDettaglio(infoutente, idDocNumber[0], idDocNumber[0]);


                    foreach (string docnumber in idDocNumber)
                    {
                        DocsPaVO.documento.FileDocumento   filedoc         = null;
                        DocsPaVO.documento.SchedaDocumento schedaDocumento = BusinessLogic.Documenti.DocManager.getDettaglio(infoutente, docnumber, docnumber);
                        for (int i = 0; i < scheda.documenti.Count; i++)
                        {
                            filedoc = BusinessLogic.Documenti.FileManager.getFile((DocsPaVO.documento.FileRequest)scheda.documenti[i], infoutente);
                            lista.Add(filedoc);
                        }

                        for (int i = 0; i < scheda.allegati.Count; i++)
                        {
                            filedoc = BusinessLogic.Documenti.FileManager.getFile((DocsPaVO.documento.FileRequest)scheda.allegati[i], infoutente);
                            lista.Add(filedoc);
                        }
                    }
                }
            }
            return(lista.ToArray());
        }
Пример #20
0
        /// <summary>
        /// Reperimento della scheda documento
        /// </summary>
        /// <param name="infoUtente"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        private static DocsPaVO.documento.SchedaDocumento GetDocument(DocsPaVO.utente.InfoUtente infoUtente, string id)
        {
            // Reperimento scheda documento
            DocsPaVO.documento.SchedaDocumento document = BusinessLogic.Documenti.DocManager.getDettaglio(infoUtente, id, id);

            if (document == null)
            {
                throw new ApplicationException(string.Format("Nessun documento trovato con id {0}", id));
            }

            return(document);
        }
Пример #21
0
        /// <summary>
        /// Invio del documento ad un singolo indirizzo mail,
        /// cui possono corrispondere 1 o più destinatari
        /// </summary>
        /// <param name="schedaDoc"></param>
        /// <param name="mailAddress"></param>
        /// <param name="infoUtente"></param>
        /// <param name="confermaRic"></param>
        /// <returns></returns>
        public static DocsPaVO.Interoperabilita.SendDocumentResponse spedisci(
            DocsPaVO.documento.SchedaDocumento schedaDoc,
            string mailAddress,
            DocsPaVO.utente.InfoUtente infoUtente,
            bool confermaRic)
        {
            ArrayList listDestinatari = new ArrayList();

            FillListDestinatari(listDestinatari, mailAddress, (((DocsPaVO.documento.ProtocolloUscita)schedaDoc.protocollo).destinatari));
            FillListDestinatari(listDestinatari, mailAddress, (((DocsPaVO.documento.ProtocolloUscita)schedaDoc.protocollo).destinatariConoscenza));

            return(spedisci(schedaDoc, mailAddress, listDestinatari, infoUtente, confermaRic));
        }
Пример #22
0
            /// <summary>
            ///
            /// </summary>
            /// <param name="id"></param>
            /// <returns></returns>
            public static DocsPaVO.documento.SchedaDocumento GetDocument(LogInfo logInfo)
            {
                DocsPaVO.utente.InfoUtente userInfo = Security.ImpersonateUser(logInfo);

                DocsPaVO.documento.SchedaDocumento document = BusinessLogic.Documenti.DocManager.getDettaglioNoSecurity(userInfo, logInfo.ObjectId.ToString());

                if (document != null && document.template == null)
                {
                    document.template = BusinessLogic.ProfilazioneDinamica.ProfilazioneDocumenti.getTemplate(document.systemId);
                }

                return(document);
            }
Пример #23
0
        public void addDocFolder(DocsPaVO.documento.SchedaDocumento schedaDoc, string idProfile, string idFolder)
        {
            DocsPaDB.DBProvider DB = null;
            try
            {
                DB = new DocsPaDB.DBProvider();
                #region CODICE docspa2.0
//			string queryString =
//				"SELECT COUNT (*) FROM PROJECT_COMPONENTS WHERE PROJECT_ID=" + idFolder +
//				" AND LINK=" + idProfile;
//			DocsPaUtils.Query q=new DocsPaUtils.Query(queryString);
//
//			string rows="";
//			if(!DB.ExecuteScalar(out rows,queryString))
//				throw new Exception("Errore nella Query "+queryString);
//
//		if(rows.Equals("0"))
//			throw new Exception("Il documento è già presente nel folder");
                #endregion
                bool classified = isClassified(idProfile, DB);



                // questa controllo mi serve perchè solo se è la prima fasc del doc finisce in as400.

                if (!classified)
                {
                    DB.BeginTransaction();
                    ArrayList queries = getInsertQueries(DocsPaAS400.Constants.CREATE_MODIFY_OPERATION, schedaDoc, DB);

                    for (int i = 0; i < queries.Count; i++)
                    {
                        DB.ExecuteLockedNonQuery((string)queries[i]);
                    }
                    DB.CommitTransaction();
                }
            }
            catch (Exception e)
            {
                DB.RollbackTransaction();
                throw e;
            }
            finally
            {
                if (DB != null)
                {
                    DB.Dispose();
                }
            }
        }
Пример #24
0
        /// <summary>
        /// Restituisce la dimensione dell'equivalente file XML che rappresenta la serializzazione dell'oggetto
        /// passato come parametro
        /// </summary>
        /// <param name="schDoc">è l'oggetto scheda documento che dobbiamo serializzare</param>
        /// <returns></returns>
        public string serializeSchedaDoc(DocsPaVO.documento.SchedaDocumento schDoc)
        {
            string       metadati     = string.Empty;
            string       result       = "-1";
            MemoryStream memoryWriter = null;

            try
            {
                Metadati dati = new Metadati(schDoc);
                //Sostituisco al system_id il nome e cognome
                if (dati.protocollatore != null)
                {
                    if (!string.IsNullOrEmpty(dati.protocollatore.Nome_Cognome))
                    {
                        DocsPaConsManager cm = new DocsPaConsManager();
                        dati.protocollatore.Nome_Cognome = cm.getFullName(dati.protocollatore.Nome_Cognome);
                    }
                }
                if (dati.creatoreDocumento != null)
                {
                    if (!string.IsNullOrEmpty(dati.creatoreDocumento.Nome_Cognome))
                    {
                        DocsPaConsManager cm = new DocsPaConsManager();
                        dati.creatoreDocumento.Nome_Cognome = cm.getFullName(dati.creatoreDocumento.Nome_Cognome);
                    }
                }

                memoryWriter = new MemoryStream();
                XmlSerializer serializer = new XmlSerializer(typeof(Metadati));
                serializer.Serialize(memoryWriter, dati);

                //Devo tornare all'inizio del MemoryStream per leggerne il contenuto!!!
                memoryWriter.Seek(0, SeekOrigin.Begin);
                result   = memoryWriter.Length.ToString();
                metadati = new StreamReader(memoryWriter).ReadToEnd();
            }
            catch (Exception ex)
            {
                logger.Debug(ex.Message);
            }
            finally
            {
                if (memoryWriter != null)
                {
                    memoryWriter.Flush();
                    memoryWriter.Close();
                }
            }
            return(result);
        }
Пример #25
0
        private static DocsPaVO.documento.SchedaDocumento getDocumentoInUscitaByDocPredisposto(DocsPaVO.utente.InfoUtente infoUtente, DocsPaVO.documento.SchedaDocumento schedaDoc)
        {
            logger.Debug("getDocumentoInUscitaByDocPredisposto");
            DataSet ds;

            DocsPaVO.documento.SchedaDocumento sd = new DocsPaVO.documento.SchedaDocumento();
            try
            {
                DocsPaDB.Query_DocsPAWS.Interoperabilita obj = new DocsPaDB.Query_DocsPAWS.Interoperabilita();
                string      sep       = DocsPaDB.Utils.Personalization.getInstance(schedaDoc.registro.idAmministrazione).getSepSegnatura();
                string[]    protoMitt = ((DocsPaVO.documento.ProtocolloEntrata)(schedaDoc.protocollo)).descrizioneProtocolloMittente.Split(sep.ToCharArray(), 2);
                CultureInfo ci        = new CultureInfo("it-IT");
                string[]    formati   = { "dd/MM/yyyy", "yyyy-MM-dd", "DD/MM/YYYY hh:mm:ss", "DD/MM/YYYY hh.mm.ss", "DD/MM/YYYY HH.mm.ss", "DD/MM/YYYY HH:mm:ss" };

                DateTime dataRegistrazione = DateTime.ParseExact(((DocsPaVO.documento.ProtocolloEntrata)(schedaDoc.protocollo)).dataProtocolloMittente, formati, ci.DateTimeFormat, DateTimeStyles.AllowWhiteSpaces);


                if (protoMitt != null && protoMitt.Length > 1)
                {
                    string regProto = protoMitt[0];
                    string numProto = protoMitt[1];
                    int    anno     = dataRegistrazione.Year;

                    DocsPaDB.Query_DocsPAWS.Interoperabilita interop = new DocsPaDB.Query_DocsPAWS.Interoperabilita();
                    DocsPaDB.Query_DocsPAWS.Documenti        doc     = new DocsPaDB.Query_DocsPAWS.Documenti();

                    interop.getIdProtocolloUscitaOriginario(out ds, numProto, regProto, anno);

                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        DataRow row       = ds.Tables["PROTOUSCITA"].Rows[0];
                        string  docNumber = row["DOCNUMBER"].ToString();

                        if (docNumber != null && docNumber != "")
                        {
                            sd = doc.GetSchedaDocumentoByID(infoUtente, docNumber);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                logger.Error(e.ToString());

                logger.Error("Errore nella gestione dell'interoperabilità. (getDocumentoInUscitaByDocPredisposto", e);
                throw e;
            }
            return(sd);
        }
Пример #26
0
        /// <summary>
        /// Reperimento della scheda documento
        /// </summary>
        /// <param name="infoUtente"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        protected override DocsPaVO.documento.SchedaDocumento GetDocument(DocsPaVO.utente.InfoUtente infoUtente, string id)
        {
            // Reperimento scheda documento
            DocsPaVO.documento.SchedaDocumento document = base.GetDocument(infoUtente, id);

            int accessRights;

            Int32.TryParse(document.accessRights, out accessRights);
            if (accessRights <= 45)
            {
                throw new ApplicationException("Il documento è in sola lettura, impossibile elaborare il modello");
            }

            return(document);
        }
Пример #27
0
        private DocsPaVO.documento.SchedaDocumento GetSchedaDocumentoMobile(DocsPaVO.utente.InfoUtente infoUtente, DataRow dataRow)
        {
            DocsPaVO.documento.SchedaDocumento schedaDoc = new DocsPaVO.documento.SchedaDocumento();

            if (!GetProfiloMobile(infoUtente, dataRow, ref schedaDoc))
            {
                schedaDoc = null;
            }
            if (schedaDoc != null && !string.IsNullOrEmpty((dataRow["ID_DOCUMENTO_PRINCIPALE"]).ToString()))
            {
                Documenti querydocs = new Documenti();
                schedaDoc.documentoPrincipale = querydocs.GetInfoDocumento(infoUtente.idGruppo, infoUtente.idPeople, dataRow["ID_DOCUMENTO_PRINCIPALE"].ToString(), false);
            }
            return(schedaDoc);
        }
Пример #28
0
 protected static DocsPaVO.documento.SchedaDocumento setFusionFields(DocsPaVO.documento.SchedaDocumento schedaDocumento, DocsPaVO.utente.InfoUtente infoUtente)
 {
     // campi obbligatori per DocsFusion
     schedaDocumento.idPeople = infoUtente.idPeople;
     schedaDocumento.userId   = infoUtente.userId;
     if (schedaDocumento.typeId == null)
     {
         schedaDocumento.typeId = "LETTERA";
     }
     if (schedaDocumento.appId == null)
     {
         schedaDocumento.appId = "ACROBAT";
     }
     return(schedaDocumento);
 }
Пример #29
0
        public static string getDataProtMitt(DocsPaVO.documento.SchedaDocumento schedaDoc)
        {
            string res = "";

            if (schedaDoc.protocollo.GetType().Equals(typeof(DocsPaVO.documento.ProtocolloEntrata)))
            {
                DocsPaVO.documento.ProtocolloEntrata pe = (DocsPaVO.documento.ProtocolloEntrata)schedaDoc.protocollo;
                res = getDate(pe.dataProtocolloMittente);
            }
            else
            {
                res = "";
            }
            return(res);
        }
Пример #30
0
 private static void inserisciOggetto(DocsPaVO.documento.SchedaDocumento schedaDocumento, XmlDocument xmlDoc)
 {
     try
     {
         if (xmlDoc.SelectSingleNode("//_oggetto_") != null /*&& string.IsNullOrEmpty(schedaDocumento.oggetto.descrizione)*/)
         {
             schedaDocumento.oggetto.descrizione = xmlDoc.SelectSingleNode("//_oggetto_").InnerText;
         }
     }
     catch (Exception e)
     {
         logger.Debug("Errore in LiveCycle  - DocumentiManager - metodo: inserisciOggetto()", e);
         throw new Exception(e.Message);
     }
 }