/// <summary> /// Metodo per la chiusura del TASK /// </summary> /// <param name="idTask"></param> /// <param name="infoUtente"></param> /// <returns></returns> public static bool ChiudiLavorazioneTask(DocsPaVO.Task.Task task, string note, DocsPaVO.utente.InfoUtente infoUtente) { logger.Debug("Chiusura del TASK in BusinessLogic.Task.TaskManager - metodo: ChiudiLavorazioneTask "); bool result = false; try { DocsPaDB.Query_DocsPAWS.Task t = new DocsPaDB.Query_DocsPAWS.Task(); result = t.ChiudiLavorazioneTask(task.STATO_TASK.ID_STATO_TASK, task.STATO_TASK.NOTE_LAVORAZIONE, infoUtente); if (!result) { throw new Exception("Errore nella chiusura della lavorazione del task ID=" + task.ID_TASK); } // Se è presente un documento in risposta aggiorno nella profile lo stato del task if (!string.IsNullOrEmpty(task.ID_PROFILE_REVIEW)) { result = t.UpdateTaskStatusInProfile(task.ID_PROFILE_REVIEW, DocsPaDB.Query_DocsPAWS.Task.TaskStatus.CLOSED); } //Aggiorno le note nella dpa_trasm_utente if (result) { result = t.UpdateNoteTrasmUtente(task.ID_TRASM_SINGOLA, note, infoUtente); } } catch (Exception e) { logger.Debug("Errore in BusinessLogic.Task.TaskManager - metodo: CloseTask ", e); result = false; } return(result); }
/// <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 static bool AssociaContributoAlTask(DocsPaVO.Task.Task task, DocsPaVO.documento.SchedaDocumento schedaDoc, DocsPaVO.utente.InfoUtente infoUtente) { logger.Debug("Chiusura del TASK in BusinessLogic.Task.TaskManager - metodo: AssociaContributoAlTask "); bool result = false; try { DocsPaDB.Query_DocsPAWS.Task t = new DocsPaDB.Query_DocsPAWS.Task(); result = t.AssociaContributoAlTask(task.ID_TASK, schedaDoc.docNumber, infoUtente); // Aggiorno la profile result = t.UpdateTaskStatusInProfile(schedaDoc.docNumber, DocsPaDB.Query_DocsPAWS.Task.TaskStatus.IN_PROGRESS); //Dò visibilità al ruolo mittente del task.Se il contributo viene inserito nel fascicolo da cui è partito il task non è necessario if (result && !string.IsNullOrEmpty(task.ID_PROFILE)) { DocsPaVO.trasmissione.Trasmissione resultTrasm = ExecuteTransmission(schedaDoc, task.RUOLO_MITTENTE.idGruppo, task.UTENTE_MITTENTE.idPeople, infoUtente); string desc = string.Empty; string method = "TRASM_DOC_" + (resultTrasm.trasmissioniSingole[0] as DocsPaVO.trasmissione.TrasmissioneSingola).ragione.descrizione.ToUpper().Replace(" ", "_"); if (resultTrasm.infoDocumento.segnatura == null) { desc = "Trasmesso Documento : " + resultTrasm.infoDocumento.docNumber.ToString(); } else { desc = "Trasmesso Documento : " + resultTrasm.infoDocumento.segnatura.ToString(); } if (resultTrasm != null) { BusinessLogic.UserLog.UserLog.WriteLog(resultTrasm.utente.userId, resultTrasm.utente.idPeople, resultTrasm.ruolo.idGruppo, resultTrasm.utente.idAmministrazione, method, resultTrasm.infoDocumento.docNumber, desc, DocsPaVO.Logger.CodAzione.Esito.OK, (infoUtente != null && infoUtente.delegato != null ? infoUtente.delegato : null), "0", (resultTrasm.trasmissioniSingole[0] as DocsPaVO.trasmissione.TrasmissioneSingola).systemId); } else { BusinessLogic.UserLog.UserLog.WriteLog(resultTrasm.utente.userId, resultTrasm.utente.idPeople, resultTrasm.ruolo.idGruppo, resultTrasm.utente.idAmministrazione, method, resultTrasm.infoDocumento.docNumber, desc, DocsPaVO.Logger.CodAzione.Esito.KO, (infoUtente != null && infoUtente.delegato != null ? infoUtente.delegato : null), "0", (resultTrasm.trasmissioniSingole[0] as DocsPaVO.trasmissione.TrasmissioneSingola).systemId); } } } catch (Exception e) { logger.Debug("Errore in BusinessLogic.Task.TaskManager - metodo: AssociaContributoAlTask ", e); result = false; } return(result); }