Beispiel #1
0
        private static void AcquireFileAndAllegato(AttestatoVO att, SchedaDocumento sd, InfoUtente userInfo)
        {
            Templates temp = ProfilazioneDocumenti.getTemplateById(att.IdTemplate);
            string    path = temp.PATH_MODELLO_1;

            byte[] content = GetFileContent(path);
            // Creazione dell'oggetto fileDocumento
            FileDocumento fileDocumento = new FileDocumento();

            fileDocumento.name           = Path.GetFileName(sd.systemId + ".rtf");
            fileDocumento.fullName       = sd.systemId + ".rtf";
            fileDocumento.estensioneFile = "rtf";
            fileDocumento.length         = content.Length;
            fileDocumento.content        = content;
            FileRequest fileRequest = (FileRequest)sd.documenti[0];

            try
            {
                FileManager.putFile(fileRequest, fileDocumento, userInfo);
            }
            catch (Exception e)
            {
                throw new Exception("Errore durante l'upload del file.");
            }
            FileDocumento fileAll = new FileDocumento();

            fileAll.name           = Path.GetFileName(att.FileName);
            fileAll.fullName       = att.FileName;
            fileAll.estensioneFile = att.FileName.Substring(att.FileName.LastIndexOf(".") + 1);
            fileAll.length         = content.Length;
            fileAll.content        = att.Content;
            FileRequest allRequest = (FileRequest)sd.allegati[0];

            FileManager.putFile(allRequest, fileAll, userInfo);
        }
Beispiel #2
0
        /// <summary>
        /// Metodo per il cambio dello stato di un repertorio
        /// </summary>
        /// <param name="counterId"></param>
        /// <param name="registryId"></param>
        /// <param name="rfId"></param>
        /// <param name="idAmm"></param>
        /// <returns></returns>
        public static bool ChangeRepertorioState(String counterId, String registryId, String rfId, String idAmm)
        {
            bool retVal = true;

            DocsPaDB.Query_DocsPAWS.RegistriRepertorioPrintManager manager = new DocsPaDB.Query_DocsPAWS.RegistriRepertorioPrintManager();

            //String lastPrintedNumber, lastNumberToPrint;
            // Recupero dello stato attuale del contatore
            RegistroRepertorioSingleSettings.RepertorioState state = manager.GetState(counterId, registryId, rfId);//, out lastPrintedNumber, out lastNumberToPrint);

            // Recupero dell'id della tipologia associata al contatore
            String tipology = manager.GetCounterTypology(counterId);

            // Cambio dello stato
            if (state == RegistroRepertorioSingleSettings.RepertorioState.O)
            {
                state = RegistroRepertorioSingleSettings.RepertorioState.C;
            }
            else
            {
                state = RegistroRepertorioSingleSettings.RepertorioState.O;
            }

            // Salvataggio del nuovo stato e sospensione / attivazione della tipologia
            Templates template = new Templates()
            {
                SYSTEM_ID = Convert.ToInt32(tipology)
            };

            using (DocsPaDB.TransactionContext transactionContext = new DocsPaDB.TransactionContext())
            {
                // Salvataggio nuovo stato del registro
                retVal = manager.SaveCounterState(counterId, rfId, registryId, state);

                // Abilitazione / disabilitazione tipologia
                if (state == RegistroRepertorioSingleSettings.RepertorioState.O)
                {
                    template.IN_ESERCIZIO = "NO";
                }
                else
                {
                    template.IN_ESERCIZIO = "SI";
                }

                ProfilazioneDocumenti.messaInEsercizioTemplate(template, idAmm);

                transactionContext.Complete();
            }

            return(retVal);
        }
Beispiel #3
0
 public InteropSchedaDocHandler(InteropCreazioneDocRequest request)
 {
     try
     {
         _template = ProfilazioneDocumenti.getTemplateById(request.StatusTemplate.IdTemplate);
         logger.Debug("template " + _template.DESCRIZIONE + " trovato");
         OggettoCustom oc = _template.ELENCO_OGGETTI.Cast <OggettoCustom>().Single(e => request.StatusTemplate.StatusTemplateFieldName.Equals(e.DESCRIZIONE));
         logger.Debug("Oggetto custom trovato " + oc.DESCRIZIONE);
         oc.VALORE_DATABASE = request.StatusTemplate.StatusNotProcessedValue;
         _processor         = new MailProcessor(request.FiltriMail);
     }
     catch (Exception e)
     {
         logger.Debug("Errore nella costruzione del template: " + e.Message);
     }
 }
Beispiel #4
0
        private static SchedaDocumento CreateSchedaDocumentoFromAttestato(AttestatoVO att, InfoUtente infoUtente, Ruolo ruolo, string idRegistro)
        {
            SchedaDocumento sd  = DocManager.NewSchedaDocumento(infoUtente);
            Oggetto         ogg = new Oggetto();

            ogg.idRegistro  = idRegistro;
            ogg.descrizione = att.Oggetto;
            sd.oggetto      = ogg;
            // Impostazione del registro
            sd.registro = RegistriManager.getRegistro(idRegistro);
            // Impostazione del tipo atto
            sd.tipoProto                 = "";
            sd.template                  = ProfilazioneDocumenti.getTemplateById(att.IdTemplate);
            sd.tipologiaAtto             = new TipologiaAtto();
            sd.tipologiaAtto.descrizione = sd.template.DESCRIZIONE;
            sd.tipologiaAtto.systemId    = sd.template.SYSTEM_ID.ToString();
            sd.daAggiornareTipoAtto      = true;
            sd = DocSave.addDocGrigia(sd, infoUtente, ruolo);
            Allegato all = new Allegato();

            all.descrizione = "ALL1";
            all.docNumber   = sd.docNumber;
            all.version     = "0";
            string idPeopleDelegato = "0";

            if (infoUtente.delegato != null)
            {
                idPeopleDelegato = infoUtente.delegato.idPeople;
            }
            all.idPeopleDelegato = idPeopleDelegato;

            // Impostazione del repositoryContext associato al documento
            all.repositoryContext = sd.repositoryContext;
            all.position          = 1;
            Allegato resAll = AllegatiManager.aggiungiAllegato(infoUtente, all);

            sd.allegati = new ArrayList();
            sd.allegati.Add(resAll);
            return(sd);
        }