Esempio n. 1
0
 public Protocollatore(DocsPaVO.utente.InfoUtente utente, DocsPaVO.utente.Ruolo ruolo)
 {
     this.utente_idPeople      = utente.idPeople;
     this.ruolo_idCorrGlobali  = ruolo.systemId;
     this.uo_idCorrGlobali     = ruolo.uo.systemId;
     this.uo_codiceCorrGlobali = ruolo.uo.codice;             //VAR_CODICE della CORR_GLOBALI
 }
Esempio n. 2
0
        /// <summary>
        /// Metodo per la rimozione del task
        /// </summary>
        /// <param name="idTask"></param>
        /// <param name="infoUtente"></param>
        /// <returns></returns>
        public bool RimuoviTask(string idTask, DocsPaVO.utente.InfoUtente infoUtente)
        {
            logger.Debug("Inizio Metodo RimuoviTask in DocsPaDb.Query_DocsPAWS.Task");
            bool result = false;

            try
            {
                DocsPaUtils.Query q = DocsPaUtils.InitQuery.getInstance().getQuery("D_DPA_TASK");
                q.setParam("idTask", idTask);

                string query = q.getSQL();
                logger.Debug("RimuoviTask: " + query);
                if (!ExecuteNonQuery(query))
                {
                    throw new Exception("Errore durante la rimozione del task: " + query);
                }
                else
                {
                    result = true;
                }
            }
            catch (Exception e)
            {
                logger.Error("Errore nel Metodo RimuoviTask in DocsPaDb.Query_DocsPAWS.Task : " + e.Message);
                result = false;
            }
            logger.Debug("FINE Metodo RimuoviTask in DocsPaDb.Query_DocsPAWS.Task");
            return(result);
        }
Esempio n. 3
0
        /// <summary>
        /// Caricamento dati per login
        /// </summary>
        /// <returns></returns>
        private bool Login()
        {
            bool result = true;             // Presume successo

            try
            {
                UserData userData = new UserData(true);
                GetUserData(ref userData, parser.DocumentElement.SelectSingleNode("DATI"));

                DocsPaVO.utente.UserLogin userLogin = new DocsPaVO.utente.UserLogin(userData.utente, userData.password, userData.idAmm, "");

                DocsPaVO.utente.Utente utente;
                DocsPaDocumentale.Documentale.UserManager userManager = new DocsPaDocumentale.Documentale.UserManager();
                DocsPaVO.utente.UserLogin.LoginResult     loginResult;
                userManager.LoginUser(userLogin, out utente, out loginResult);

                DocsPaVO.utente.Ruolo ruolo = new DocsPaVO.utente.Ruolo();

                this.infoUtente = new DocsPaVO.utente.InfoUtente(utente, ruolo);
            }
            catch (Exception exception)
            {
                logger.Debug("Errore durante la login.", exception);
                result = false;
            }

            return(result);
        }
Esempio n. 4
0
        public DocsPaVO.Task.Task GetTaskByTrasmSingola(string idTrasmSingola, DocsPaVO.utente.InfoUtente infoUtente)
        {
            logger.Debug("Inizio Metodo GetTaskByTrasmSingola in DocsPaDb.Query_DocsPAWS.Task");
            DocsPaVO.Task.Task task  = new DocsPaVO.Task.Task();
            string             query = string.Empty;

            DocsPaUtils.Query q;
            DataSet           ds = new DataSet();

            try
            {
                q = DocsPaUtils.InitQuery.getInstance().getQuery("S_DPA_TASK_BY_ID_TRASM_SINGOLA");
                q.setParam("idTrasmSingola", idTrasmSingola);
                query = q.getSQL();
                logger.Debug("GetTaskByTrasmSingola: " + query);
                if (this.ExecuteQuery(out ds, "task", query))
                {
                    if (ds.Tables["task"] != null && ds.Tables["task"].Rows.Count > 0)
                    {
                        task = BuildTask(ds.Tables["task"].Rows[0]);
                    }
                }
            }
            catch (Exception e)
            {
                logger.Error("Errore in GetTaskByTrasmSingola " + e.Message);
            }

            return(task);
        }
Esempio n. 5
0
        /// <summary>
        /// Associa il nuovo documento creato al task di origine
        /// </summary>
        /// <param name="idTask"></param>
        /// <param name="docnumber"></param>
        /// <param name="infoUtente"></param>
        /// <returns></returns>
        public bool AssociaContributoAlTask(string idTask, string docnumber, DocsPaVO.utente.InfoUtente infoUtente)
        {
            logger.Debug("Inizio Metodo AssociaContributoAlTask in DocsPaDb.Query_DocsPAWS.Task");
            bool result = false;

            try
            {
                DocsPaUtils.Query q = DocsPaUtils.InitQuery.getInstance().getQuery("U_DPA_TASK_ID_PROFILE_REVIEW");
                q.setParam("idTask", idTask);
                q.setParam("docnumber", docnumber);

                string query = q.getSQL();
                logger.Debug("AssociaContributoAlTask: " + query);
                if (!ExecuteNonQuery(query))
                {
                    throw new Exception("Errore durante l'associazione del documento al task: " + query);
                }
                else
                {
                    result = true;
                }
            }
            catch (Exception e)
            {
                logger.Error("Errore nel Metodo AssociaContributoAlTask in DocsPaDb.Query_DocsPAWS.Task : " + e.Message);
                result = false;
            }
            logger.Debug("FINE Metodo AssociaContributoAlTask in DocsPaDb.Query_DocsPAWS.Task");
            return(result);
        }
Esempio n. 6
0
        /// <summary>
        /// Ritorna il numero di timestamp associati al documento (il documento è identificato tramite DocNumber e VersionID)
        /// </summary>
        /// <param name="infoUtente"></param>
        /// <param name="fileRequest"></param>
        /// <returns></returns>
        public int getCountTimestampsDoc(DocsPaVO.utente.InfoUtente infoUtente, string docNumber, string versionId)
        {
            DocsPaDB.DBProvider dbProvider = new DBProvider();
            int numTimestamp = 0;

            try
            {
                DocsPaUtils.Query queryMng = DocsPaUtils.InitQuery.getInstance().getQuery("S_COUNT_DPA_TIMESTAMP_DOC");
                queryMng.setParam("versionId", versionId);
                queryMng.setParam("docNumber", docNumber);

                string commandText = queryMng.getSQL();
                System.Diagnostics.Debug.WriteLine("SQL - getCountTimestampsDoc - DocsPaDB/TimestampDoc.cs - QUERY : " + commandText);
                logger.Debug("SQL - getCountTimestampsDoc - DocsPaDB/TimestampDoc.cs - QUERY : " + commandText);
                DataSet dataSet = new DataSet();
                dbProvider.ExecuteQuery(dataSet, commandText);

                if (dataSet.Tables[0].Rows.Count > 0 && dataSet.Tables[0].Columns.Contains("NumTimestamp"))
                {
                    numTimestamp = int.Parse(dataSet.Tables[0].Rows[0]["NumTimestamp"].ToString());
                }
            }
            catch (Exception ex)
            {
                logger.Debug("SQL - getCountTimestampsDoc - DocsPaDB/TimestampDoc.cs - Exception : " + ex.Message);
            }

            return(numTimestamp);
        }
Esempio n. 7
0
        public static void CheckEventiFirma(string idProfile, string idPeople, string idGruppo, string idAmm)
        {
            logger.Debug("BEGIN");
            try
            {
                DocsPaVO.ProfilazioneDinamica.Templates template = ProfilazioneDinamica.ProfilazioneDocumenti.getTemplate(idProfile);

                if (template != null)
                {
                    DocsPaVO.utente.InfoUtente infoUt = new DocsPaVO.utente.InfoUtente();
                    DocsPaVO.utente.Utente     u      = Utenti.UserManager.getUtenteById(idPeople);
                    DocsPaVO.utente.Ruolo      r      = Utenti.UserManager.getRuoloByIdGruppo(idGruppo);
                    infoUt = Utenti.UserManager.GetInfoUtente(u, r);

                    ArrayList listaFascicoli = BusinessLogic.Fascicoli.FascicoloManager.getFascicoliDaDocNoSecurity(infoUt, idProfile);
                    logger.Debug("Analisi fascicoli");
                    foreach (DocsPaVO.fascicolazione.Fascicolo f in listaFascicoli)
                    {
                        DocsPaVO.ProfilazioneDinamica.Templates templateFasc = ProfilazioneDinamica.ProfilazioneFascicoli.getTemplateFasc(f.systemID);
                        if (templateFasc != null && templateFasc.SYSTEM_ID != 0)
                        {
                            logger.Debug("Fascicolo ID=" + f.systemID + " tipizzato - " + templateFasc.DESCRIZIONE);
                            CambioStatoProcedimento(f.systemID, "FIRMA", template.SYSTEM_ID.ToString(), infoUt);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Debug("Errore in CheckEventiFirma", ex);
            }

            logger.Debug("END");
        }
Esempio n. 8
0
        /// <summary>
        /// Reperimento del TSR del docNumber all'ultima versione
        /// </summary>
        /// <param name="infoUtente"></param>
        /// <param name="docNumer"></param>
        /// <returns></returns>
        private static string getTimeStampForDocNumber(DocsPaVO.utente.InfoUtente infoUtente, string docNumer)
        {
            string retval = null;

            string      versione = BusinessLogic.Documenti.VersioniManager.getLatestVersionID(docNumer, infoUtente);
            FileRequest frTS     = new FileRequest {
                docNumber = docNumer, versionId = versione
            };
            ArrayList tsAL = BusinessLogic.Documenti.TimestampManager.getTimestampsDoc(infoUtente, frTS);

            foreach (DocsPaVO.documento.TimestampDoc ts  in tsAL)
            {
                if (!string.IsNullOrEmpty(ts.TSR_FILE))
                {
                    byte[] tsrBin      = Convert.FromBase64String(ts.TSR_FILE);
                    byte[] fileContent = GetFileDocumento(infoUtente, docNumer).FileContent;
                    bool   match       = new Documenti.DigitalSignature.VerifyTimeStamp().machTSR(tsrBin, fileContent);

                    //Luluciani: per evitare problema Export tsr non valide  Zanotti
                    // if (match)
                    retval = ts.TSR_FILE;
                }
                break;
            }
            return(retval);
        }
Esempio n. 9
0
 /// <summary>
 /// overloading per passare nome e cognome dell'utente loggato,in modo da evidenziare le trasmissioni di cui l'utente è destinatario
 /// Dimitri
 /// </summary>
 /// <param name="target"></param>
 /// <param name="dt"></param>
 /// <param name="newPage"></param>
 public void appendTable(String target, DataTable dt, bool newPage, DocsPaVO.utente.InfoUtente infoUt)
 { //Appende la tabella individuata dal target al file PDF.
     //La tabella sarà formattata usando la specifica contenuta nel file XML e
     //popolata con i dati contenuti nel DataTable.
     //La tabella viene stampata in una nuova pagina se newPage è true
     try
     {
         if (dt == null)
         {
             return;
         }
         if (docPDF == null)
         {
             throw new ReportException(ErrorCode.NullPDFFile, "Impossibile aggiungere informazioni sul file PDF. Il file non esiste");
         }
         if (!docPDF.IsOpen())
         {
             docPDF.Open();
         }
         docPDF = StampaPDF.appendData(dt, docPDF, docTemplate, target, newPage, infoUt);
     }
     catch (ReportException re)
     {
         throw re;
     }
     catch (Exception e)
     {
         throw new ReportException(ErrorCode.BadPDFFile, "Impossibile aggiungere informazioni sul file PDF. " + e.Message);
     }
 }
Esempio n. 10
0
 /// <summary>
 /// ritorna la lista dei documenti in stato finale
 /// </summary>
 /// <param name="infoUtente"></param>
 /// <param name="idDocumento"></param>
 /// <param name="anno"></param>
 /// <param name="idRegistro"></param>
 /// <returns></returns>
 public static DocsPaVO.amministrazione.DocumentoStatoFinale[] GetDocumentiStatoFinale(
     DocsPaVO.utente.InfoUtente infoUtente,
     string idDocumento, string anno, string idRegistro, bool sbloccati, string IdTipologia, bool Protocollati, string IdAmministrazione)
 {
     using (DocsPaDB.Query_DocsPAWS.Amministrazione amm = new DocsPaDB.Query_DocsPAWS.Amministrazione())
         return(amm.GetDocumentiStatoFinale(infoUtente, idDocumento, anno, idRegistro, sbloccati, IdTipologia, Protocollati, IdAmministrazione));
 }
Esempio n. 11
0
        private static string cleanOriginalFileNameAllegato(DocsPaVO.utente.InfoUtente infoUtente, DocsPaVO.documento.InfoDocumento documento, DocsPaVO.documento.Allegato allegato)
        {
            string nomeDocumento    = GetNomeDocumento(documento);
            string nomeAllegato     = GetNomeDocumento(allegato);
            string originalFileName = getOriginalFileName(infoUtente, allegato.docNumber);
            string nameSepa         = "_";

            if (originalFileName.Contains(nomeDocumento))
            {
                originalFileName = originalFileName.Replace(nomeDocumento, String.Empty);
            }

            if (originalFileName.Contains(nomeAllegato))
            {
                originalFileName = originalFileName.Replace(nomeAllegato, String.Empty);
            }

            if (originalFileName.EndsWith("_"))
            {
                originalFileName = originalFileName.Remove(originalFileName.Length - 1);
            }

            string AllSepa = "-All-";

            string nome = String.Format("{0}{1}{2}", String.Format("{0}{1}{2}", nomeDocumento, AllSepa, nomeAllegato), nameSepa, originalFileName);

            return(nome);
        }
Esempio n. 12
0
        public DocsPaVO.documento.FileDocumento CreaRicevuta(DocsPaVO.utente.InfoUtente userInfo, string idDocument, string text)
        {
            byte[] content = null;
            DocsPaVO.documento.FileDocumento doc = new DocsPaVO.documento.FileDocumento();

            Document pdf = new Document();

            pdf.Pages.Add();

            Aspose.Pdf.Text.TextFragment tf = new Aspose.Pdf.Text.TextFragment(text);

            pdf.Pages[1].Paragraphs.Add(tf);

            using (MemoryStream stream = new MemoryStream())
            {
                pdf.Save(stream);

                if (stream != null)
                {
                    doc.content = stream.ToArray();
                }

                stream.Close();
            }

            return(doc);
        }
Esempio n. 13
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);
        }
Esempio n. 14
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="infoUtente"></param>
        /// <param name="objRuolo"></param>
        /// <param name="registro"></param>
        /// <param name="filters"></param>
        /// <returns></returns>
        public static DocsPaVO.documento.FileDocumento StampaBusteWithFilters(
            DocsPaVO.utente.InfoUtente infoUtente,
            DocsPaVO.utente.Ruolo objRuolo,
            DocsPaVO.utente.Registro registro,
            DocsPaVO.filtri.FiltroRicerca[][] filters)
        {
            logger.Debug("StampaBusteWithFilters");
            DocsPaVO.documento.FileDocumento fileDoc = new DocsPaVO.documento.FileDocumento();
            try
            {
                // Recupero documenti da stampare
                DataTable tableProfile = (getDestProtUscitaWithFilters(filters, registro)).Tables[0];
                if (tableProfile.Rows.Count > 0)                     //controllo se ritorsa un dataset pieno
                {
                    StampaPDF.StampaBustePdf.StampaBustePdf stampaFile = new StampaPDF.StampaBustePdf.StampaBustePdf();

                    System.IO.FileStream fs = stampaFile.GeneraBustaPdf(tableProfile, infoUtente.userId);

                    fileDoc = GeneraFileDoc(fs);
                    return(fileDoc);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                throw ex;
                return(null);
            }
        }
Esempio n. 15
0
        ///// <summary>
        ///// Verifica se l'utente può consolidare il documento fornito
        ///// </summary>
        ///// <param name="userInfo"></param>
        ///// <param name="idDocument"></param>
        ///// <returns></returns>
        //public static bool HasDocumentConsolidationRights(DocsPaVO.utente.InfoUtente userInfo, string idDocument)
        //{
        //    bool enabled = false;

        //    // Verifica
        //    enabled = (HasDocumentConsolidationRights(userInfo));

        //    if (enabled)
        //    {
        //        // Verifica se l'utente dispone dei diritti di lettura / scrittura sul documento
        //        DocsPaDB.Query_DocsPAWS.Security securityDb = new DocsPaDB.Query_DocsPAWS.Security();

        //        enabled = securityDb.HasReadWriteAccessRights(idDocument, userInfo.idPeople, userInfo.idGruppo);
        //    }

        //    return enabled;
        //}

        /// <summary>
        /// Verifica se, in base allo stato di consolidamento del documento, l'utente è autorizzato ad effettuare una determinata azione
        /// </summary>
        /// <param name="userInfo"></param>
        /// <param name="idDocument"></param>
        /// <param name="action"></param>
        /// <param name="throwOnError"></param>
        /// <returns></returns>
        public static bool CanExecuteAction(DocsPaVO.utente.InfoUtente userInfo, string idDocument, ConsolidationActionsDeniedEnum action, bool throwOnError)
        {
            if (IsConfigEnabled())
            {
                DocsPaVO.documento.DocumentConsolidationStateInfo actualState = GetState(userInfo, idDocument);

                if (actualState.State == DocsPaVO.documento.DocumentConsolidationStateEnum.None)
                {
                    return(true);
                }
                else
                {
                    // Determina, dai metadati dell'enumeration, a quale stato di consolidamento si riferisce l'azione richiesta
                    DocsPaVO.documento.DocumentConsolidationStateEnum actionApplyState = DocumentConsolidationAttribute.GetState(action);

                    bool canExecute = (actualState.State < actionApplyState);

                    if (!canExecute && throwOnError)
                    {
                        throw new ApplicationException("L'azione non può essere eseguita, il documento risulta in stato consolidato");
                    }

                    return(canExecute);
                }
            }
            else
            {
                return(true);
            }
        }
Esempio n. 16
0
 private Metadata.UniSincro.NameAndSurname getAgent(DocsPaVO.utente.InfoUtente infoUtenteConservazione)
 {
     DocsPaVO.utente.Utente ut = BusinessLogic.Utenti.UserManager.getUtenteById(infoUtenteConservazione.idPeople);
     return(new Metadata.UniSincro.NameAndSurname {
         FirstName = ut.nome, LastName = ut.cognome
     });
 }
Esempio n. 17
0
        /// <summary>
        /// Determina se un documento si trova in uno stato di consolidamento particolare
        /// </summary>
        /// <param name="userInfo"></param>
        /// <param name="idDocument"></param>
        /// <param name="requestedState">Stato di consolidamento richiesto</param>
        /// <returns></returns>
        public static bool IsDocumentConsoldated(DocsPaVO.utente.InfoUtente userInfo, string idDocument, DocsPaVO.documento.DocumentConsolidationStateEnum requestedState)
        {
            // Reperimento stato di consolidamento del documento richiesto
            DocsPaVO.documento.DocumentConsolidationStateInfo actualState = GetState(userInfo, idDocument);

            return(actualState.State >= requestedState);
        }
Esempio n. 18
0
        /// <summary>
        /// Invio delle parti di file in upload
        /// </summary>
        /// <param name="request"></param>
        /// <returns>Response </returns>
        public Services.FilesUploader.UploadFile.UploadFileResponse DeleteFileInUpload(Services.FilesUploader.UploadFile.UploadFileRequest request)
        {
            logger.Info("BEGIN DeleteFileInUpload");

            Request newRequest = new Request();

            newRequest.UserName            = request.UserName;
            newRequest.AuthenticationToken = request.AuthenticationToken;
            newRequest.CodeAdm             = request.CodeAdm;

            DocsPaVO.utente.InfoUtente infoUtente = Utils.CheckAuthentication(newRequest, "");

            Services.FilesUploader.UploadFile.UploadFileResponse response = Manager.UploadFileManager.DeleteFileInUpload(request, infoUtente);

            //DocsPaVO.Logger.CodAzione.Esito esito = (response != null && response.Success ? DocsPaVO.Logger.CodAzione.Esito.OK : DocsPaVO.Logger.CodAzione.Esito.KO);
            //BusinessLogic.UserLog.UserLog.WriteLog(infoUtente, "ADDELEMINLF", request.IdPasso, "Creazione nuovo elemento in libro firma per il passo. " + request.IdPasso + " in modalità " + request.Modalita, esito);

            logger.Info("END DeleteFileInUpload");

            Utils.CheckFaultException(response);

            response.IsSuccess = response.Success;

            return(response);
        }
Esempio n. 19
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public DocsPaVO.utente.InfoUtente ricercaInfoutente(string userId)
        {
            DocsPaVO.utente.InfoUtente utente = null;

            DocsPaUtils.Query q = DocsPaUtils.InitQuery.getInstance().getQuery("S_INFOUTENTE");
            q.setParam("user_id", "'" + userId + "'");
            logger.Debug("ricercaInfoutente - query: " + q.getSQL());
            using (DocsPaDB.DBProvider dbProvider = new DocsPaDB.DBProvider())
            {
                using (System.Data.IDataReader reader = dbProvider.ExecuteReader(q.getSQL()))
                {
                    if (reader != null)
                    {
                        while (reader.Read())
                        {
                            utente                   = new DocsPaVO.utente.InfoUtente();
                            utente.idGruppo          = reader.GetInt32(reader.GetOrdinal("GROUPS_SYSTEM_ID")).ToString();
                            utente.idPeople          = reader.GetInt32(reader.GetOrdinal("system_id")).ToString();
                            utente.userId            = reader.GetString(reader.GetOrdinal("user_id"));
                            utente.idAmministrazione = reader.GetInt32(reader.GetOrdinal("ID_AMM")).ToString();
                        }
                    }
                }
            }

            return(utente);
        }
Esempio n. 20
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="infoUtente"></param>
        /// <param name="schedaDoc"></param>
        /// <param name="enableUffRef"></param>
        /// <param name="saveUffRef"></param>
        /// <returns></returns>
        private static DocsPaVO.documento.SchedaDocumento salvaModifiche(DocsPaVO.utente.InfoUtente infoUtente, DocsPaVO.documento.SchedaDocumento schedaDoc, bool enableUffRef, out bool saveUffRef)
        {
            if (!AllegatiManager.isEnabledProfilazioneAllegati() && schedaDoc.documentoPrincipale != null)
            {
                string errorMessage = "Errore nell'operazione 'BusinessLogic.Documenti.DocSave.salvaModifiche': la profilazione dell'allegato non è attivata.";

                logger.Debug(errorMessage);
                throw new ApplicationException(errorMessage);
            }

            logger.Debug("salvaModifiche");
            bool daAggiornareUffRef = false;

            DocsPaDocumentale.Documentale.DocumentManager documentManager = new DocsPaDocumentale.Documentale.DocumentManager(infoUtente);
            if (!documentManager.SalvaDocumento(schedaDoc, enableUffRef, out daAggiornareUffRef))
            {
                string msg = "Errore nel'operazione di salva modifiche del documento";
                logger.Debug(msg);
                throw new ApplicationException(msg);
            }

            saveUffRef = daAggiornareUffRef;
            //AS400
            if (schedaDoc != null && schedaDoc.protocollo != null &&
                schedaDoc.protocollo.segnatura != null &&
                schedaDoc.protocollo.segnatura != "")
            {
                AS400.AS400.setAs400(schedaDoc, DocsPaAS400.Constants.CREATE_MODIFY_OPERATION);
            }

            return(schedaDoc);
        }
Esempio n. 21
0
        //Recupera la lista dei fascicoli procedimentali chiusi in deposito per un dato fascicolo generale
        //OK
        public static System.Collections.ArrayList getListaFascicoliInDeposito(DocsPaVO.utente.InfoUtente infoUtente,
                                                                               DocsPaVO.fascicolazione.Fascicolo fascicolo,
                                                                               int numPage, out int numTotPage,
                                                                               out int nRec, string tipoRic)
        {
            numTotPage = 0;
            nRec       = 0;
            DocsPaDB.Query_DocsPAWS.Fascicoli fascicoli = new DocsPaDB.Query_DocsPAWS.Fascicoli();
            ArrayList result = null;

            if (tipoRic == "C")
            {
                result = fascicoli.GetListaFascicoliInDeposito(infoUtente, fascicolo, numPage, out numTotPage, out nRec);
            }
            else
            {
                result = fascicoli.GetListaFascicoliRicInDeposito(infoUtente, tipoRic, numPage, out numTotPage, out nRec);
            }
            if (result == null)
            {
                logger.Debug("Errore nella gestione dei fascicoli. (getListaFascicoliInDeposito)");
                throw new Exception("F_System");
            }
            return(result);
        }
Esempio n. 22
0
        /// <summary>
        /// Verifica se il formato del file è ammesso per la firma digitale
        /// </summary>
        /// <param name="infoUtente"></param>
        /// <param name="fileRequest"></param>
        /// <returns></returns>
        private static bool IsFormatSupportedForSign(DocsPaVO.utente.InfoUtente infoUtente, DocsPaVO.documento.FileRequest fileRequest)
        {
            bool retValue = false;

            if (!FormatiDocumento.Configurations.SupportedFileTypesEnabled)
            {
                retValue = true;
            }
            else
            {
                string extension = System.IO.Path.GetExtension(fileRequest.fileName);

                if (!string.IsNullOrEmpty(extension))
                {
                    // Rimozione del primo carattere dell'estensione (punto)
                    extension = extension.Substring(1);

                    DocsPaVO.FormatiDocumento.SupportedFileType fileType = BusinessLogic.FormatiDocumento.SupportedFormatsManager.GetFileType(Convert.ToInt32(infoUtente.idAmministrazione), extension);

                    retValue = (fileType != null && fileType.FileTypeUsed && fileType.FileTypeSignature);
                }
            }

            return(retValue);
        }
Esempio n. 23
0
        public bool AnnullaTask(string idStatoTask, DocsPaVO.utente.InfoUtente infoUtente)
        {
            logger.Debug("Inizio Metodo AnnullaTask in DocsPaDb.Query_DocsPAWS.Task");
            bool result = false;

            try
            {
                DocsPaUtils.Query q = DocsPaUtils.InitQuery.getInstance().getQuery("U_DPA_STATO_TASK_DTA_ANNULLAMENTO");
                q.setParam("idStatoTask", idStatoTask);
                q.setParam("dataAnnullamento", DocsPaDbManagement.Functions.Functions.GetDate());

                string query = q.getSQL();
                logger.Debug("AnnullaTask: " + query);
                if (!ExecuteNonQuery(query))
                {
                    throw new Exception("Errore durante l'annullamento del task: " + query);
                }
                else
                {
                    result = true;
                }
            }
            catch (Exception e)
            {
                logger.Error("Errore nel Metodo AnnullaTask in DocsPaDb.Query_DocsPAWS.Task : " + e.Message);
                result = false;
            }
            logger.Debug("FINE Metodo AnnullaTask in DocsPaDb.Query_DocsPAWS.Task");
            return(result);
        }
Esempio n. 24
0
        public bool RiceviComunicazioniSDI(string id_sdi, string fileName, byte[] fileRicevuta, BusinessLogic.Fatturazione.FatturazioneManager.TrasmissioneFattureRicevutaType comunicationType)
        {
            bool retVal = false;

            try
            {
                string docNumber            = string.Empty;
                DocsPaVO.utente.Ruolo ruolo = null;
                DocsPaVO.DiagrammaStato.DiagrammaStato diagramma = null;

                DocsPaVO.utente.Utente utente = BusinessLogic.Fatturazione.FatturazioneManager.GetUtenteOwner(id_sdi, out ruolo, out docNumber, out diagramma);

                DocsPaVO.utente.InfoUtente infoUtente = new DocsPaVO.utente.InfoUtente(utente, ruolo);
                SetUserId(infoUtente);

                retVal = BusinessLogic.Fatturazione.FatturazioneManager.Add_Notifica_SDI(infoUtente, docNumber, fileName, fileRicevuta, comunicationType, diagramma);
            }
            catch (Exception exception)
            {
                logger.Debug("Errore nel metodo WS RiceviComunicazioniSDI: ", exception);
                retVal = false;
            }

            return(retVal);
        }
Esempio n. 25
0
        /// <summary>
        /// Aggiornamento delle note di trasmissione utente  in seguito al completamento del task
        /// </summary>
        /// <param name="idTrasmSingola"></param>
        /// <param name="note"></param>
        /// <param name="infoUtente"></param>
        /// <returns></returns>
        public bool UpdateNoteTrasmUtente(string idTrasmSingola, string note, DocsPaVO.utente.InfoUtente infoUtente)
        {
            logger.Debug("Inizio Metodo UpdateNoteTrasmUtente in DocsPaDb.Query_DocsPAWS.Task");
            bool result = false;

            try
            {
                DocsPaUtils.Query q = DocsPaUtils.InitQuery.getInstance().getQuery("U_DPA_TRASM_UTENTE_NOTE");
                q.setParam("idTrasmSingola", idTrasmSingola);
                q.setParam("idPeople", infoUtente.idPeople);
                q.setParam("note", note.Replace("'", "''"));

                string query = q.getSQL();
                logger.Debug("UpdateNoteTrasmUtente: " + query);
                if (!ExecuteNonQuery(query))
                {
                    throw new Exception("Errore durante l'aggiornamento delle note di trasmissione utente: " + query);
                }
                else
                {
                    result = true;
                }
            }
            catch (Exception e)
            {
                logger.Error("Errore nel Metodo UpdateNoteTrasmUtente in DocsPaDb.Query_DocsPAWS.Task : " + e.Message);
                result = false;
            }

            return(result);
        }
Esempio n. 26
0
 private void SetUserId(DocsPaVO.utente.InfoUtente infoUtente)
 {
     if (infoUtente != null)
     {
         SetUserId(infoUtente.userId);
     }
 }
Esempio n. 27
0
 /// <summary></summary>
 /// <param name="uo"></param>
 /// <param name="infoUtente"></param>
 /// <returns></returns>
 public static String[] getListaRuoliSoppopostiUO(DocsPaVO.utente.InfoUtente infoUtente, string system_id_uo)
 {
     DocsPaDB.Query_DocsPAWS.Amministrazione amm = new DocsPaDB.Query_DocsPAWS.Amministrazione();
     String[] result = null;
     result = amm.getListRuoliUOSottoposti(infoUtente, system_id_uo);
     return(result);
 }
Esempio n. 28
0
        /// <summary>
        /// Verifica se l'utente dispone dei diritti necessari per utilizzare le funzioni di consolidamento
        /// </summary>
        /// <param name="userInfo"></param>
        /// <returns></returns>
        public static bool HasDocumentConsolidationRights(DocsPaVO.utente.InfoUtente userInfo)
        {
            if (IsConfigEnabled())
            {
                DocsPaVO.utente.Ruolo currentRole = BusinessLogic.Utenti.UserManager.getRuolo(userInfo.idCorrGlobali);

                if (currentRole != null)
                {
                    DocsPaVO.utente.Funzione[] funzioni = (DocsPaVO.utente.Funzione[])
                                                          currentRole.funzioni.ToArray(typeof(DocsPaVO.utente.Funzione));

                    DocsPaVO.utente.Funzione function = funzioni.Where(e => (e.codice == DO_CONSOLIDAMENTO || e.codice == DO_CONSOLIDAMENTO_METADATI)).FirstOrDefault();

                    return(function != null);
                }
                else
                {
                    throw new ApplicationException(string.Format("Ruolo corrente con id {0} per l'utente {1} non trovato", userInfo.idCorrGlobali, userInfo.userId));
                }
            }
            else
            {
                return(false);
            }
        }
Esempio n. 29
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);
        }
Esempio n. 30
0
        public bool DeleteFileInUpload(string fileName, string fileDescription, DocsPaVO.utente.InfoUtente infoUtente)
        {
            logger.Debug("INIZIO Metodo GetFileInUpload in DocsPaDb.Query_DocsPAWS.UploadFiles");

            bool retValue = true;

            try
            {
                DocsPaUtils.Query q = DocsPaUtils.InitQuery.getInstance().getQuery("D_DPA_UPLOAD_FILE");
                //q.setParam("fileHash", hashFile);
                q.setParam("IdUtente", infoUtente.idPeople);
                q.setParam("fileName", fileName);
                q.setParam("fileDescription", fileDescription);

                string query = q.getSQL();
                logger.Debug("DeleteFileInUpload: " + query);
                if (!ExecuteNonQuery(query))
                {
                    throw new Exception("Errore durante la rimozione del file in upload: " + query);
                }
            }
            catch (Exception e)
            {
                logger.Error("Errore nel Metodo DeleteFileInUpload in DocsPaDb.Query_DocsPAWS.UploadFiles: " + e.Message);
                return(false);
            }

            logger.Debug("Fine Metodo DeleteFileInUpload in DocsPaDb.Query_DocsPAWS.UploadFiles");
            return(retValue);
        }