public DocsPaVO.FriendApplication.SchedaDocumento DocumentoProtocolla(string friendApplication, string codiceRegistro, DocsPaVO.FriendApplication.SchedaDocumento schedaDocumento) { try { DocsPaVO.documento.SchedaDocumento schedaDocumentoDocsPaResult = null; DocsPaVO.FriendApplication.FriendApplication objFriendApplication = BusinessLogic.FriendApplication.FriendApplicationManager.getFriendApplication(friendApplication, codiceRegistro); if (objFriendApplication == null) { throw new Exception("Friend application non censita in docspa"); } string token = WS_Smart.GetToken(objFriendApplication.utente, objFriendApplication.ruolo); DocsPaVO.utente.InfoUtente infoUtente = DocsPaWS.SmartServices.Utils.getInfoUtenteFromToken(token); DocsPaVO.documento.SchedaDocumento schedaDocumentoTrasformata = this.getSchedaDocumentoDocsPa(schedaDocumento, objFriendApplication, infoUtente); DocsPaVO.documento.ResultProtocollazione risultatoProtocollazione = new DocsPaVO.documento.ResultProtocollazione(); schedaDocumentoDocsPaResult = WS_Smart.DocumentoProtocolla(token, schedaDocumentoTrasformata, out risultatoProtocollazione); if (schedaDocumentoDocsPaResult != null) { DocsPaVO.FriendApplication.SchedaDocumento schedaResultLite = this.getSchedaDocumentoLite(schedaDocumentoDocsPaResult, schedaDocumento); return(schedaResultLite); } else { logger.Debug("Errore in DocsPaWSFriendApplication - metodo : DocumentoProtocolla " + risultatoProtocollazione.ToString()); throw new Exception("ERRORE - Creazione protocollo " + risultatoProtocollazione.ToString()); } } catch (Exception ex) { logger.Debug("Errore in DocsPaWSFriendApplication - metodo : DocumentoProtocolla", ex); throw ex; } }
private DocsPaVO.FriendApplication.SchedaDocumento getSchedaDocumentoLite(DocsPaVO.documento.SchedaDocumento schedaDocumento, DocsPaVO.FriendApplication.SchedaDocumento schedaDocumentoLite) { try { schedaDocumentoLite.systemId = schedaDocumento.systemId; schedaDocumentoLite.docNumber = schedaDocumento.docNumber; schedaDocumentoLite.codiceRegistro = schedaDocumento.registro.codRegistro; schedaDocumentoLite.segnatura = schedaDocumento.protocollo.segnatura; schedaDocumentoLite.dataCreazione = schedaDocumento.dataCreazione; //Protocollo in Uscita if (schedaDocumentoLite.tipoProto.ToUpper() == "P".ToUpper()) { DocsPaVO.documento.ProtocolloUscita protoPartenza = (DocsPaVO.documento.ProtocolloUscita)schedaDocumento.protocollo; schedaDocumentoLite.dataProtocollo = protoPartenza.dataProtocollazione; schedaDocumentoLite.numeroProtocollo = protoPartenza.numero; } //Protocollo in Arrivo if (schedaDocumentoLite.tipoProto.ToUpper() == "A".ToUpper()) { DocsPaVO.documento.ProtocolloEntrata protoArrivo = (DocsPaVO.documento.ProtocolloEntrata)schedaDocumento.protocollo; schedaDocumentoLite.dataProtocollo = protoArrivo.dataProtocollazione; schedaDocumentoLite.numeroProtocollo = protoArrivo.numero; } //Protocollo Interno if (schedaDocumentoLite.tipoProto.ToUpper() == "I".ToUpper()) { DocsPaVO.documento.ProtocolloInterno protoInterno = (DocsPaVO.documento.ProtocolloInterno)schedaDocumento.protocollo; schedaDocumentoLite.dataProtocollo = protoInterno.dataProtocollazione; schedaDocumentoLite.numeroProtocollo = protoInterno.numero; } return(schedaDocumentoLite); } catch (Exception ex) { logger.Debug("Errore in DocsPaWSFriendApplication - metodo : getSchedaDocumentoLite", ex); throw ex; } }
private DocsPaVO.documento.SchedaDocumento getSchedaDocumentoDocsPa(DocsPaVO.FriendApplication.SchedaDocumento schedaDocumentoLite, DocsPaVO.FriendApplication.FriendApplication objFriendApplication, DocsPaVO.utente.InfoUtente infoUtente) { try { //Creo e valorizzo una Scheda Documento DocsPaVO.documento.SchedaDocumento schedaDocumentoTrasformata = new DocsPaVO.documento.SchedaDocumento(); schedaDocumentoTrasformata.appId = "ACROBAT"; schedaDocumentoTrasformata.idPeople = objFriendApplication.idPeopleFactory; schedaDocumentoTrasformata.typeId = "LETTERA"; schedaDocumentoTrasformata.userId = objFriendApplication.utente.userId; schedaDocumentoTrasformata.noteDocumento = new List <DocsPaVO.Note.InfoNota>(); schedaDocumentoTrasformata.noteDocumento.Add(new DocsPaVO.Note.InfoNota(schedaDocumentoLite.note, objFriendApplication.utente.systemId, objFriendApplication.ruolo.systemId, null)); DocsPaVO.documento.Oggetto oggetto = new DocsPaVO.documento.Oggetto(); oggetto.descrizione = schedaDocumentoLite.oggetto; schedaDocumentoTrasformata.oggetto = oggetto; //Protocollo in Partenza if (schedaDocumentoLite.tipoProto.ToUpper() == "P".ToUpper()) { DocsPaVO.documento.ProtocolloUscita protoPartenza = new DocsPaVO.documento.ProtocolloUscita(); //Aggiungo il mittente if (schedaDocumentoLite.mittente != null) { DocsPaVO.utente.Corrispondente mittente = ricercaCorr(schedaDocumentoLite.mittente, infoUtente); if (mittente != null) { protoPartenza.mittente = mittente; } } //Aggiungo i destinatari protoPartenza.destinatari = new ArrayList(); foreach (DocsPaVO.FriendApplication.CorrLite corrLite in schedaDocumentoLite.destinatari) { protoPartenza.destinatari.Add(ricercaCorr(corrLite, infoUtente)); } schedaDocumentoTrasformata.protocollo = protoPartenza; schedaDocumentoTrasformata.tipoProto = "P"; } //Protocollo in Arrivo if (schedaDocumentoLite.tipoProto.ToUpper() == "A".ToUpper()) { DocsPaVO.documento.ProtocolloEntrata protoArrivo = new DocsPaVO.documento.ProtocolloEntrata(); //Aggiungo il mittente DocsPaVO.utente.Corrispondente mittente = ricercaCorr(schedaDocumentoLite.mittente, infoUtente); protoArrivo.mittente = mittente; schedaDocumentoTrasformata.protocollo = protoArrivo; schedaDocumentoTrasformata.tipoProto = "A"; } //Protocollo Interno if (schedaDocumentoLite.tipoProto.ToUpper() == "I".ToUpper()) { DocsPaVO.documento.ProtocolloInterno protoInterno = new DocsPaVO.documento.ProtocolloInterno(); //Aggiungo il mittente DocsPaVO.utente.Corrispondente mittente = ricercaCorr(schedaDocumentoLite.mittente, infoUtente); protoInterno.mittente = mittente; //Aggiungo i destinatari protoInterno.destinatari = new ArrayList(); foreach (DocsPaVO.FriendApplication.CorrLite corrLite in schedaDocumentoLite.destinatari) { protoInterno.destinatari.Add(ricercaCorr(corrLite, infoUtente)); } schedaDocumentoTrasformata.protocollo = protoInterno; schedaDocumentoTrasformata.tipoProto = "I"; } schedaDocumentoTrasformata.registro = objFriendApplication.registro; return(schedaDocumentoTrasformata); } catch (Exception ex) { logger.Debug("Errore in DocsPaWSFriendApplication - metodo : setSchedaDocumento", ex); throw ex; } }