コード例 #1
0
        /// <summary>
        /// Set the items in state CLOSED
        /// </summary>
        /// <returns></returns>
        public bool SetLookNextPasso(PassoFirma passo)
        {
            bool retVal = false;

            DocsPaUtils.Query q = DocsPaUtils.InitQuery.getInstance().getQuery("U_NEXT_PASSO_AS_LOOK");
            q.setParam("Id_Processo", passo.idProcesso);
            q.setParam("Id_Documento", passo.idDocumeto);
            q.setParam("Id_Processo", passo.idProcesso);
            q.setParam("N_Sequenza", (passo.numeroSequenza + 1).ToString());

            string queryString = q.getSQL();

            logWriter.addLog(logWriter.DEBUG, queryString);

            try
            {
                this.ExecuteNonQuery(queryString);
            }
            catch (Exception ex)
            {
                logWriter.addLog(logWriter.ERRORE, ex.Message);
                retVal = false;
            }

            return(retVal);
        }
コード例 #2
0
        public bool NewDesktopApp(DesktopApp app)
        {
            logger.Debug("Inizio Metodo NewDesktopApp in DocsPaDb.Query_DocsPAWS.DesktopApps");
            bool retValue = true;

            try
            {
                DocsPaUtils.Query q = DocsPaUtils.InitQuery.getInstance().getQuery("I_DPA_DESKTOP_APPS");
                q.setParam("nome", app.Nome);
                q.setParam("versione", app.Versione);
                q.setParam("path", app.Path);
                q.setParam("descrizione", app.Descrizione);

                string query = q.getSQL();
                logger.Debug("NewDesktopApp: " + query);
                if (!ExecuteNonQuery(query))
                {
                    logger.Error("Errore durante l'inserimento in DPA_PASSO_DPA_EVENTO: " + query);
                    retValue = false;
                }
            }
            catch (Exception e)
            {
                logger.Error("Errore nel Metodo NewDesktopApp in DocsPaDb.Query_DocsPAWS.DesktopApps: " + e.Message);
                return(false);
            }

            logger.Debug("Fine Metodo NewDesktopApp in DocsPaDb.Query_DocsPAWS.DesktopApps");
            return(retValue);
        }
コード例 #3
0
        public List <ModelloDelega> searchModelliDelega(DocsPaVO.utente.InfoUtente utente, List <Ruolo> ruoli, SearchModelloDelegaInfo searchInfo)
        {
            string idPeople = utente.idPeople;

            DocsPaUtils.Query queryMng = DocsPaUtils.InitQuery.getInstance().getQuery("S_GET_MODELLI_DELEGA");
            queryMng.setParam("idUtente", idPeople);
            string condRicerca = buildConditions(searchInfo);

            queryMng.setParam("param1", condRicerca);
            string commandText = queryMng.getSQL();

            logger.Debug("QUERY : " + commandText);
            DataSet ds = new DataSet();

            ExecuteQuery(ds, commandText);
            List <ModelloDelega> res = new List <ModelloDelega>();

            if (ds.Tables[0].Rows.Count != 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    ModelloDelega temp = buildModelloDelega(ds.Tables[0].Rows[i], ruoli);
                    res.Add(temp);
                }
            }
            return(res);
        }
コード例 #4
0
        public string CheckNumFattura(string numero, string idAmm)
        {
            string retVal = string.Empty;

            try
            {
                logger.Debug("BEGIN");

                DocsPaUtils.Query query = DocsPaUtils.InitQuery.getInstance().getQuery("S_CHECK_NUM_FATTURA");
                query.setParam("numero", numero);
                query.setParam("idAmm", idAmm);

                string commandText = query.getSQL();
                logger.Debug("QUERY - " + commandText);

                if (!this.ExecuteScalar(out retVal, commandText))
                {
                    throw new Exception(this.LastExceptionMessage);
                }

                logger.Debug("END");
            }
            catch (Exception ex)
            {
                logger.DebugFormat("Errore nella ricerca del numero fattura : {0}\r\n{1}", ex.Message, ex.StackTrace);
                retVal = "-1";
            }

            return(retVal);
        }
コード例 #5
0
        public bool InsertIdRicevutaFattura(string messageId)
        {
            bool result = false;

            try
            {
                logger.Debug("BEGIN");

                DocsPaUtils.Query query = DocsPaUtils.InitQuery.getInstance().getQuery("I_FATTURA_MAIL_ELABORATE");
                query.setParam("msgID", messageId);
                query.setParam("dtaElab", DocsPaDbManagement.Functions.Functions.ToDate(DateTime.Now.ToString()));

                string commandText = query.getSQL();
                logger.Debug("QUERY - " + commandText);

                if (!this.ExecuteNonQuery(commandText))
                {
                    throw new Exception(this.LastExceptionMessage);
                }

                logger.Debug("END");
            }
            catch (Exception ex)
            {
                logger.DebugFormat("Errore nell'inserimento della mail: {0}\r\n{1}", ex.Message, ex.StackTrace);
            }

            return(result);
        }
コード例 #6
0
        public bool InsertAssociazioneIdSdi(string idFattura, string idSdi, string docnumber)
        {
            logger.Debug("BEGIN");
            bool result = false;

            try
            {
                DocsPaUtils.Query query = DocsPaUtils.InitQuery.getInstance().getQuery("I_FATTURAZIONE_SET_ID_SDI");
                query.setParam("id_fattura", idFattura);
                query.setParam("id_sdi", idSdi);
                query.setParam("id_profile", docnumber);

                string command = query.getSQL();
                logger.Debug("QUERY - " + command);

                if (!this.ExecuteNonQuery(command))
                {
                    throw new Exception(this.LastExceptionMessage);
                }

                result = true;
            }
            catch (Exception ex)
            {
                logger.Debug("Errore in InsertAssociazioneIdSdi - ", ex);
                result = false;
            }

            logger.Debug("END");
            return(result);
        }
コード例 #7
0
        public DocsPaVO.utente.Utente GetLoggedAutomaticUser(string idPeople, string idGroup)
        {
            DocsPaVO.utente.Utente retVal = new DocsPaVO.utente.Utente();

            try
            {
                DataSet           ds = new DataSet();
                DocsPaUtils.Query q  = DocsPaUtils.InitQuery.getInstance().getQuery("S_UTENTE_AUTOMATICO");
                q.setParam("idpeople", idPeople);

                string queryString = q.getSQL();

                logWriter.addLog(logWriter.DEBUG, queryString);

                this.ExecuteQuery(out ds, "Items", queryString);

                if (ds.Tables["Items"] != null && ds.Tables["Items"].Rows.Count > 0)
                {
                    DataRow dr = ds.Tables["Items"].Rows[0];
                    retVal.IdPeople = idPeople;
                    retVal.Nome     = dr["Var_Nome"].ToString();;
                    retVal.Cognome  = dr["Var_Cognome"].ToString();
                    retVal.Userid   = dr["User_Id"].ToString();
                    retVal.CodAmm   = dr["Var_Codice_Amm"].ToString();
                }
                q = DocsPaUtils.InitQuery.getInstance().getQuery("S_RUOLO");
                q.setParam("idgroup", idGroup);

                queryString = q.getSQL();

                logWriter.addLog(logWriter.DEBUG, queryString);

                this.ExecuteQuery(out ds, "Items", queryString);

                if (ds.Tables["Items"] != null && ds.Tables["Items"].Rows.Count > 0)
                {
                    DataRow dr = ds.Tables["Items"].Rows[0];
                    retVal.Idruolo  = idGroup;
                    retVal.CodRuolo = dr["Group_Id"].ToString();
                }
            }
            catch (Exception exc)
            {
                logWriter.addLog(logWriter.ERRORE, exc.Message);
            }

            logWriter.addLog(logWriter.INFO, (!string.IsNullOrEmpty(retVal.IdPeople) ? "Caricato utente " + retVal.Userid : "Nessun utente trovato con idpeople " + idPeople + " e idGroup " + idGroup));

            return(retVal);
        }
コード例 #8
0
        public bool UpdateAssociazioneIdSdi(string idFattura, string idSdi, string docnumber)
        {
            logger.Debug("BEGIN");
            bool result = false;

            try
            {
                DocsPaUtils.Query query     = DocsPaUtils.InitQuery.getInstance().getQuery("U_FATTURAZIONE_SET_ID_SDI");
                string            updParams = string.Empty;
                if (!string.IsNullOrEmpty(idSdi))
                {
                    updParams = string.Format(" ID_SDI = '{0}'", idSdi);
                }
                if (!string.IsNullOrEmpty(docnumber))
                {
                    if (string.IsNullOrEmpty(updParams))
                    {
                        updParams = string.Format(" ID_PROFILE = '{0}'", docnumber);
                    }
                    else
                    {
                        updParams += string.Format(", ID_PROFILE = '{0}'", docnumber);
                    }
                }

                query.setParam("where_params", string.Format(" ID_FATTURA = '{0}'", idFattura));
                query.setParam("upd_params", updParams);

                string command = query.getSQL();
                int    rowsAffected;
                logger.Debug("QUERY - " + command);


                if (!this.ExecuteNonQuery(command, out rowsAffected))
                {
                    throw new Exception(this.LastExceptionMessage);
                }

                logger.DebugFormat("{0} rows affected", rowsAffected.ToString());
                result = true;
            }
            catch (Exception ex)
            {
                logger.Debug("Errore in UpdateAssociazioneIdSdi - ", ex);
            }

            logger.Debug("END");
            return(result);
        }
コード例 #9
0
        public bool DeleteDesktopApp(string nome)
        {
            logger.Debug("Inizio Metodo DeleteDesktopApp in DocsPaDb.Query_DocsPAWS.DesktopApps");
            bool retValue = true;

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

                string query = q.getSQL();
                logger.Debug("DeleteOpzioniNotifiche: " + query);
                if (!ExecuteNonQuery(query))
                {
                    logger.Error("Errore durante la rimozione in DPA_DESKTOP_APPS: " + query);
                    retValue = false;
                }
            }
            catch (Exception e)
            {
                logger.Error("Errore nel Metodo DeleteDesktopApp in DocsPaDb.Query_DocsPAWS.DesktopApps: " + e.Message);
                return(false);
            }

            logger.Debug("Fine Metodo DeleteDesktopApp in DocsPaDb.Query_DocsPAWS.DesktopApps");
            return(retValue);
        }
コード例 #10
0
        public string[] GetInfoFatturaSDI(string id_Sdi)
        {
            string[] retVal = null;

            logger.Debug("getIdOwnerFattura");
            DocsPaUtils.Query queryDef = DocsPaUtils.InitQuery.getInstance().getQuery("S_OWNER_FATTURA");
            queryDef.setParam("idsdi", "'" + id_Sdi + "'");

            string commandText = queryDef.getSQL();

            logger.Debug(commandText);

            IDataReader reader = ExecuteReader(commandText);

            while (reader.Read())
            {
                string idPeople    = reader.GetValue(reader.GetOrdinal("AUTHOR")).ToString();
                string idRuolo     = reader.GetValue(reader.GetOrdinal("ID_RUOLO_CREATORE")).ToString();
                string idDoc       = reader.GetValue(reader.GetOrdinal("DOCNUMBER")).ToString();
                string idDiagramma = reader.GetValue(reader.GetOrdinal("DIAGRAMMA")).ToString();

                retVal = new string[] { idPeople, idRuolo, idDoc, idDiagramma };
            }

            return(retVal);
        }
コード例 #11
0
        //OK
        public string getSystemIdRF(string codiceRF)
        {
            DocsPaDB.DBProvider dbProvider = new DocsPaDB.DBProvider();

            try
            {
                //semaforo.WaitOne();
                DocsPaUtils.Query queryMng = DocsPaUtils.InitQuery.getInstance().getQuery("LS_GET_SYSTEM_ID_LISTA");
                queryMng.setParam("param1", codiceRF.ToUpper());
                string commandText = queryMng.getSQL();
                System.Diagnostics.Debug.WriteLine("SQL - getSystemIdRF - RF.cs - QUERY : " + commandText);
                logger.Debug("SQL - getSystemIdRF - RF.cs - QUERY : " + commandText);

                DataSet ds = new DataSet();
                dbProvider.ExecuteQuery(ds, commandText);
                return(ds.Tables[0].Rows[0][0].ToString());
            }
            catch
            {
                return(null);
            }
            finally
            {
                dbProvider.Dispose();
                //semaforo.ReleaseMutex();
            }
        }
コード例 #12
0
        public bool CheckIdRicevutaFattura(string messageId)
        {
            bool result = false;

            try
            {
                logger.Debug("BEGIN");

                DocsPaUtils.Query query = DocsPaUtils.InitQuery.getInstance().getQuery("S_FATTURA_MAIL_ELABORATE");
                query.setParam("msgId", messageId);

                string commandText = query.getSQL();
                logger.Debug("QUERY - " + commandText);

                string val = string.Empty;
                if (!this.ExecuteScalar(out val, commandText))
                {
                    throw new Exception(this.LastExceptionMessage);
                }

                result = string.IsNullOrEmpty(val);
                logger.Debug("Result : " + result.ToString());
                logger.Debug("END");
            }
            catch (Exception ex)
            {
                logger.DebugFormat("Errore nel controllo della presenza della mail: {0}\r\n{1}", ex.Message, ex.StackTrace);
            }

            return(result);
        }
コード例 #13
0
        public string GetIdSdiByDocnumber(string docnumber)
        {
            logger.Debug("BEGIN");
            string retVal = string.Empty;

            try
            {
                DocsPaUtils.Query query = DocsPaUtils.InitQuery.getInstance().getQuery("S_FATTURAZIONE_GET_ID_SDI_BY_ID_PROFILE");
                query.setParam("id_profile", docnumber);

                string command = query.getSQL();
                logger.Debug("QUERY - " + command);

                if (!this.ExecuteScalar(out retVal, command))
                {
                    throw new Exception(this.LastExceptionMessage);
                }
            }
            catch (Exception ex)
            {
                logger.Debug("Errore in GetIdSdiByDocnumber - ", ex);
                retVal = string.Empty;
            }

            logger.Debug("END");
            return(retVal);
        }
コード例 #14
0
        public string GetIdDocFatturaFromNomefile(string nomeFile)
        {
            string retVal = string.Empty;

            try
            {
                logger.Debug("BEGIN");

                DocsPaUtils.Query query = DocsPaUtils.InitQuery.getInstance().getQuery("S_GET_FATTURA_FROM_NOMEFILE");
                query.setParam("fileName", nomeFile);

                string commandText = query.getSQL();
                logger.Debug("QUERY - " + commandText);

                if (!this.ExecuteScalar(out retVal, commandText))
                {
                    throw new Exception(this.LastExceptionMessage);
                }

                logger.Debug("END");
            }
            catch (Exception ex)
            {
                logger.DebugFormat("Errore nella ricerca del numero fattura : {0}\r\n{1}", ex.Message, ex.StackTrace);
                retVal = "-1";
            }

            return(retVal);
        }
コード例 #15
0
        public bool InsertProfileFattura(string docnum, string id_Sdi, string diagramid)
        {
            bool retVal = false;

            logger.Debug("InsertProfileFattura");
            DocsPaUtils.Query queryDef = DocsPaUtils.InitQuery.getInstance().getQuery("I_PROFILE_FATTURA");
            queryDef.setParam("docnumber", "'" + docnum + "'");
            queryDef.setParam("idsdi", "'" + id_Sdi + "'");
            queryDef.setParam("diagramid", "'" + diagramid + "'");

            string commandText = queryDef.getSQL();

            logger.Debug(commandText);

            retVal = ExecuteNonQuery(commandText);

            return(retVal);
        }
コード例 #16
0
        public bool InvioNotificheSetStatoInvio(string docnumber)
        {
            logger.Debug("BEGIN");
            bool result = false;

            try
            {
                DocsPaUtils.Query querySelect = DocsPaUtils.InitQuery.getInstance().getQuery("S_FATTURE_NOTIFICHE");
                querySelect.setParam("id_profile", docnumber);
                string command = querySelect.getSQL();
                logger.Debug("QUERY - 1 - " + command);

                string val = string.Empty;

                if (!this.ExecuteScalar(out val, command))
                {
                    throw new Exception(this.LastExceptionMessage);
                }

                DocsPaUtils.Query query;
                if (!string.IsNullOrEmpty(val) && val == "X")
                {
                    query = DocsPaUtils.InitQuery.getInstance().getQuery("U_FATTURE_NOTIFICHE");
                }
                else
                {
                    query = DocsPaUtils.InitQuery.getInstance().getQuery("I_FATTURE_NOTIFICHE");
                }
                query.setParam("id_profile", docnumber);
                query.setParam("notifica_inviata", "1");
                command = query.getSQL();
                logger.Debug("QUERY - " + query);

                if (!this.ExecuteNonQuery(command))
                {
                    throw new Exception(this.LastExceptionMessage);
                }

                result = true;
            }
            catch (Exception ex)
            {
                logger.Debug("Errore in InvioNotificheSetInvio - ", ex);
                result = false;
            }

            logger.Debug("END");
            return(result);
        }
コード例 #17
0
        public bool deleteModelliDelega(List <string> idModelli)
        {
            try
            {
                semaforo.WaitOne();
                int  rowsAffected;
                bool retValue = false;
                DocsPaUtils.Query queryMng = DocsPaUtils.InitQuery.getInstance().getQuery("D_DELETE_MODELLO_DELEGA");
                string            ids      = "";
                int index = 0;
                foreach (string tempId in idModelli)
                {
                    ids = ids + tempId;
                    if (index < idModelli.Count - 1)
                    {
                        ids = ids + ",";
                    }
                    index++;
                }
                queryMng.setParam("idModelli", ids);
                BeginTransaction();
                string commandText = queryMng.getSQL();
                logger.Debug("QUERY : " + commandText);

                ExecuteNonQuery(commandText, out rowsAffected);
                retValue = (rowsAffected > 0);

                if (retValue)
                {
                    CommitTransaction();
                }
                else
                {
                    RollbackTransaction();
                }
                return(retValue);
            }
            catch
            {
                RollbackTransaction();
                return(false);
            }
            finally
            {
                Dispose();
                semaforo.ReleaseMutex();
            }
        }
コード例 #18
0
        public bool LogFattura(string numero, string dataCreazione, string fornitore, string logMessage, string idProfile)
        {
            bool result = false;

            try
            {
                logger.Debug("BEGIN");
                DocsPaUtils.Query query = DocsPaUtils.InitQuery.getInstance().getQuery("I_LOG_FATTURA");
                query.setParam("numero", numero);
                query.setParam("dataFatt", DocsPaDbManagement.Functions.Functions.ToDate(dataCreazione));
                query.setParam("fornitore", fornitore);
                if (!string.IsNullOrEmpty(logMessage))
                {
                    query.setParam("logMsg", logMessage);
                }
                else
                {
                    query.setParam("logMsg", string.Empty);
                }
                if (!string.IsNullOrEmpty(idProfile))
                {
                    query.setParam("id_profile", idProfile);
                }
                else
                {
                    query.setParam("id_profile", "NULL");
                }

                string commandText = query.getSQL();
                logger.Debug("QUERY - " + commandText);

                if (!this.ExecuteNonQuery(commandText))
                {
                    throw new Exception(this.LastExceptionMessage);
                }
                else
                {
                    result = true;
                }

                logger.Debug("END");
            }
            catch (Exception ex)
            {
                logger.DebugFormat("Errore nell'inserimento del log: {0}\r\n{1}", ex.Message, ex.StackTrace);
                result = false;
            }

            return(result);
        }
コード例 #19
0
        public bool IS_statusMaskUpdater(string idDoc)
        {
            bool retval = false;

            try
            {
                using (DBProvider dbProvider = new DBProvider())
                {
                    DocsPaUtils.Query qFix = DocsPaUtils.InitQuery.getInstance().getQuery("FIX_PEC4_SPED_IS_AVV_CONSEGNA");
                    qFix.setParam("idDoc", idDoc);
                    string fixString = qFix.getSQL();
                    logger.Debug(fixString);
                    int fixRowTorn = 0;
                    retval = this.ExecuteNonQuery(fixString, out fixRowTorn);
                    if (fixRowTorn > 0)
                    {
                        logger.Warn("Fix eseguito avvenuta consegna , righe aggiornate:" + fixRowTorn);
                    }
                    else
                    {
                        logger.Warn("Errore nell'esecuzione del FIX, o nessuna ricevuta di avvenuta consegna");
                    }

                    DocsPaUtils.Query qFix2 = DocsPaUtils.InitQuery.getInstance().getQuery("FIX_PEC4_SPED_IS_AVV_CONSEGNA");
                    qFix2.setParam("idDoc", idDoc);
                    string fixString2 = qFix2.getSQL();
                    logger.Debug(fixString2);
                    int fixRowTorn2 = 0;
                    retval = this.ExecuteNonQuery(fixString2, out fixRowTorn2);
                    if (fixRowTorn2 > 0)
                    {
                        logger.Warn("Fix eseguito avvenuta , righe aggiornate:" + fixRowTorn2);
                    }
                    else
                    {
                        logger.Warn("Errore nell'esecuzione del FIX, o nessuna ricevuta mancata consegna");
                    }
                }
            }
            catch (Exception ex)
            {
                logger.ErrorFormat("Errore nell'aggiornamento della status mask per le spedizioni IS: Messaggio {0} - StackTrace {1}", ex.Message, ex.StackTrace);

                retval = false;
            }
            return(retval);
        }
コード例 #20
0
        public string CheckFatturaPassiva(string numero, string data, string partitaIva)
        {
            logger.Debug("BEGIN");
            string result = string.Empty;

            try
            {
                DocsPaUtils.Query query = DocsPaUtils.InitQuery.getInstance().getQuery("S_CHECK_FATTURA_PASSIVA");

                string filterString = string.Empty;

                if (!string.IsNullOrEmpty(numero))
                {
                    filterString += string.Format(" AND A.SYSTEM_ID IN (SELECT AT1.DOC_NUMBER FROM DPA_ASSOCIAZIONE_TEMPLATES AT1, DPA_OGGETTI_CUSTOM OC1 WHERE OC1.SYSTEM_ID=AT1.ID_OGGETTO AND AT1.ID_TEMPLATE=A.ID_TIPO_ATTO AND AT1.VALORE_OGGETTO_DB='{0}' AND UPPER(OC1.DESCRIZIONE) = 'NUMERO FATTURA FORNITORE')", numero);
                }
                if (!string.IsNullOrEmpty(data))
                {
                    filterString += string.Format(" AND A.SYSTEM_ID IN (SELECT AT2.DOC_NUMBER FROM DPA_ASSOCIAZIONE_TEMPLATES AT2, DPA_OGGETTI_CUSTOM OC2 WHERE OC2.SYSTEM_ID=AT2.ID_OGGETTO AND AT2.ID_TEMPLATE=A.ID_TIPO_ATTO AND AT2.VALORE_OGGETTO_DB='{0}' AND UPPER(OC2.DESCRIZIONE) = 'DATA')", data);
                }
                if (!string.IsNullOrEmpty(partitaIva))
                {
                    filterString += string.Format(" AND A.SYSTEM_ID IN (SELECT AT3.DOC_NUMBER FROM DPA_ASSOCIAZIONE_TEMPLATES AT3, DPA_OGGETTI_CUSTOM OC3 WHERE OC3.SYSTEM_ID=AT3.ID_OGGETTO AND AT3.ID_TEMPLATE=A.ID_TIPO_ATTO AND AT3.VALORE_OGGETTO_DB='{0}' AND UPPER(OC3.DESCRIZIONE) = 'PARTITAIVA CP')", partitaIva);
                }

                query.setParam("filters", filterString);
                string command = query.getSQL();

                DataSet ds;
                if (!this.ExecuteQuery(out ds, command))
                {
                    throw new Exception(this.LastExceptionMessage);
                }

                if (ds != null && ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                {
                    result = ds.Tables[0].Rows[0]["SYSTEM_ID"].ToString();
                }
            }
            catch (Exception ex)
            {
                logger.Debug("Errore in CheckFatturaPassiva - ", ex);
                result = "-1";
            }

            logger.Debug("END");
            return(result);
        }
コード例 #21
0
        //OK
        public ArrayList getCorrispondentiByCodRF(string codiceRF)
        {
            ArrayList corr = new ArrayList();

            DocsPaDB.DBProvider dbProvider = new DocsPaDB.DBProvider();

            try
            {
                //semaforo.WaitOne();
                DocsPaUtils.Query queryMng = DocsPaUtils.InitQuery.getInstance().getQuery("GET_CORRISPONDENTE_BY_RF");
                queryMng.setParam("param1", codiceRF.ToUpper().Replace("'", "''"));
                string commandText = queryMng.getSQL();
                System.Diagnostics.Debug.WriteLine("SQL - getCorrispondentiByCodRF - RF.cs - QUERY : " + commandText);
                logger.Debug("SQL - getCorrispondentiByCodRF - RF.cs - QUERY : " + commandText);

                DataSet ds = new DataSet();
                dbProvider.ExecuteQuery(ds, commandText);

                DocsPaDB.Query_DocsPAWS.Utenti u = new DocsPaDB.Query_DocsPAWS.Utenti();
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    DocsPaVO.utente.Corrispondente c = u.GetCorrispondenteBySystemID(ds.Tables[0].Rows[i][0].ToString());
                    string ii = c.codiceRubrica;
                    // corr.Add(c);
                    if (c.tipoIE == "I")
                    {
                        corr.Add(u.GetCorrispondenteByCodRubrica(ds.Tables[0].Rows[i][1].ToString(), c.codiceRubrica, DocsPaVO.addressbook.TipoUtente.INTERNO));
                    }
                    if (c.tipoIE == "E")
                    {
                        corr.Add(u.GetCorrispondenteByCodRubrica(ds.Tables[0].Rows[i][1].ToString(), c.codiceRubrica, DocsPaVO.addressbook.TipoUtente.ESTERNO));
                    }
                }
            }
            catch
            {
                return(null);
            }
            finally
            {
                dbProvider.Dispose();
                //semaforo.ReleaseMutex();
            }

            return(corr);
        }
コード例 #22
0
        /// <summary>
        /// Delete all the elaborate items in event monitor
        /// </summary>
        /// <returns></returns>
        public bool DeleteEvent(List <string> listIdLog)
        {
            bool   retVal    = false;
            string parameter = string.Empty;

            DocsPaUtils.Query q = DocsPaUtils.InitQuery.getInstance().getQuery("D_EVENTS_IN_MONITOR");

            int i = 1;

            foreach (string idLog in listIdLog)
            {
                if (i == listIdLog.Count)
                {
                    parameter += idLog;
                }
                else
                {
                    parameter += idLog + ",";
                }

                i++;
            }

            q.setParam("loglist", parameter);

            string queryString = q.getSQL();

            logWriter.addLog(logWriter.DEBUG, queryString);

            try
            {
                retVal = this.ExecuteNonQuery(queryString);
            }
            catch (Exception ex)
            {
                logWriter.addLog(logWriter.ERRORE, ex.Message);
                retVal = false;
            }

            logWriter.addLog(logWriter.INFO, (retVal ? listIdLog.Count.ToString() + " elementi elaborati, eliminati da DPA_EVENT_MONITOR." : "Impossibile eliminare elementi elaborati."));
            return(retVal);
        }
コード例 #23
0
        public ModelloDelega getModelloDelegaById(string idModello)
        {
            DocsPaUtils.Query queryMng = DocsPaUtils.InitQuery.getInstance().getQuery("S_GET_MODELLI_DELEGA_BY_ID");
            queryMng.setParam("idModello", idModello);
            string commandText = queryMng.getSQL();

            logger.Debug("QUERY : " + commandText);
            DataSet ds = new DataSet();

            ExecuteQuery(ds, commandText);
            if (ds.Tables[0].Rows.Count != 0)
            {
                ModelloDelega temp = buildModelloDelega(ds.Tables[0].Rows[0], null);
                return(temp);
            }
            else
            {
                return(null);
            }
        }
コード例 #24
0
        public List <DocsPaVO.Fatturazione.AssociazioneFatturaPassiva> InvioNotificheGetFatture(string stato)
        {
            logger.Debug("BEGIN");
            List <DocsPaVO.Fatturazione.AssociazioneFatturaPassiva> list = new List <DocsPaVO.Fatturazione.AssociazioneFatturaPassiva>();

            try
            {
                DocsPaUtils.Query query = DocsPaUtils.InitQuery.getInstance().getQuery("S_FATTURE_NOTIFICHE_DA_INVIARE");
                query.setParam("stato", stato);
                string command = query.getSQL();

                logger.Debug("QUERY - " + command);
                DataSet ds;

                if (!this.ExecuteQuery(out ds, command))
                {
                    throw new Exception(this.LastExceptionMessage);
                }

                if (ds != null && ds.Tables[0] != null)
                {
                    foreach (DataRow row in ds.Tables[0].Rows)
                    {
                        DocsPaVO.Fatturazione.AssociazioneFatturaPassiva item = new DocsPaVO.Fatturazione.AssociazioneFatturaPassiva();
                        item.Docnumber = row["SYSTEM_ID"].ToString();
                        item.IdFattura = row["ID_FATTURA"].ToString();
                        item.IdSdi     = row["ID_SDI"].ToString();
                        list.Add(item);
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Debug("Errore in InvioNotificheGetFatture - ", ex);
                list = null;
            }

            logger.Debug("END");
            return(list);
        }
コード例 #25
0
        /// <summary>
        /// Set the items in state CLOSED
        /// </summary>
        /// <returns></returns>
        public bool SetPassoClosed(PassoFirma passo)
        {
            bool retVal = false;

            DocsPaUtils.Query q = DocsPaUtils.InitQuery.getInstance().getQuery("U_PASSO");
            q.setParam("Id_Passo", passo.idPasso);

            string queryString = q.getSQL();

            logWriter.addLog(logWriter.DEBUG, queryString);

            try
            {
                this.ExecuteNonQuery(queryString);
            }
            catch (Exception ex)
            {
                logWriter.addLog(logWriter.ERRORE, ex.Message);
                retVal = false;
            }

            return(retVal);
        }
コード例 #26
0
        /// <summary>
        /// Delete the items in event monitor
        /// </summary>
        /// <returns></returns>
        public bool DeleteEvent(string idLog)
        {
            bool retVal = false;

            DocsPaUtils.Query q = DocsPaUtils.InitQuery.getInstance().getQuery("D_EVENT_IN_MONITOR");
            q.setParam("Id_Log", idLog);

            string queryString = q.getSQL();

            logWriter.addLog(logWriter.DEBUG, queryString);

            try
            {
                this.ExecuteNonQuery(queryString);
            }
            catch (Exception ex)
            {
                logWriter.addLog(logWriter.ERRORE, ex.Message);
                retVal = false;
            }

            logWriter.addLog(logWriter.INFO, (retVal? "Elemento conidLog = " + idLog + " eliminato correttamente da DPA_EVENT_MONITOR." : "Impossibile eliminare elemento con logId = " + idLog));
            return(retVal);
        }
コード例 #27
0
        public bool LogFatturaFirmata(string docNumber, string nomeFattura, string nomeAllegato, string logMessage)
        {
            bool result = false;

            try
            {
                logger.Debug("BEGIN");
                DocsPaUtils.Query query = DocsPaUtils.InitQuery.getInstance().getQuery("I_LOG_FATTURE_FIRMATE");
                query.setParam("docnumber", docNumber);
                query.setParam("nome_fatt", nomeFattura.Replace("'", "''"));
                query.setParam("allegato", nomeAllegato.Replace("'", "''"));
                query.setParam("data_op", DocsPaDbManagement.Functions.Functions.ToDate(DateTime.Now.ToString()));
                if (!string.IsNullOrEmpty(logMessage))
                {
                    query.setParam("msg_err", logMessage.Replace("'", "''"));
                }
                else
                {
                    query.setParam("msg_err", string.Empty);
                }

                string commandText = query.getSQL();
                logger.Debug("QUERY - " + commandText);

                if (!this.ExecuteNonQuery(commandText))
                {
                    throw new Exception(this.LastExceptionMessage);
                }
                else
                {
                    result = true;
                }

                logger.Debug("END");
            }
            catch (Exception ex)
            {
                logger.DebugFormat("Errore nell'inserimento del log: {0}\r\n{1}", ex.Message, ex.StackTrace);
                result = false;
            }

            return(result);
        }
コード例 #28
0
        /// <summary>
        /// Returns the items passo di firma
        /// </summary>
        /// <returns></returns>
        public PassoFirma GetPassoDiFirma(Evento e, string eventWithoutActor)
        {
            PassoFirma passo = new PassoFirma();

            try
            {
                DataSet           ds = new DataSet();
                DocsPaUtils.Query q  = DocsPaUtils.InitQuery.getInstance().getQuery("S_PASSO");
                q.setParam("Var_Cod_Azione", e.codiceAzione.ToString());
                q.setParam("Id_Group", e.idRuolo.ToString());
                q.setParam("Id_Processo", e.idProcesso.ToString());
                q.setParam("Id_Documento", e.idDocumento.ToString());

                q.setParam("Id_People", e.idUtente);

                string queryString = q.getSQL();

                logWriter.addLog(logWriter.DEBUG, queryString);

                this.ExecuteQuery(out ds, "Items", q.getSQL());

                if (ds.Tables["Items"] != null && ds.Tables["Items"].Rows.Count > 0)
                {
                    DataRow dr = ds.Tables["Items"].Rows[0];
                    passo.idPasso           = dr["ID_ISTANZA_PASSO"].ToString();
                    passo.numeroSequenza    = Utils.ConvertField(dr["numero_Sequenza"].ToString());
                    passo.tipoFirma         = dr["tipo_Firma"].ToString();
                    passo.idDocumeto        = e.idDocumento;
                    passo.VersionId         = dr["version_id"].ToString();
                    passo.idProcesso        = e.idProcesso;
                    passo.idRuoloCoinvolto  = e.idRuolo;
                    passo.idUtenteCoinvolto = e.idUtente;
                    passo.tipoEvento        = e.tipoEvento;
                    passo.docAll            = dr["Doc_All"].ToString();
                    passo.isAutomatico      = string.IsNullOrEmpty(dr["CHA_AUTOMATICO"].ToString()) || !dr["CHA_AUTOMATICO"].ToString().Equals("1") ? false : true;
                }
                else if (!string.IsNullOrEmpty(eventWithoutActor))
                {
                    string[] eventWithoutActorList = eventWithoutActor.Split('|');

                    q = DocsPaUtils.InitQuery.getInstance().getQuery("S_PASSO_NO_ACTOR");

                    int    valCounter     = 0;
                    string conditionToAdd = string.Empty;
                    foreach (string tipoEvento in eventWithoutActorList)
                    {
                        if (valCounter > 0)
                        {
                            conditionToAdd = conditionToAdd + ",";
                        }

                        conditionToAdd = conditionToAdd + "'" + tipoEvento + "'";
                        valCounter++;
                    }
                    q.setParam("Var_Cod_Azione", e.codiceAzione.ToString());
                    q.setParam("Cha_Tipo_Azione", conditionToAdd);

                    q.setParam("Id_Processo", e.idProcesso.ToString());
                    q.setParam("Id_Documento", e.idDocumento.ToString());

                    queryString = q.getSQL();

                    logWriter.addLog(logWriter.DEBUG, queryString);

                    this.ExecuteQuery(out ds, "Items", q.getSQL());

                    if (ds.Tables["Items"] != null && ds.Tables["Items"].Rows.Count > 0)
                    {
                        DataRow dr = ds.Tables["Items"].Rows[0];
                        passo.idPasso           = dr["ID_ISTANZA_PASSO"].ToString();
                        passo.numeroSequenza    = Utils.ConvertField(dr["numero_Sequenza"].ToString());
                        passo.tipoFirma         = dr["tipo_Firma"].ToString();
                        passo.idDocumeto        = e.idDocumento;
                        passo.VersionId         = dr["version_id"].ToString();
                        passo.idProcesso        = e.idProcesso;
                        passo.idRuoloCoinvolto  = e.idRuolo;
                        passo.idUtenteCoinvolto = e.idUtente;
                        passo.tipoEvento        = e.tipoEvento;
                        passo.docAll            = dr["Doc_All"].ToString();
                    }
                }
            }
            catch (Exception exc)
            {
                logWriter.addLog(logWriter.ERRORE, exc.Message);
            }

            logWriter.addLog(logWriter.INFO, (passo != null && !string.IsNullOrEmpty(passo.idPasso) ? "PASSO: " + passo.idPasso.ToString() : "NESSUN PASSO TROVATO."));

            return(passo);
        }
コード例 #29
0
        /// <summary>
        /// PEC 4 Modifica Maschera Caratteri
        /// Metodo di aggiornamento della status mask per i consegne e mancate consegne IS.
        ///
        /// </summary>
        /// <returns></returns>
        public bool AggiornaStatusMask(string statusmask, string codAOO, string codAmm, string idDocument)
        {
            bool retval = false;

            logger.Debug("Ricevuta interoperabilità semplificata. Aggiorno la status mask");
            try
            {
                string condition = String.Format(" UPPER(VAR_CODICE_AMM) = UPPER('{0}') AND UPPER(VAR_CODICE_AOO)= UPPER('{1}') AND ID_PROFILE={2}", codAmm, codAOO, idDocument);
                string values    = string.Format("STATUS_C_MASK = '{0}' ", statusmask);

                // Modifica per il punto esclamativo nel caso di mancata consegna IS.
                if (statusmask == "XNXNNNN")
                {
                    values += ", CHA_ANNULLATO='E', VAR_MOTIVO_ANNULLA='Errore di consegna IS' ";
                }

                DocsPaUtils.Query q = DocsPaUtils.InitQuery.getInstance().getQuery("U_DPAStatoinvio");
                q.setParam("param2", condition);
                q.setParam("param1", values);

                string updateString = q.getSQL();
                logger.Warn(updateString);
                int RowTornate = 0;
                using (DBProvider dbProvider = new DBProvider())
                {
                    retval = this.ExecuteNonQuery(updateString, out RowTornate);
                    if (RowTornate > 0)
                    {
                        logger.Warn("Aggiornamento status mask. Righe modificate: " + RowTornate);
                    }
                    else
                    {
                        logger.ErrorFormat("Aggiornamento status mask. Nessuna riga modificata per il destinatario con codice AMM {0} e codice AOO {1} per il documento {2}. FIX.", codAmm, codAOO, idDocument);
                        //if (statusmask == "ANVAAAN")
                        //{
                        //    DocsPaUtils.Query qFIX = DocsPaUtils.InitQuery.getInstance().getQuery("FIX_PEC4_SPED_IS_AVV_CONSEGNA");
                        //    qFIX.setParam("idDoc", idDocument);
                        //    string FIXstring = qFIX.getSQL();
                        //    logger.Warn(FIXstring);
                        //    int fixRowTorn = 0;
                        //    retval = this.ExecuteNonQuery(FIXstring, out fixRowTorn);
                        //    if (fixRowTorn > 0)
                        //    {
                        //        logger.Warn("Fix eseguito, righe aggiornate:" + fixRowTorn);
                        //    }
                        //    else
                        //    {
                        //        logger.Error("Errore nell'esecuzione del FIX");
                        //    }
                        //}
                        //else
                        //{
                        //    DocsPaUtils.Query qFIX = DocsPaUtils.InitQuery.getInstance().getQuery("FIX_PEC4_SPED_IS_MANCATA_CONSEGNA");
                        //    qFIX.setParam("idDoc", idDocument);
                        //    string FIXstring = qFIX.getSQL();
                        //    logger.Warn(FIXstring);
                        //    int fixRowTorn = 0;
                        //    retval = this.ExecuteNonQuery(FIXstring, out fixRowTorn);
                        //    if (fixRowTorn > 0)
                        //    {
                        //        logger.Warn("Fix eseguito, righe aggiornate:" + fixRowTorn);
                        //    }
                        //    else
                        //    {
                        //        logger.Error("Errore nell'esecuzione del FIX");
                        //    }
                        //}
                    }
                }
            }
            catch (Exception ex)
            {
                logger.ErrorFormat("Errore nell'aggiornamento della status mask: Messaggio {0} - StackTrace {1}", ex.Message, ex.StackTrace);

                retval = false;
            }

            return(retval);
        }
コード例 #30
0
        /// <summary>
        /// Returns the list of events to be processed
        /// </summary>
        /// <returns></returns>
        public List <Evento> SelectLibroFirmaEventsToBeProcessed(string[] listOfEventType)
        {
            List <Evento> listEvent = new List <Evento>();

            try
            {
                DataSet           ds = new DataSet();
                DocsPaUtils.Query q  = DocsPaUtils.InitQuery.getInstance().getQuery("S_EVENTS_IN_MONITOR");

                string conditionToAdd = "";

                if (listOfEventType != null)
                {
                    conditionToAdd = "And Dpa_Anagrafica_Eventi.Cha_tipo_evento IN (";

                    int valCounter = 0;
                    foreach (string tipoEvento in listOfEventType)
                    {
                        if (valCounter > 0)
                        {
                            conditionToAdd = conditionToAdd + ",";
                        }

                        conditionToAdd = conditionToAdd + "'" + tipoEvento + "'";
                        valCounter++;
                    }

                    conditionToAdd = conditionToAdd + ")";
                }

                q.setParam("condition", conditionToAdd);

                string queryString = q.getSQL();

                logWriter.addLog(logWriter.DEBUG, queryString);

                OpenConnection();

                if (!this.ExecuteQuery(out ds, "EventsFound", queryString))
                {
                    return(listEvent);
                }
                else
                {
                    this.CreateEventLibroFirmaObjects(ds, ref listEvent);
                }
            }
            catch (Exception exc)
            {
                logWriter.addLog(logWriter.ERRORE, exc.Message);
            }
            finally
            {
                if (listEvent.Count < 1)
                {
                    logWriter.addLog(logWriter.INFO, "NESSUN EVENTO TROVATO");
                }
                CloseConnection();
            }

            logWriter.addLog(logWriter.INFO, "Elementi da elaborare: " + (listEvent != null ? listEvent.Count.ToString() : "0"));

            return(listEvent);
        }