public static bool UpdateExtApplication(DocsPaVO.utente.ExtApplication applicazione) { bool result = true; DocsPaUtils.Query q; string queryString; try { using (DocsPaDB.DBProvider dbProvider = new DBProvider()) { q = DocsPaUtils.InitQuery.getInstance().getQuery("U_DPA_APPLICAZIONE"); q.setParam("param1", applicazione.codice); q.setParam("param2", applicazione.descrizione); q.setParam("param3", applicazione.systemId); queryString = q.getSQL(); logger.Debug(queryString); if (!dbProvider.ExecuteNonQuery(queryString)) { result = false; dbProvider.RollbackTransaction(); throw new Exception(); } } } catch (Exception e) { result = false; logger.Debug(e.Message); } return(result); }
public static ArrayList GetExtApplications() { ArrayList appicazioni = new ArrayList(); using (DocsPaDB.DBProvider dbProvider = new DBProvider()) { logger.Debug("getExtApplication"); Query query = DocsPaUtils.InitQuery.getInstance().getQuery("S_DPA_APPLICAZIONI"); string commandText = query.getSQL(); logger.Debug(commandText); DataSet dataSet; if (dbProvider.ExecuteQuery(out dataSet, "DPA_EXT_APPS", commandText)) { foreach (DataRow dataRow in dataSet.Tables["DPA_EXT_APPS"].Rows) { DocsPaVO.utente.ExtApplication extApp = new DocsPaVO.utente.ExtApplication(); extApp.systemId = dataRow["SYSTEM_ID"].ToString(); extApp.codice = dataRow["VAR_CODE"].ToString(); extApp.descrizione = dataRow["DESCRIPTION"].ToString(); appicazioni.Add(extApp); } dataSet.Dispose(); } else { logger.Debug("Errore nell'esecuzione della query in 'getExtApplications'"); throw new ApplicationException("Errore nell'esecuzione della query 'getExtApplications'"); } } return(appicazioni); }
//Creazione di una nuova delega public static bool CreateNewExtApplication(DocsPaVO.utente.ExtApplication applicazione) { bool result = true; DocsPaUtils.Query q; string queryString; try { using (DocsPaDB.DBProvider dbProvider = new DBProvider()) { q = DocsPaUtils.InitQuery.getInstance().getQuery("I_DPA_APPLICAZIONE"); q.setParam("paramA", DocsPaDbManagement.Functions.Functions.GetSystemIdColName()); q.setParam("paramB", DocsPaDbManagement.Functions.Functions.GetSystemIdNextVal("DPA_EXT_APPS")); q.setParam("param1", applicazione.codice); q.setParam("param2", applicazione.descrizione); queryString = q.getSQL(); logger.Debug("Inserimento nuova applicazione: "); logger.Debug(queryString); if (!dbProvider.ExecuteNonQuery(queryString)) { result = false; dbProvider.RollbackTransaction(); throw new Exception(); } } } catch (Exception e) { result = false; logger.Debug(e.Message); } return(result); }