/// <summary> /// </summary> /// <param name="infoUtente"></param> /// <param name="infoDoc"></param> /// <param name="fasc"></param> public static void cancellaAreaLavoro(string idPeople, string idRuoloInUo, string idProfile, DocsPaVO.fascicolazione.Fascicolo fasc) { logger.Debug("cancellaAreaLavoro"); DocsPaDB.Query_DocsPAWS.Documenti doc = new DocsPaDB.Query_DocsPAWS.Documenti(); /*attenzione: aggiunto controllo su fasc.systemID, in alcuni casi รจ null quindi si va in * errore */ /*if (!doc.DeleteAreaLavoro(fasc.systemID, infoDoc, infoUtente)) * { * throw new Exception(); * }*/ bool result; if (fasc == null) { result = doc.DeleteAreaLavoro(idPeople, idRuoloInUo, null, idProfile); } else { result = doc.DeleteAreaLavoro(idPeople, idRuoloInUo, fasc.systemID, idProfile); } if (!result) { //TODO : gestire la throw throw new Exception(); } #region codice originale /*DocsPaWS.Utils.Database db=DocsPaWS.Utils.dbControl.getDatabase(); * bool dbOpen=false; * try * { * db.openConnection(); * dbOpen=true; * //costruzione della query * string idPeople=infoUtente.idPeople; * string idRuoloInUo=infoUtente.idCorrGlobali; * string deleteString="DELETE FROM DPA_AREA_LAVORO WHERE ID_PEOPLE="+idPeople+" AND ID_RUOLO_IN_UO="+idRuoloInUo; * if(infoDoc!=null) * { * deleteString=deleteString+" AND ID_PROFILE="+infoDoc.idProfile; * } * else{ * deleteString=deleteString+" AND ID_PROJECT="+fasc.systemID; * } * db.executeNonQuery(deleteString); * db.closeConnection(); * } * catch(Exception e){ * if(dbOpen){ * db.closeConnection(); * } * throw e; * }*/ #endregion }