Update steamware libs x gestione metodi conf da DB priam ceh file
This commit is contained in:
Vendored
+1
-1
@@ -10,7 +10,7 @@ pipeline {
|
||||
steps {
|
||||
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
|
||||
script {
|
||||
withEnv(['NEXT_BUILD_NUMBER=622']) {
|
||||
withEnv(['NEXT_BUILD_NUMBER=623']) {
|
||||
// env.versionNumber = VersionNumber(versionNumberString : '3.1.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
|
||||
env.versionNumber = VersionNumber(versionNumberString : '3.1.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
|
||||
env.APP_NAME = 'SteamWareLib'
|
||||
|
||||
+1448
-1451
File diff suppressed because it is too large
Load Diff
@@ -89,7 +89,7 @@ namespace SteamWare
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
answ = memLayer.ML.confReadBool("forceUppercase");
|
||||
answ = memLayer.ML.CRB("forceUppercase");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace SteamWare
|
||||
string answ = chiaro;
|
||||
try
|
||||
{
|
||||
answ = SteamCrypto.EncryptString(chiaro, memLayer.ML.confReadString("CodModulo"));
|
||||
answ = SteamCrypto.EncryptString(chiaro, memLayer.ML.CRS("CodModulo"));
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -120,7 +120,7 @@ namespace SteamWare
|
||||
string answ = cifrato;
|
||||
try
|
||||
{
|
||||
answ = SteamCrypto.DecryptString(cifrato, memLayer.ML.confReadString("CodModulo"));
|
||||
answ = SteamCrypto.DecryptString(cifrato, memLayer.ML.CRS("CodModulo"));
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -163,7 +163,7 @@ namespace SteamWare
|
||||
{
|
||||
trovati += taUtenti.getByEmailAK(email, md5UserAuthKey).Rows.Count;
|
||||
// se abilitato anche plain controlla pure li...
|
||||
if (memLayer.ML.confReadBool("enablePlain"))
|
||||
if (memLayer.ML.CRB("enablePlain"))
|
||||
{
|
||||
trovati += taUtenti.getByEmailAK(email, AuthKey).Rows.Count;
|
||||
}
|
||||
@@ -190,7 +190,7 @@ namespace SteamWare
|
||||
if (adminEmail != "")
|
||||
{
|
||||
// mando email ad admin x reset utente...
|
||||
string oggetto = string.Format("L'utente {0} ha richiesto il reset della sua AuthKey.<br/><br/>Seguire il <a href=\"{1}/{2}\">link seguente</a> per approvare o rifiutare la richiesta", email, memLayer.ML.confReadString("baseUrl"), memLayer.ML.confReadString("urlGestUtenti"));
|
||||
string oggetto = string.Format("L'utente {0} ha richiesto il reset della sua AuthKey.<br/><br/>Seguire il <a href=\"{1}/{2}\">link seguente</a> per approvare o rifiutare la richiesta", email, memLayer.ML.CRS("baseUrl"), memLayer.ML.CRS("urlGestUtenti"));
|
||||
gestEmail.geAuth.mandaEmail(email, adminEmail, "Richiesta reset AuthKey utente", oggetto);
|
||||
}
|
||||
}
|
||||
@@ -208,8 +208,8 @@ namespace SteamWare
|
||||
// calcolo chiave MD5...
|
||||
string md5hashPasswd = encodeKey(hashPasswd);
|
||||
// mando email ad admin x reset utente...
|
||||
string oggetto = string.Format("Hi,<br/><br/>This is an automatic message generated by {3} platform on behalf of platform admin.<br/><br/><a href=\"{0}/resetPassword?hash={1}&email={2}\">Please click on following link (or cut/paste to your preferred browser)</a> to reset your password to {3} login.<br/><br/>Regards.", memLayer.ML.confReadString("baseUrl"), HttpUtility.UrlEncode(md5hashPasswd), email, webAppName);
|
||||
gestEmail.geAuth.mandaEmail(memLayer.ML.confReadString("_fromEmail"), email, webAppName, oggetto);
|
||||
string oggetto = string.Format("Hi,<br/><br/>This is an automatic message generated by {3} platform on behalf of platform admin.<br/><br/><a href=\"{0}/resetPassword?hash={1}&email={2}\">Please click on following link (or cut/paste to your preferred browser)</a> to reset your password to {3} login.<br/><br/>Regards.", memLayer.ML.CRS("baseUrl"), HttpUtility.UrlEncode(md5hashPasswd), email, webAppName);
|
||||
gestEmail.geAuth.mandaEmail(memLayer.ML.CRS("_fromEmail"), email, webAppName, oggetto);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
@@ -232,7 +232,7 @@ namespace SteamWare
|
||||
/// <param name="SiteName">nome del sito</param>
|
||||
/// <param name="subject">chiave (in chiaro)</param>
|
||||
/// <param name="body">body (in formato da completare string.format con 4 parametri che verrano inseriti come i seguenti:
|
||||
/// {0} = baseURL - memLayer.ML.confReadString("baseUrl")
|
||||
/// {0} = baseURL - memLayer.ML.CRS("baseUrl")
|
||||
/// {1} = chaive encoded - HttpUtility.UrlEncode(md5UserAuthKey)
|
||||
/// {2} = email destinatario
|
||||
/// {3} = subject
|
||||
@@ -246,8 +246,8 @@ namespace SteamWare
|
||||
// calcolo chiave MD5...
|
||||
string md5UserAuthKey = encodeKey(AuthKey);
|
||||
// mando email ad admin x reset utente...
|
||||
string oggetto = string.Format(body, memLayer.ML.confReadString("baseUrl"), HttpUtility.UrlEncode(md5UserAuthKey), email, SiteName);
|
||||
gestEmail.geAuth.mandaEmail(memLayer.ML.confReadString("_fromEmail"), email, subject, oggetto);
|
||||
string oggetto = string.Format(body, memLayer.ML.CRS("baseUrl"), HttpUtility.UrlEncode(md5UserAuthKey), email, SiteName);
|
||||
gestEmail.geAuth.mandaEmail(memLayer.ML.CRS("_fromEmail"), email, subject, oggetto);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
@@ -258,7 +258,11 @@ namespace SteamWare
|
||||
get
|
||||
{
|
||||
int answ = memLayer.ML.CRI("maxAuth");
|
||||
if (answ < 0) answ = 1000;
|
||||
if (answ < 0)
|
||||
{
|
||||
answ = 1000;
|
||||
}
|
||||
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
@@ -279,7 +283,7 @@ namespace SteamWare
|
||||
// calcolo il secret...
|
||||
DateTime adesso = DateTime.Now;
|
||||
string Secret = string.Format("{0}|{1}|{2}", email, DeviceName, adesso);
|
||||
string devSecret = SteamCrypto.EncryptString(Secret, passphrase(memLayer.ML.confReadString("CodModulo"), UserAuthKey));
|
||||
string devSecret = SteamCrypto.EncryptString(Secret, passphrase(memLayer.ML.CRS("CodModulo"), UserAuthKey));
|
||||
try
|
||||
{
|
||||
// registro chiave x il device
|
||||
@@ -313,7 +317,7 @@ namespace SteamWare
|
||||
string answ = "AuthDevice";
|
||||
try
|
||||
{
|
||||
answ = memLayer.ML.confReadString("AuthCookieName");
|
||||
answ = memLayer.ML.CRS("AuthCookieName");
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
@@ -932,7 +936,11 @@ namespace SteamWare
|
||||
{
|
||||
logger.lg.scriviLog(exc.ToString(), tipoLog.EXCEPTION);
|
||||
}
|
||||
if (_lingua == "") _lingua = "EN";
|
||||
if (_lingua == "")
|
||||
{
|
||||
_lingua = "EN";
|
||||
}
|
||||
|
||||
lingua = _lingua;
|
||||
}
|
||||
|
||||
|
||||
+299
-298
@@ -2,314 +2,315 @@ using System;
|
||||
|
||||
namespace SteamWare
|
||||
{
|
||||
/// <summary>
|
||||
/// classe gestione logging esteso di eventi e note utente (correlabili)
|
||||
/// </summary>
|
||||
public class log2note
|
||||
{
|
||||
#region area protected
|
||||
|
||||
/// <summary>
|
||||
/// classe gestione logging esteso di eventi e note utente (correlabili)
|
||||
/// TableAdapter di accesso alla tabella anagrafica filtraggi
|
||||
/// </summary>
|
||||
public class log2note
|
||||
protected DS_loggingTableAdapters.T_anagFiltroTableAdapter taAnagFilt;
|
||||
/// <summary>
|
||||
/// TableAdapter di accesso alla tabella anagrafica record
|
||||
/// </summary>
|
||||
protected DS_loggingTableAdapters.T_anagRecordTableAdapter taAnagRec;
|
||||
/// <summary>
|
||||
/// TableAdapter di accesso alla tabella logging record di eventi
|
||||
/// </summary>
|
||||
protected DS_loggingTableAdapters.T_logRecordsTableAdapter taLogRec;
|
||||
/// <summary>
|
||||
/// TableAdapter di accesso alla tabella logging utente
|
||||
/// </summary>
|
||||
protected DS_loggingTableAdapters.T_logUtenteTableAdapter taLogUt;
|
||||
/// <summary>
|
||||
/// TableAdapter di accesso alla vista logging eventi
|
||||
/// </summary>
|
||||
public DS_loggingTableAdapters.v_logRecordsTableAdapter ta_vLogRec;
|
||||
/// <summary>
|
||||
/// TableAdapter di accesso alla vista logging utente
|
||||
/// </summary>
|
||||
public DS_loggingTableAdapters.v_logUtenteTableAdapter ta_vLogUt;
|
||||
|
||||
/// <summary>
|
||||
/// effettua setup dei connection strings da web.config delal singola applicazione
|
||||
/// </summary>
|
||||
protected void setupConnectionString()
|
||||
{
|
||||
#region area protected
|
||||
|
||||
/// <summary>
|
||||
/// TableAdapter di accesso alla tabella anagrafica filtraggi
|
||||
/// </summary>
|
||||
protected DS_loggingTableAdapters.T_anagFiltroTableAdapter taAnagFilt;
|
||||
/// <summary>
|
||||
/// TableAdapter di accesso alla tabella anagrafica record
|
||||
/// </summary>
|
||||
protected DS_loggingTableAdapters.T_anagRecordTableAdapter taAnagRec;
|
||||
/// <summary>
|
||||
/// TableAdapter di accesso alla tabella logging record di eventi
|
||||
/// </summary>
|
||||
protected DS_loggingTableAdapters.T_logRecordsTableAdapter taLogRec;
|
||||
/// <summary>
|
||||
/// TableAdapter di accesso alla tabella logging utente
|
||||
/// </summary>
|
||||
protected DS_loggingTableAdapters.T_logUtenteTableAdapter taLogUt;
|
||||
/// <summary>
|
||||
/// TableAdapter di accesso alla vista logging eventi
|
||||
/// </summary>
|
||||
public DS_loggingTableAdapters.v_logRecordsTableAdapter ta_vLogRec;
|
||||
/// <summary>
|
||||
/// TableAdapter di accesso alla vista logging utente
|
||||
/// </summary>
|
||||
public DS_loggingTableAdapters.v_logUtenteTableAdapter ta_vLogUt;
|
||||
|
||||
/// <summary>
|
||||
/// effettua setup dei connection strings da web.config delal singola applicazione
|
||||
/// </summary>
|
||||
protected void setupConnectionString()
|
||||
{
|
||||
// cambio le connString
|
||||
taAnagFilt.Connection.ConnectionString = memLayer.ML.confReadString("LoggingConnectionString");
|
||||
taAnagRec.Connection.ConnectionString = memLayer.ML.confReadString("LoggingConnectionString");
|
||||
taLogRec.Connection.ConnectionString = memLayer.ML.confReadString("LoggingConnectionString");
|
||||
taLogUt.Connection.ConnectionString = memLayer.ML.confReadString("LoggingConnectionString");
|
||||
ta_vLogUt.Connection.ConnectionString = memLayer.ML.confReadString("LoggingConnectionString");
|
||||
ta_vLogRec.Connection.ConnectionString = memLayer.ML.confReadString("LoggingConnectionString");
|
||||
}
|
||||
/// <summary>
|
||||
/// avvio i tari tableAdapters
|
||||
/// </summary>
|
||||
private void setupTA()
|
||||
{
|
||||
taAnagFilt = new SteamWare.DS_loggingTableAdapters.T_anagFiltroTableAdapter();
|
||||
taAnagRec = new SteamWare.DS_loggingTableAdapters.T_anagRecordTableAdapter();
|
||||
taLogRec = new SteamWare.DS_loggingTableAdapters.T_logRecordsTableAdapter();
|
||||
taLogUt = new SteamWare.DS_loggingTableAdapters.T_logUtenteTableAdapter();
|
||||
ta_vLogRec = new SteamWare.DS_loggingTableAdapters.v_logRecordsTableAdapter();
|
||||
ta_vLogUt = new SteamWare.DS_loggingTableAdapters.v_logUtenteTableAdapter();
|
||||
}
|
||||
/// <summary>
|
||||
/// avvio della classe istanziando db e
|
||||
/// </summary>
|
||||
log2note()
|
||||
{
|
||||
setupTA();
|
||||
setupConnectionString();
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region area public
|
||||
|
||||
/// <summary>
|
||||
/// oggetto statico di accesso ai metodi della classe...
|
||||
/// </summary>
|
||||
public static log2note l2n = new log2note();
|
||||
|
||||
#region area oggetti restituiti
|
||||
|
||||
/// <summary>
|
||||
/// tabella eventi
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DS_logging.v_logRecordsDataTable tabLogEventi()
|
||||
{
|
||||
return ta_vLogRec.GetData();
|
||||
}
|
||||
/// <summary>
|
||||
/// tabella note
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DS_logging.v_logUtenteDataTable tabLogNote()
|
||||
{
|
||||
return ta_vLogUt.GetData();
|
||||
}
|
||||
/// <summary>
|
||||
/// tabella eventi secondo filtro
|
||||
/// </summary>
|
||||
/// <param name="filtro">filtro gestito come condizione "LIKE '%{0}%'" rispetto al filtro salvato con l'evento</param>
|
||||
/// <returns></returns>
|
||||
public DS_logging.v_logRecordsDataTable tabLogEventi(string filtro)
|
||||
{
|
||||
return ta_vLogRec.getByFiltro(filtro);
|
||||
}
|
||||
/// <summary>
|
||||
/// tabella note secondo filtro
|
||||
/// </summary>
|
||||
/// <param name="filtro">filtro gestito come condizione "LIKE '%{0}%'" rispetto al filtro salvato con l'evento</param>
|
||||
/// <returns></returns>
|
||||
public DS_logging.v_logUtenteDataTable tabLogNote(string filtro)
|
||||
{
|
||||
return ta_vLogUt.getByFiltro(filtro);
|
||||
}
|
||||
/// <summary>
|
||||
/// tabella eventi secondo filtro e condizione ulteriore WHERE esplicitata
|
||||
/// </summary>
|
||||
/// <param name="filtro">filtro gestito come condizione "LIKE '%{0}%'" rispetto al filtro salvato con l'evento</param>
|
||||
/// <param name="_where">ulteriore condizione WHERE per filtrare i dati (testo {0} della condizione "WHERE {0}" </param>
|
||||
/// <returns></returns>
|
||||
public DS_logging.v_logRecordsDataTable tabLogEventi(string filtro, string _where)
|
||||
{
|
||||
DS_logging.v_logRecordsDataTable _tab = new DS_logging.v_logRecordsDataTable();
|
||||
foreach (DS_logging.v_logRecordsRow riga in ta_vLogRec.getByFiltro(filtro).Select(_where))
|
||||
{
|
||||
_tab.Addv_logRecordsRow(riga);
|
||||
}
|
||||
return _tab;
|
||||
}
|
||||
/// <summary>
|
||||
/// tabella note secondo filtro e condizione ulteriore WHERE esplicitata
|
||||
/// </summary>
|
||||
/// <param name="filtro">filtro gestito come condizione "LIKE '%{0}%'" rispetto al filtro salvato con l'evento</param>
|
||||
/// <param name="_where">ulteriore condizione WHERE per filtrare i dati (testo {0} della condizione "WHERE {0}" </param>
|
||||
/// <returns></returns>
|
||||
public DS_logging.v_logUtenteDataTable tabLogNote(string filtro, string _where)
|
||||
{
|
||||
DS_logging.v_logUtenteDataTable _tab = new DS_logging.v_logUtenteDataTable();
|
||||
foreach (DS_logging.v_logUtenteRow riga in ta_vLogUt.getByFiltro(filtro).Select(_where))
|
||||
{
|
||||
_tab.Addv_logUtenteRow(riga);
|
||||
}
|
||||
return _tab;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// tabella note secondo filtro
|
||||
/// </summary>
|
||||
/// <param name="filtro">filtro gestito come condizione "LIKE '%{0}%'" rispetto al filtro salvato con l'evento</param>
|
||||
/// <returns></returns>
|
||||
public DS_logging.T_logUtenteDataTable tabLogUt(string filtro)
|
||||
{
|
||||
return taLogUt.getByFiltro(filtro);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region area insert valori
|
||||
|
||||
/// <summary>
|
||||
/// inserisce l'evento indicato dai parametri
|
||||
/// </summary>
|
||||
/// <param name="_userEv">user che ha generato l'evento</param>
|
||||
/// <param name="_pagina">pagina/form applicaizone in cui l'evento si è generato</param>
|
||||
/// <param name="_valOrig">valore originale(se c'è)</param>
|
||||
/// <param name="_valNew">valore nuovo/modificato</param>
|
||||
/// <param name="_evento">descrizione evento (poi gestita con anagrafica interna)</param>
|
||||
/// <param name="_filtro">filtro logico evento (poi gestita con anagrafica interna)</param>
|
||||
public void insEvento(string _userEv, string _pagina, string _valOrig, string _valNew, string _evento, string _filtro)
|
||||
{
|
||||
taLogRec.sp_insRecFull(_userEv, _pagina, _valOrig, _valNew, _evento, _filtro);
|
||||
}
|
||||
/// <summary>
|
||||
/// inserisce la nota utente indicata dai parametri, restituisce idx della nota creata...
|
||||
/// </summary>
|
||||
/// <param name="_userNota">user che ha inserito la nota</param>
|
||||
/// <param name="_nota">testo della nota</param>
|
||||
/// <param name="_val">valore ulteriore da associare alla nota (es: label, codice, versione, ...)</param>
|
||||
/// <param name="_filtro">filtro logico evento (poi gestita con anagrafica interna)</param>
|
||||
/// <returns>intero dell'idx della nota creata</returns>
|
||||
public int insNota(string _userNota, string _nota, string _val, string _filtro)
|
||||
{
|
||||
int? answ = 0;
|
||||
taLogUt.sp_insLogUtFull(_userNota, _nota, _val, _filtro, ref answ);
|
||||
return (int)answ;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region area gestione eventi (cestina, delete, associazione a note,...)
|
||||
|
||||
/// <summary>
|
||||
/// associa l'evento e la nota indicati
|
||||
/// </summary>
|
||||
/// <param name="idxRecord">idx del record da associare</param>
|
||||
/// <param name="_idxNota">idx chiave della nota da associare</param>
|
||||
public void associaEvento2Nota(int idxRecord, int _idxNota)
|
||||
{
|
||||
taLogRec.sp_setRec2nota(idxRecord, _idxNota);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// associa l'ultimo evento del filtro indicato alla nota
|
||||
/// </summary>
|
||||
/// <param name="filtro">filtro associato all'ultimo evento...</param>
|
||||
/// <param name="_idxNota">idx chiave della nota da associare</param>
|
||||
public void associaLastEvento2Nota(string filtro, int _idxNota)
|
||||
{
|
||||
taLogRec.sp_setLastRec2nota(filtro, _idxNota);
|
||||
}
|
||||
/// <summary>
|
||||
/// segna come cestinati tutti gli eventi dell'utente indicato non ancora associati o cestinati
|
||||
/// </summary>
|
||||
/// <param name="_userEv">utente generatore dell'evento</param>
|
||||
public void cestinaEventiUser(string _userEv)
|
||||
{
|
||||
taLogRec.sp_cestinaLogRecUt(_userEv);
|
||||
}
|
||||
/// <summary>
|
||||
/// segna come cestinati tutti gli eventi dell'utente indicato non ancora associati o cestinati
|
||||
/// </summary>
|
||||
/// <param name="_filtro">utente generatore dell'evento</param>
|
||||
public void cestinaEventiFiltro(string _filtro)
|
||||
{
|
||||
taLogRec.sp_cestinaLogRecFiltro(_filtro);
|
||||
}
|
||||
/// <summary>
|
||||
/// Elimina gli eventi cestinati generati dall'utente indicato
|
||||
/// </summary>
|
||||
/// <param name="_userEv">utente generatore dell'evento</param>
|
||||
public void eliminaEventiDaUser(string _userEv)
|
||||
{
|
||||
taLogRec.sp_deleteLogUser(_userEv);
|
||||
}
|
||||
/// <summary>
|
||||
/// Elimina gli eventi cestinati anteriori alla data selezionata
|
||||
/// </summary>
|
||||
/// <param name="_dataOra">dataOra dell'evento</param>
|
||||
public void associaEvento2Nota(DateTime _dataOra)
|
||||
{
|
||||
taLogRec.sp_deleteLogMaxData(_dataOra);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// effettua la registrazione dell'evento in session
|
||||
/// </summary>
|
||||
public void registraEventi(string _userEv, string _pagina)
|
||||
{
|
||||
// controllo: loggin SOLO se la scheda ha logging abilitato nella riga del db...
|
||||
bool logEn = memLayer.ML.BoolSessionObj("logEn");
|
||||
memLayer.ML.emptySessionVal("logEn");
|
||||
if (logEn)
|
||||
{
|
||||
// leggo e svuoto info x logging
|
||||
string ev2log = memLayer.ML.StringSessionObj("ev2log");
|
||||
memLayer.ML.emptySessionVal("ev2log");
|
||||
string valOrig = memLayer.ML.StringSessionObj("valOrig");
|
||||
memLayer.ML.emptySessionVal("valOrig");
|
||||
string valNew = memLayer.ML.StringSessionObj("valNew");
|
||||
memLayer.ML.emptySessionVal("valNew");
|
||||
string filtEv = memLayer.ML.StringSessionObj("filtEv");
|
||||
memLayer.ML.emptySessionVal("filtEv");
|
||||
// effettuo logging evento
|
||||
l2n.insEvento(_userEv,_pagina, valOrig, valNew, ev2log, filtEv);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
// cambio le connString
|
||||
string _connectionString = memLayer.ML.confReadString("LoggingConnectionString");
|
||||
taAnagFilt.Connection.ConnectionString = _connectionString;
|
||||
taAnagRec.Connection.ConnectionString = _connectionString;
|
||||
taLogRec.Connection.ConnectionString = _connectionString;
|
||||
taLogUt.Connection.ConnectionString = _connectionString;
|
||||
ta_vLogUt.Connection.ConnectionString = _connectionString;
|
||||
ta_vLogRec.Connection.ConnectionString = _connectionString;
|
||||
}
|
||||
/// <summary>
|
||||
/// metodo di comportamento del controllo di logging
|
||||
/// avvio i tari tableAdapters
|
||||
/// </summary>
|
||||
public enum logControlMode
|
||||
private void setupTA()
|
||||
{
|
||||
/// <summary>
|
||||
/// nasconde pannello log
|
||||
/// </summary>
|
||||
hideLog,
|
||||
/// <summary>
|
||||
/// memorizza log inserito
|
||||
/// </summary>
|
||||
recordLog,
|
||||
/// <summary>
|
||||
/// mostra pannello log
|
||||
/// </summary>
|
||||
showLog
|
||||
taAnagFilt = new DS_loggingTableAdapters.T_anagFiltroTableAdapter();
|
||||
taAnagRec = new DS_loggingTableAdapters.T_anagRecordTableAdapter();
|
||||
taLogRec = new DS_loggingTableAdapters.T_logRecordsTableAdapter();
|
||||
taLogUt = new DS_loggingTableAdapters.T_logUtenteTableAdapter();
|
||||
ta_vLogRec = new DS_loggingTableAdapters.v_logRecordsTableAdapter();
|
||||
ta_vLogUt = new DS_loggingTableAdapters.v_logUtenteTableAdapter();
|
||||
}
|
||||
/// <summary>
|
||||
/// metodo di comportamento del controllo di logging
|
||||
/// avvio della classe istanziando db e
|
||||
/// </summary>
|
||||
public enum tipoApprovazione
|
||||
log2note()
|
||||
{
|
||||
/// <summary>
|
||||
/// indica il primo step del doppio livello di approvazione (completamento)
|
||||
/// </summary>
|
||||
completamento,
|
||||
/// <summary>
|
||||
/// SOLO con incremento indice di revisione dell'oggetto approvato
|
||||
/// </summary>
|
||||
revisione,
|
||||
/// <summary>
|
||||
/// SOLO mantenendo indice di revisione corrente
|
||||
/// </summary>
|
||||
semplice,
|
||||
/// <summary>
|
||||
/// permette SIA con revisione che senza (e anche rev -1)
|
||||
/// </summary>
|
||||
tutto
|
||||
setupTA();
|
||||
setupConnectionString();
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region area public
|
||||
|
||||
/// <summary>
|
||||
/// oggetto statico di accesso ai metodi della classe...
|
||||
/// </summary>
|
||||
public static log2note l2n = new log2note();
|
||||
|
||||
#region area oggetti restituiti
|
||||
|
||||
/// <summary>
|
||||
/// tabella eventi
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DS_logging.v_logRecordsDataTable tabLogEventi()
|
||||
{
|
||||
return ta_vLogRec.GetData();
|
||||
}
|
||||
/// <summary>
|
||||
/// tabella note
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DS_logging.v_logUtenteDataTable tabLogNote()
|
||||
{
|
||||
return ta_vLogUt.GetData();
|
||||
}
|
||||
/// <summary>
|
||||
/// tabella eventi secondo filtro
|
||||
/// </summary>
|
||||
/// <param name="filtro">filtro gestito come condizione "LIKE '%{0}%'" rispetto al filtro salvato con l'evento</param>
|
||||
/// <returns></returns>
|
||||
public DS_logging.v_logRecordsDataTable tabLogEventi(string filtro)
|
||||
{
|
||||
return ta_vLogRec.getByFiltro(filtro);
|
||||
}
|
||||
/// <summary>
|
||||
/// tabella note secondo filtro
|
||||
/// </summary>
|
||||
/// <param name="filtro">filtro gestito come condizione "LIKE '%{0}%'" rispetto al filtro salvato con l'evento</param>
|
||||
/// <returns></returns>
|
||||
public DS_logging.v_logUtenteDataTable tabLogNote(string filtro)
|
||||
{
|
||||
return ta_vLogUt.getByFiltro(filtro);
|
||||
}
|
||||
/// <summary>
|
||||
/// tabella eventi secondo filtro e condizione ulteriore WHERE esplicitata
|
||||
/// </summary>
|
||||
/// <param name="filtro">filtro gestito come condizione "LIKE '%{0}%'" rispetto al filtro salvato con l'evento</param>
|
||||
/// <param name="_where">ulteriore condizione WHERE per filtrare i dati (testo {0} della condizione "WHERE {0}" </param>
|
||||
/// <returns></returns>
|
||||
public DS_logging.v_logRecordsDataTable tabLogEventi(string filtro, string _where)
|
||||
{
|
||||
DS_logging.v_logRecordsDataTable _tab = new DS_logging.v_logRecordsDataTable();
|
||||
foreach (DS_logging.v_logRecordsRow riga in ta_vLogRec.getByFiltro(filtro).Select(_where))
|
||||
{
|
||||
_tab.Addv_logRecordsRow(riga);
|
||||
}
|
||||
return _tab;
|
||||
}
|
||||
/// <summary>
|
||||
/// tabella note secondo filtro e condizione ulteriore WHERE esplicitata
|
||||
/// </summary>
|
||||
/// <param name="filtro">filtro gestito come condizione "LIKE '%{0}%'" rispetto al filtro salvato con l'evento</param>
|
||||
/// <param name="_where">ulteriore condizione WHERE per filtrare i dati (testo {0} della condizione "WHERE {0}" </param>
|
||||
/// <returns></returns>
|
||||
public DS_logging.v_logUtenteDataTable tabLogNote(string filtro, string _where)
|
||||
{
|
||||
DS_logging.v_logUtenteDataTable _tab = new DS_logging.v_logUtenteDataTable();
|
||||
foreach (DS_logging.v_logUtenteRow riga in ta_vLogUt.getByFiltro(filtro).Select(_where))
|
||||
{
|
||||
_tab.Addv_logUtenteRow(riga);
|
||||
}
|
||||
return _tab;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// tabella note secondo filtro
|
||||
/// </summary>
|
||||
/// <param name="filtro">filtro gestito come condizione "LIKE '%{0}%'" rispetto al filtro salvato con l'evento</param>
|
||||
/// <returns></returns>
|
||||
public DS_logging.T_logUtenteDataTable tabLogUt(string filtro)
|
||||
{
|
||||
return taLogUt.getByFiltro(filtro);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region area insert valori
|
||||
|
||||
/// <summary>
|
||||
/// inserisce l'evento indicato dai parametri
|
||||
/// </summary>
|
||||
/// <param name="_userEv">user che ha generato l'evento</param>
|
||||
/// <param name="_pagina">pagina/form applicaizone in cui l'evento si è generato</param>
|
||||
/// <param name="_valOrig">valore originale(se c'è)</param>
|
||||
/// <param name="_valNew">valore nuovo/modificato</param>
|
||||
/// <param name="_evento">descrizione evento (poi gestita con anagrafica interna)</param>
|
||||
/// <param name="_filtro">filtro logico evento (poi gestita con anagrafica interna)</param>
|
||||
public void insEvento(string _userEv, string _pagina, string _valOrig, string _valNew, string _evento, string _filtro)
|
||||
{
|
||||
taLogRec.sp_insRecFull(_userEv, _pagina, _valOrig, _valNew, _evento, _filtro);
|
||||
}
|
||||
/// <summary>
|
||||
/// inserisce la nota utente indicata dai parametri, restituisce idx della nota creata...
|
||||
/// </summary>
|
||||
/// <param name="_userNota">user che ha inserito la nota</param>
|
||||
/// <param name="_nota">testo della nota</param>
|
||||
/// <param name="_val">valore ulteriore da associare alla nota (es: label, codice, versione, ...)</param>
|
||||
/// <param name="_filtro">filtro logico evento (poi gestita con anagrafica interna)</param>
|
||||
/// <returns>intero dell'idx della nota creata</returns>
|
||||
public int insNota(string _userNota, string _nota, string _val, string _filtro)
|
||||
{
|
||||
int? answ = 0;
|
||||
taLogUt.sp_insLogUtFull(_userNota, _nota, _val, _filtro, ref answ);
|
||||
return (int)answ;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region area gestione eventi (cestina, delete, associazione a note,...)
|
||||
|
||||
/// <summary>
|
||||
/// associa l'evento e la nota indicati
|
||||
/// </summary>
|
||||
/// <param name="idxRecord">idx del record da associare</param>
|
||||
/// <param name="_idxNota">idx chiave della nota da associare</param>
|
||||
public void associaEvento2Nota(int idxRecord, int _idxNota)
|
||||
{
|
||||
taLogRec.sp_setRec2nota(idxRecord, _idxNota);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// associa l'ultimo evento del filtro indicato alla nota
|
||||
/// </summary>
|
||||
/// <param name="filtro">filtro associato all'ultimo evento...</param>
|
||||
/// <param name="_idxNota">idx chiave della nota da associare</param>
|
||||
public void associaLastEvento2Nota(string filtro, int _idxNota)
|
||||
{
|
||||
taLogRec.sp_setLastRec2nota(filtro, _idxNota);
|
||||
}
|
||||
/// <summary>
|
||||
/// segna come cestinati tutti gli eventi dell'utente indicato non ancora associati o cestinati
|
||||
/// </summary>
|
||||
/// <param name="_userEv">utente generatore dell'evento</param>
|
||||
public void cestinaEventiUser(string _userEv)
|
||||
{
|
||||
taLogRec.sp_cestinaLogRecUt(_userEv);
|
||||
}
|
||||
/// <summary>
|
||||
/// segna come cestinati tutti gli eventi dell'utente indicato non ancora associati o cestinati
|
||||
/// </summary>
|
||||
/// <param name="_filtro">utente generatore dell'evento</param>
|
||||
public void cestinaEventiFiltro(string _filtro)
|
||||
{
|
||||
taLogRec.sp_cestinaLogRecFiltro(_filtro);
|
||||
}
|
||||
/// <summary>
|
||||
/// Elimina gli eventi cestinati generati dall'utente indicato
|
||||
/// </summary>
|
||||
/// <param name="_userEv">utente generatore dell'evento</param>
|
||||
public void eliminaEventiDaUser(string _userEv)
|
||||
{
|
||||
taLogRec.sp_deleteLogUser(_userEv);
|
||||
}
|
||||
/// <summary>
|
||||
/// Elimina gli eventi cestinati anteriori alla data selezionata
|
||||
/// </summary>
|
||||
/// <param name="_dataOra">dataOra dell'evento</param>
|
||||
public void associaEvento2Nota(DateTime _dataOra)
|
||||
{
|
||||
taLogRec.sp_deleteLogMaxData(_dataOra);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// effettua la registrazione dell'evento in session
|
||||
/// </summary>
|
||||
public void registraEventi(string _userEv, string _pagina)
|
||||
{
|
||||
// controllo: loggin SOLO se la scheda ha logging abilitato nella riga del db...
|
||||
bool logEn = memLayer.ML.BoolSessionObj("logEn");
|
||||
memLayer.ML.emptySessionVal("logEn");
|
||||
if (logEn)
|
||||
{
|
||||
// leggo e svuoto info x logging
|
||||
string ev2log = memLayer.ML.StringSessionObj("ev2log");
|
||||
memLayer.ML.emptySessionVal("ev2log");
|
||||
string valOrig = memLayer.ML.StringSessionObj("valOrig");
|
||||
memLayer.ML.emptySessionVal("valOrig");
|
||||
string valNew = memLayer.ML.StringSessionObj("valNew");
|
||||
memLayer.ML.emptySessionVal("valNew");
|
||||
string filtEv = memLayer.ML.StringSessionObj("filtEv");
|
||||
memLayer.ML.emptySessionVal("filtEv");
|
||||
// effettuo logging evento
|
||||
l2n.insEvento(_userEv, _pagina, valOrig, valNew, ev2log, filtEv);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
/// <summary>
|
||||
/// metodo di comportamento del controllo di logging
|
||||
/// </summary>
|
||||
public enum logControlMode
|
||||
{
|
||||
/// <summary>
|
||||
/// nasconde pannello log
|
||||
/// </summary>
|
||||
hideLog,
|
||||
/// <summary>
|
||||
/// memorizza log inserito
|
||||
/// </summary>
|
||||
recordLog,
|
||||
/// <summary>
|
||||
/// mostra pannello log
|
||||
/// </summary>
|
||||
showLog
|
||||
}
|
||||
/// <summary>
|
||||
/// metodo di comportamento del controllo di logging
|
||||
/// </summary>
|
||||
public enum tipoApprovazione
|
||||
{
|
||||
/// <summary>
|
||||
/// indica il primo step del doppio livello di approvazione (completamento)
|
||||
/// </summary>
|
||||
completamento,
|
||||
/// <summary>
|
||||
/// SOLO con incremento indice di revisione dell'oggetto approvato
|
||||
/// </summary>
|
||||
revisione,
|
||||
/// <summary>
|
||||
/// SOLO mantenendo indice di revisione corrente
|
||||
/// </summary>
|
||||
semplice,
|
||||
/// <summary>
|
||||
/// permette SIA con revisione che senza (e anche rev -1)
|
||||
/// </summary>
|
||||
tutto
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,16 +48,16 @@ namespace SteamWare
|
||||
{
|
||||
try
|
||||
{
|
||||
_logBaseDir = SteamwareStrings.getFilePath(memLayer.ML.confReadString("_logDir"));
|
||||
_logBaseDir = SteamwareStrings.getFilePath(memLayer.ML.CRS("_logDir"));
|
||||
}
|
||||
catch
|
||||
{
|
||||
_logBaseDir = memLayer.ML.confReadString("logLocalDir");
|
||||
_logBaseDir = memLayer.ML.CRS("logLocalDir");
|
||||
}
|
||||
_logMaxMb = 100; // di default 100 mb...
|
||||
try
|
||||
{
|
||||
_doShrinkFolder = memLayer.ML.confReadBool("doShrinkFolder");
|
||||
_doShrinkFolder = memLayer.ML.CRB("doShrinkFolder");
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -74,7 +74,7 @@ namespace SteamWare
|
||||
int answ = -1;
|
||||
try
|
||||
{
|
||||
answ = memLayer.ML.confReadInt("_logLevel");
|
||||
answ = memLayer.ML.CRI("_logLevel");
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -158,10 +158,10 @@ namespace SteamWare
|
||||
try
|
||||
{
|
||||
// se abilitato output diagnostica...
|
||||
if (memLayer.ML.confReadBool("enableDumpDiag"))
|
||||
if (memLayer.ML.CRB("enableDumpDiag"))
|
||||
{
|
||||
string[] pingTagets = SteamWare.StringSplitter.CSplitter.Split(memLayer.ML.confReadString("pingTargets"), "#", true, -1, SteamWare.StringSplitter.ComparisonMethod.Text);
|
||||
string[] wwwTagets = SteamWare.StringSplitter.CSplitter.Split(memLayer.ML.confReadString("wwwTargets"), "#", true, -1, SteamWare.StringSplitter.ComparisonMethod.Text);
|
||||
string[] pingTagets = SteamWare.StringSplitter.CSplitter.Split(memLayer.ML.CRS("pingTargets"), "#", true, -1, SteamWare.StringSplitter.ComparisonMethod.Text);
|
||||
string[] wwwTagets = SteamWare.StringSplitter.CSplitter.Split(memLayer.ML.CRS("wwwTargets"), "#", true, -1, SteamWare.StringSplitter.ComparisonMethod.Text);
|
||||
// chiamo scrittura diagnostica
|
||||
scriviDiagnostica("DUMP diagnostico causa Eccezione", pingTagets, wwwTagets);
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@ namespace SteamWare
|
||||
{
|
||||
get
|
||||
{
|
||||
return memLayer.ML.confReadString("CodModulo");
|
||||
return memLayer.ML.CRS("CodModulo");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -778,7 +778,7 @@ namespace SteamWare
|
||||
// controllo la pwd
|
||||
if (checkUserPwd(_username, _pwd))
|
||||
{
|
||||
dominio = memLayer.ML.confReadString("defaultDomain"); // forzo a valore web.config per non incappare in errori successivi
|
||||
dominio = memLayer.ML.CRS("defaultDomain"); // forzo a valore web.config per non incappare in errori successivi
|
||||
utente = _username;
|
||||
passwd = _pwd;
|
||||
setupRigaByUsername();
|
||||
@@ -847,7 +847,7 @@ namespace SteamWare
|
||||
bool echoLemmi = false;
|
||||
try
|
||||
{
|
||||
echoLemmi = memLayer.ML.confReadBool("echoLemmi");
|
||||
echoLemmi = memLayer.ML.CRB("echoLemmi");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
@@ -896,7 +896,7 @@ namespace SteamWare
|
||||
bool authSenzaDominio = false;
|
||||
try
|
||||
{
|
||||
authSenzaDominio = memLayer.ML.confReadBool("authSenzaDominio");
|
||||
authSenzaDominio = memLayer.ML.CRB("authSenzaDominio");
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
|
||||
@@ -620,7 +620,7 @@ namespace SteamWare
|
||||
var mailer = new MimeMailer(_smtpCli, port);
|
||||
mailer.User = _username;
|
||||
mailer.Password = _password;
|
||||
if (memLayer.ML.confReadBool("_enableSSL"))
|
||||
if (memLayer.ML.CRB("_enableSSL"))
|
||||
{
|
||||
mailer.SslType = SslMode.Tls;
|
||||
//mailer.SslType = SslMode.Ssl;
|
||||
@@ -739,7 +739,7 @@ namespace SteamWare
|
||||
//_smtpClient.UseDefaultCredentials = false;
|
||||
//_smtpClient.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
|
||||
_smtpClient.Credentials = new System.Net.NetworkCredential(_username, _password);
|
||||
_smtpClient.EnableSsl = memLayer.ML.confReadBool("_enableSSL");
|
||||
_smtpClient.EnableSsl = memLayer.ML.CRB("_enableSSL");
|
||||
|
||||
// verifico se ci sia timeout...
|
||||
if (memLayer.ML.CRI("_smtpTimeout") > 0)
|
||||
@@ -889,11 +889,11 @@ namespace SteamWare
|
||||
/// <summary>
|
||||
/// metodo singleton gestione email...
|
||||
/// </summary>
|
||||
public static gestEmail ge = new gestEmail(memLayer.ML.confReadString("_smtpCli"));
|
||||
public static gestEmail ge = new gestEmail(memLayer.ML.CRS("_smtpCli"));
|
||||
/// <summary>
|
||||
/// metodo singleton gestione email CON AUTH utente...
|
||||
/// </summary>
|
||||
public static gestEmail geAuth = new gestEmail(memLayer.ML.confReadString("_smtpCli"), memLayer.ML.confReadString("_emailUser"), memLayer.ML.confReadString("_emailPwd"));
|
||||
public static gestEmail geAuth = new gestEmail(memLayer.ML.CRS("_smtpCli"), memLayer.ML.CRS("_emailUser"), memLayer.ML.CRS("_emailPwd"));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user