Beispiel #1
0
        internal static DocsPaVO.documento.SchedaDocumento creaSchedaDocumento(DocsPaVO.documento.ProtocolloEmergenza protoEmergenza, DocsPaVO.utente.InfoUtente infoUtente, DocsPaVO.utente.Ruolo ruolo)
        {
            DocsPaVO.documento.SchedaDocumento schedaDocumento = new DocsPaVO.documento.SchedaDocumento();
            schedaDocumento           = setFusionFields(schedaDocumento, infoUtente);
            schedaDocumento.tipoProto = protoEmergenza.tipoProtocollo;
            //registro
            DocsPaVO.utente.Registro registro;
            registro = Utenti.RegistriManager.getRegistro(protoEmergenza.idRegistro);
            schedaDocumento.registro = registro;
            logger.Debug("data apertura: " + registro.dataApertura);
            logger.Debug("data chiusura: " + registro.dataChiusura);
            logger.Debug("data ultimo prot: " + registro.dataUltimoProtocollo);

            //oggetto
            schedaDocumento.oggetto             = new DocsPaVO.documento.Oggetto();
            schedaDocumento.oggetto.descrizione = protoEmergenza.oggetto;
            //protocollo
            if (schedaDocumento.tipoProto.Equals("A"))
            {
                schedaDocumento = setProtoArrivo(schedaDocumento, protoEmergenza);
            }
            else if (schedaDocumento.tipoProto.Equals("P"))
            {
                schedaDocumento = setProtoPartenza(schedaDocumento, protoEmergenza);
            }
            else if (schedaDocumento.tipoProto.Equals("I"))
            {
                schedaDocumento = setProtoInterno(schedaDocumento, protoEmergenza);
            }

            //protocollo emergenza
            schedaDocumento.datiEmergenza = new DocsPaVO.documento.DatiEmergenza();
            schedaDocumento.datiEmergenza.dataProtocollazioneEmergenza = protoEmergenza.dataProtocollazione;
            schedaDocumento.datiEmergenza.protocolloEmergenza          = protoEmergenza.numero;
            //schedaDocumento.datiEmergenza.cognomeProtocollatoreEmergenza = ...?;?
            //schedaDocumento.datiEmergenza.nomeProtocollatoreEmergenza = ...?;
            schedaDocumento.datiEmergenza = new DocsPaVO.documento.DatiEmergenza();
            schedaDocumento.datiEmergenza.dataProtocollazioneEmergenza = protoEmergenza.dataProtocollazione;
            schedaDocumento.datiEmergenza.protocolloEmergenza          = protoEmergenza.numero;
            //schedaDocumento.protocollo.datiEmergenza.cognomeProtocollatoreEmergenza = ...?;
            //schedaDocumento.protocollo.datiEmergenza.nomeProtocollatoreEmergenza = ...?;
            return(schedaDocumento);
        }
Beispiel #2
0
        //questo metodo crea un documento protocollato su docsPa a partire da un protocollo di emergenza
        public static DocsPaVO.documento.resultProtoEmergenza importaProtoEmergenza(DocsPaVO.documento.ProtocolloEmergenza protoEmergenza, DocsPaVO.utente.InfoUtente infoUtente)
        {
            DocsPaVO.documento.resultProtoEmergenza res = new DocsPaVO.documento.resultProtoEmergenza();

            try
            {
                DocsPaVO.utente.Ruolo ruolo = Utenti.UserManager.getRuolo(infoUtente.idCorrGlobali);
                DocsPaVO.documento.SchedaDocumento schedaDocumento;
                logger.Debug("add protocollo Emergenza");
                //si costruisce l'oggetto schedaDocumento
                schedaDocumento = creaSchedaDocumento(protoEmergenza, infoUtente, ruolo);
                //si protocolla
                DocsPaVO.documento.ResultProtocollazione risultatoProtocollazione;
                schedaDocumento = ProtoManager.protocolla(schedaDocumento, ruolo, infoUtente, out risultatoProtocollazione);
                if (schedaDocumento != null)
                {
                    res.isProtocollato = true;
                }

                //si classifica il documento
                classificaDocumento(schedaDocumento, protoEmergenza.codiceClassifica, ref res, infoUtente, ruolo);

                //eventualmente si annulla il documento
                if (protoEmergenza.dataAnnullamento != null && !protoEmergenza.dataAnnullamento.Equals(""))
                {
                    annullaProtocollo(schedaDocumento, protoEmergenza, ref res, infoUtente);
                }
                else
                {
                    //si trasmette il documento
                    trasmettiDocumento(schedaDocumento, protoEmergenza.templateTrasmissione, ref res, infoUtente, ruolo, protoEmergenza.idRegistro);
                }
            }
            catch (Exception e)
            {
                res.messaggio = res.messaggio + " - " + e.Message;
                logger.Debug(e.ToString());
                return(res);
            }
            return(res);
        }
Beispiel #3
0
        internal static DocsPaVO.documento.SchedaDocumento setProtoArrivo(DocsPaVO.documento.SchedaDocumento schedaDocumento, DocsPaVO.documento.ProtocolloEmergenza protoEmergenza)
        {
            DocsPaVO.documento.ProtocolloEntrata proto = new DocsPaVO.documento.ProtocolloEntrata();
            //proto.daProtocollare = "1";
            if (protoEmergenza.dataProtocolloMittente != null &&
                protoEmergenza.dataProtocolloMittente != "")
            {
                protoEmergenza.dataProtocolloMittente = protoEmergenza.dataProtocolloMittente.Trim();
                if (protoEmergenza.dataProtocolloMittente.Length < 10)
                {
                    //anno di 2 cifre, non va su docspa:
                    DateTime d = new DateTime();
                    d = System.Convert.ToDateTime(protoEmergenza.dataProtocolloMittente);
                    string day   = d.Day.ToString();
                    string month = d.Month.ToString();
                    if (day != null && day.Length == 1)
                    {
                        day = "0" + day;
                    }
                    if (month != null && month.Length == 1)
                    {
                        month = "0" + month;
                    }
                    protoEmergenza.dataProtocolloMittente = day + "/" + month + "/" + d.Year.ToString();
                }
            }
            proto.dataProtocolloMittente        = protoEmergenza.dataProtocolloMittente;
            proto.descrizioneProtocolloMittente = protoEmergenza.numeroProtocolloMittente;

            //mittente
            DocsPaVO.utente.Corrispondente mittente = new DocsPaVO.utente.Corrispondente();
            mittente.descrizione       = protoEmergenza.mittenti[0].ToString();
            proto.mittente             = mittente;
            schedaDocumento.protocollo = proto;

            return(schedaDocumento);
        }
Beispiel #4
0
 internal static void annullaProtocollo(DocsPaVO.documento.SchedaDocumento schedaDocumento, DocsPaVO.documento.ProtocolloEmergenza protoEme, ref DocsPaVO.documento.resultProtoEmergenza res, DocsPaVO.utente.InfoUtente infoUtente)
 {
     try
     {
         DocsPaVO.documento.ProtocolloAnnullato protocolloAnnullato = new DocsPaVO.documento.ProtocolloAnnullato();
         //DocsPaVO.documento.InfoDocumento infoDocumento = Documenti.Protocollo.getInfoDocumento(schedaDocumento);
         protocolloAnnullato.dataAnnullamento = protoEme.dataAnnullamento;
         protocolloAnnullato.autorizzazione   = protoEme.noteAnnullamento;
         res.isAnnullato = ProtoManager.annullaProtocollo(infoUtente, ref schedaDocumento, protocolloAnnullato);
     }
     catch (Exception e)
     {
         res.messaggio = res.messaggio + " - " + e.Message;
         logger.Debug(e.ToString());
     }
 }
Beispiel #5
0
        internal static DocsPaVO.documento.SchedaDocumento setProtoInterno(DocsPaVO.documento.SchedaDocumento schedaDocumento, DocsPaVO.documento.ProtocolloEmergenza protoEmergenza)
        {
            DocsPaVO.documento.ProtocolloInterno proto = new DocsPaVO.documento.ProtocolloInterno();
            //proto.daProtocollare = "1";
            //destinatari
            proto.destinatari = new ArrayList(protoEmergenza.destinatari.Count);
            for (int i = 0; i < protoEmergenza.destinatari.Count; i++)
            {
                DocsPaVO.utente.Corrispondente corr = new DocsPaVO.utente.Corrispondente();
                corr.descrizione = protoEmergenza.destinatari[i].ToString();

                proto.destinatari.Add(corr);
            }
            //destinatariCC
            proto.destinatariConoscenza = new ArrayList(protoEmergenza.destinatariCC.Count);
            for (int j = 0; j < protoEmergenza.destinatariCC.Count; j++)
            {
                DocsPaVO.utente.Corrispondente corr = new DocsPaVO.utente.Corrispondente();
                corr.descrizione = protoEmergenza.destinatariCC[j].ToString();
                proto.destinatariConoscenza.Add(corr);
            }
            schedaDocumento.protocollo = proto;
            return(schedaDocumento);
        }
Beispiel #6
0
 public DocsPaVO.documento.resultProtoEmergenza documentoImportaProtocolloEmergenza(DocsPaVO.documento.ProtocolloEmergenza protoEmergenza, DocsPaVO.utente.InfoUtente infoUtente)
 {
     DocsPaVO.documento.resultProtoEmergenza res = null;
     try
     {
         res = BusinessLogic.Documenti.ProtocolloEmergenza.importaProtoEmergenza(protoEmergenza, infoUtente);
     }
     catch (Exception e)
     {
         logger.Error("RDE  - Errore durante l'importazione del Protocollo di Emergenza", e);
         return(res);
     }
     return(res);
 }