/// <summary> /// Metodo per il salvataggio delle impostazioni di interoperabilità semplificata relative a questo /// registro /// </summary> public void SaveSettings() { DocsPaWR.InteroperabilitySettings interoperabilitySettings = new DocsPaWR.InteroperabilitySettings(); interoperabilitySettings.IsEnabledInteroperability = this.chkEnableInterop.Checked; interoperabilitySettings.KeepPrivate = this.chkKeepPrivate.Checked; interoperabilitySettings.ManagementMode = (ManagementType)Enum.Parse(typeof(ManagementType), this.ddlManagement.SelectedValue); interoperabilitySettings.RegistryId = this.RegistryId; int appVal = 0; if (Int32.TryParse(this.RuoloResponsabile1.RoleSystemId, out appVal)) { interoperabilitySettings.RoleId = appVal; } if (Int32.TryParse(this.RuoloResponsabile1.UserSystemId, out appVal)) { interoperabilitySettings.UserId = appVal; } try { // Salvataggio delle impostazioni bool saved = InteroperabilitaSemplificataManager.SaveSimplifiedInteroperabilitySettings(interoperabilitySettings); } catch (Exception e) { throw new Exception(DocsPaUtils.Exceptions.SoapExceptionParser.GetOriginalException(e).Message); } }
/// <summary> /// Metodo per il caricamento delle impostazioni per un registro /// </summary> /// <param name="registryId">Id del registro</param> private void LoadSettings(string registryId) { try { // Caricamento dati DocsPaWR.InteroperabilitySettings interoperabilitySettings = InteroperabilitaSemplificataManager.LoadSimplifiedInteroperabilitySettings(registryId); // Visualizzazione dati this.txtInteroperabilityUrl.Text = InteroperabilitaSemplificataManager.InteroperabilityServiceUrl; if (interoperabilitySettings != null) { this.RuoloResponsabile1.RoleSystemId = interoperabilitySettings.RoleId.ToString(); this.RuoloResponsabile1.UserSystemId = interoperabilitySettings.UserId.ToString(); this.chkEnableInterop.Checked = interoperabilitySettings.IsEnabledInteroperability; this.ddlManagement.SelectedValue = interoperabilitySettings.ManagementMode.ToString(); this.chkKeepPrivate.Checked = interoperabilitySettings.KeepPrivate; } this.pnlSettings.Enabled = this.chkEnableInterop.Checked; this.chkKeepPrivate.Enabled = interoperabilitySettings.ManagementMode == ManagementType.M; } catch (Exception e) { // Alert ... } }
/// <summary> /// Metodo per la compilazione del dettaglio del corrispondente /// </summary> /// <param name="elementoRubrica">Elemento di cui impostare il dettaglio</param> /// <param name="elementoDaInviare">Elemento da cui estrarre il dettaglio</param> /// <param name="tipo">Tipo del corrispondente</param> private static void ExtractDetails(RC.Proxy.Elementi.ElementoRubrica elementoRubrica, DocsPaWR.ElementoRC elementoDaInviare, Tipo tipo) { switch (tipo) { case Tipo.UO: SetUoDetails(elementoRubrica, (DocsPaWR.ElementoRubricaUO)elementoDaInviare); break; case Tipo.RF: SetRfDetails(elementoRubrica, (DocsPaWR.ElementoRubricaRF)elementoDaInviare); break; } // Se presente la mail del registro, l'elemento rubrica è interoperante elementoRubrica.Email = elementoDaInviare.EMailRegistro; elementoRubrica.Amministrazione = elementoDaInviare.Amministrazione; elementoRubrica.AOO = elementoDaInviare.AOO; // Impostazione dell'URL (viene valorizzato solo se l'RF o il registro associato alla UO è interoperante switch (tipo) { case Tipo.UO: elementoRubrica.Urls = InteroperabilitaSemplificataManager.GetUrls(tipo, ((DocsPaWR.ElementoRubricaUO)elementoDaInviare).UO.IDCorrGlobale); break; case Tipo.RF: elementoRubrica.Urls = InteroperabilitaSemplificataManager.GetUrls(tipo, ((DocsPaWR.ElementoRubricaRF)elementoDaInviare).RF.systemId); break; } elementoRubrica.TipoCorrispondente = tipo; }
/// <summary> /// Invio dei dati della UO a rubrica comune /// </summary> protected virtual void Save() { if (this.ElementoDaInviare != null) { RC.Proxy.Elementi.ElementoRubrica elemento; // Se è un RF, vengono salvati anche i dati aggiuntivi if (this.TipoElemento == Tipo.RF) { this.RfInfo1.CompileRFProperty(this.ElementoDaInviare); this.RfInfo1.SaveRfDetails(this.ElementoDaInviare, this.IdElemento); } // L'url per l'accesso all'interoperabilità semplificata // viene inviato solo se il registro con cui è interoperante la UO // è abilitato all'IS this.ElementoDaInviare.Urls = InteroperabilitaSemplificataManager.GetUrls(this.ElementoDaInviare.TipoCorrispondente, this.IdElemento); // Impostazione del tipo di corrispondente this.ElementoDaInviare.TipoCorrispondente = this.TipoElemento; if (this.ContainsElementoRubrica(out elemento)) { // L'elemento è già stato inviato in rubrica this.ElementoDaInviare.Id = elemento.Id; this.ElementoDaInviare.Codice = elemento.Codice; this.ElementoDaInviare.Descrizione = this.txtDescrizione.Text; this.ElementoDaInviare.DataCreazione = elemento.DataCreazione; this.ElementoDaInviare.DataUltimaModifica = elemento.DataUltimaModifica; this.ElementoDaInviare.UtenteCreatore = elemento.UtenteCreatore; this.ElementoDaInviare.CHA_Pubblicato = "1"; // Modifica dati in rubrica comune this.ElementoDaInviare = this.RubricaServices.Update(this.ElementoDaInviare); } else { // Impostazione della descrizione this.ElementoDaInviare.Descrizione = this.txtDescrizione.Text; // Imposto cha_pubblicato = 1 (necessario per rendere readonly il multicasella lato amministrazione --> gestione rubrica comune this.ElementoDaInviare.CHA_Pubblicato = "1"; // Inserimento dati in rubrica comune this.ElementoDaInviare = this.RubricaServices.Insert(this.ElementoDaInviare); } } else { throw new ApplicationException("Nessun elemento trovato"); } }
/// <summary> /// </summary> /// <param name="idProfile"></param> /// <param name="reg"></param> public static bool sendNotificaAnnullamento(string idProfile, DocsPaVO.utente.Registro reg) { #region nuova gestione interop string err = ""; bool esito = true; //presume successo //todo da calcolare; try { // estrazione dati + controllo mittente est o int System.Data.DataSet dsMitt = null; System.Data.DataSet dsProto = null; DocsPaDB.Query_DocsPAWS.Interoperabilita obj = new DocsPaDB.Query_DocsPAWS.Interoperabilita(); obj.getMittSegn(out dsMitt, idProfile); if ((InteroperabilitaUtils.InteropIntNoMail || InteroperabilitaSemplificataManager.IsDocumentReceivedWithIS(idProfile)) && dsMitt != null && dsMitt.Tables[0].Rows.Count > 0 && dsMitt.Tables["INFO_MITT"].Rows[0]["CHA_TIPO_IE"] != null && !dsMitt.Tables["INFO_MITT"].Rows[0]["CHA_TIPO_IE"].Equals(System.DBNull.Value)) { obj.getDatiProtoSpedito(out dsProto, idProfile); string sep = DocsPaDB.Utils.Personalization.getInstance(reg.idAmministrazione).getSepSegnatura(); string codAmm = DocsPaDB.Utils.Personalization.getInstance(reg.idAmministrazione).getCodiceAmministrazione(); string[] protoMitt = dsMitt.Tables["INFO_MITT"].Rows[0]["VAR_PROTO_IN"].ToString().Split(sep.ToCharArray(), 2); string dataProtoMitt = dsMitt.Tables["INFO_MITT"].Rows[0]["DTA_PROTO_IN"].ToString(); string dataProto = dsProto.Tables["INFO_PROTO"].Rows[0]["DTA_PROTO"].ToString(); string numProto = dsProto.Tables["INFO_PROTO"].Rows[0]["NUM_PROTO"].ToString(); string dataAnnulla = dsProto.Tables["INFO_PROTO"].Rows[0]["DTA_ANNULLA"].ToString(); string motivoAnnulla = dsProto.Tables["INFO_PROTO"].Rows[0]["VAR_AUT_ANNULLA"].ToString(); if (protoMitt != null && dataProtoMitt != null && protoMitt.Length > 1) { DocsPaVO.Interoperabilita.NotificaAnnullamento not = new DocsPaVO.Interoperabilita.NotificaAnnullamento(); not.codAmm = codAmm; not.codAmm_Mitt = codAmm; //so che viene dalla stessa amm, ma in futuro posso valutarlo nelle multiamm, dalla dpa_stato_invio ?. not.codAOO = reg.codRegistro; not.codAOO_Mitt = protoMitt[0]; not.dataRegistr_Mitt = dataProtoMitt.Substring(0, dataProtoMitt.IndexOf(" ")); not.dataRegistrazione = dataProto.Substring(0, dataProtoMitt.IndexOf(" "));; not.numeroRegistr_Mitt = protoMitt[1]; not.numeroRegistrazione = numProto; not.dataAnnullamento = dataAnnulla; not.motivoAnnullamento = motivoAnnulla; // Se il documento è stato ricevuto per interoperabilità semplificata, l'elaborazione // viene demandata al gestore dell'IS if (InteroperabilitaSemplificataManager.IsDocumentReceivedWithIS(idProfile)) { esito = BusinessLogic.interoperabilita.Semplificata.SimplifiedInteroperabilityRecordDroppedAndExceptionManager.SendDocumentDroppedOrExceptionProofToSender(not.motivoAnnullamento, idProfile, not.codAmm, true); } else { //ATTENZIONE SOSTITUIRE CON NUOVA PROCEDURA esito = BusinessLogic.Interoperabilità.InteroperabilitaNotificaAnnullamento.processaNotificaAnnullamento(not, out err); } } dsMitt.Dispose(); dsProto.Dispose(); } else #endregion { esito = sendNotificaAnnulla(idProfile, reg); } } catch (Exception e) { esito = false; logger.Debug("Errore nella gestione dell'interoperabilità. (sendRicevutaRitorno)" + " ", e); throw e; } return(esito); }