Ejemplo n.º 1
0
        /// <summary>
        /// Creazione di un elemento contenente gli attributi
        /// di un corrispondente docspa da inviare a rubrica comune
        /// </summary>
        /// <param name="infoUtente"></param>
        /// <param name="idElemento">
        /// Id dell'elemento docspa da inviare a rubrica comune
        /// </param>
        /// <param name="tipo">
        /// Tipo di elemento da salvare
        /// </param>
        /// <returns></returns>
        public static RC.Proxy.Elementi.ElementoRubrica NuovoElementoRubrica(DocsPaWR.InfoUtente infoUtente, string idElemento, Tipo tipo)
        {
            RC.Proxy.Elementi.ElementoRubrica elementoRubrica = null;

            DocsPaWR.ElementoRC elementoDaInviare = null;

            switch (tipo)
            {
                case Tipo.UO:
                    elementoDaInviare = new DocsPaWR.DocsPaWebService().GetElementoRubricaUO(infoUtente, idElemento);
                    break;
                case Tipo.RF:
                    elementoDaInviare = new DocsPaWR.DocsPaWebService().GetElementoRubricaRF(infoUtente, idElemento);
                    break;
            }

            if (elementoDaInviare != null)
            {
                // UO ancora non presente in rubrica comune
                elementoRubrica = new RC.Proxy.Elementi.ElementoRubrica();

                elementoRubrica.Codice = elementoDaInviare.CodiceRubrica;
                elementoRubrica.Descrizione = elementoDaInviare.DescrizioneRubrica;

                ExtractDetails(elementoRubrica, elementoDaInviare, tipo);
            }

            return elementoRubrica;
        }
Ejemplo n.º 2
0
        /// <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 = UIManager.SimplifiedInteroperabilityManager.GetUrls(tipo, ((DocsPaWR.ElementoRubricaUO)elementoDaInviare).UO.IDCorrGlobale);
                    break;
                case Tipo.RF:
                    elementoRubrica.Urls = UIManager.SimplifiedInteroperabilityManager.GetUrls(tipo, ((DocsPaWR.ElementoRubricaRF)elementoDaInviare).RF.systemId);
                    break;
            }


            elementoRubrica.TipoCorrispondente = tipo;

        }
Ejemplo n.º 3
0
        /// <summary>
        /// Rimozione di un elemento rubrica corrispondente ad un'unità organizzativa
        /// </summary>
        /// <param name="infoUtente"></param>
        /// <param name="idUo"></param>
        public static void EliminaElementoRubricaUO(DocsPaWR.InfoUtente infoUtente, string idUo)
        {
            RC.Proxy.Elementi.ElementoRubrica elementoRubrica = GetElementoRubricaUO(infoUtente, idUo);

            if (elementoRubrica != null)
                GetElementiRubricaServiceInstance(infoUtente).Delete(elementoRubrica);
        }
Ejemplo n.º 4
0
 private static void SetRfDetails2(RC.Proxy.Elementi.ElementoRubrica elementoRubrica, RC.Proxy.Elementi.ElementoRubrica elementoRubricaDetails)
 {
     elementoRubrica.Indirizzo     = elementoRubricaDetails.Indirizzo;
     elementoRubrica.Nazione       = elementoRubricaDetails.Nazione;
     elementoRubrica.Telefono      = elementoRubricaDetails.Telefono;
     elementoRubrica.Fax           = elementoRubricaDetails.Fax;
     elementoRubrica.Citta         = elementoRubricaDetails.Citta;
     elementoRubrica.Cap           = elementoRubricaDetails.Cap;
     elementoRubrica.Provincia     = elementoRubricaDetails.Provincia;
     elementoRubrica.CodiceFiscale = elementoRubricaDetails.CodiceFiscale;
     elementoRubrica.PartitaIva    = elementoRubricaDetails.PartitaIva;
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Reperimento di un elemento rubrica corrispondente ad un Raggruppamento Funzionale
        /// </summary>
        /// <param name="infoUtente">Informazioni sul richiedente</param>
        /// <param name="idRf">Id dell'RF</param>
        /// <returns>Informazioni sull'RF</returns>
        public static RC.Proxy.Elementi.ElementoRubrica GetElementoRubricaRF(DocsPaWR.InfoUtente infoUtente, string idRf)
        {
            RC.Proxy.Elementi.ElementoRubrica elementoRubrica = null;

            DocsPaWR.ElementoRubricaRF elementoRF = new DocsPaWR.DocsPaWebService().GetElementoRubricaRF(infoUtente, idRf);

            if (elementoRF != null)
            {
                // Ricerca dell'elemento in rubrica comune
                elementoRubrica = GetElementiRubricaServiceInstance(infoUtente).SearchSingle(elementoRF.CodiceRubrica, global::RubricaComune.Proxy.Elementi.TipiRicercaParolaEnum.ParolaIntera);
            }

            return elementoRubrica;
        }
Ejemplo n.º 6
0
        private static void SetUoDetails(RubricaComune.Proxy.Elementi.ElementoRubrica elementoRubrica, DocsPaWR.ElementoRubricaUO elementoDaInviare)
        {
            if (elementoDaInviare.UO != null && elementoDaInviare.UO.DettagliUo != null)
            {
                // Impostazione dei dati aggiuntivi
                elementoRubrica.Indirizzo = elementoDaInviare.UO.DettagliUo.Indirizzo;
                elementoRubrica.Nazione = elementoDaInviare.UO.DettagliUo.Nazione;
                elementoRubrica.Telefono = elementoDaInviare.UO.DettagliUo.Telefono1;
                elementoRubrica.Fax = elementoDaInviare.UO.DettagliUo.Fax;
                elementoRubrica.Citta = elementoDaInviare.UO.DettagliUo.Citta;
                elementoRubrica.Cap = elementoDaInviare.UO.DettagliUo.Cap;
                elementoRubrica.Provincia = elementoDaInviare.UO.DettagliUo.Provincia;
                elementoRubrica.CodiceFiscale = elementoDaInviare.UO.DettagliUo.CodiceFiscale;
                elementoRubrica.PartitaIva = elementoDaInviare.UO.DettagliUo.PartitaIva;

            }
        }
Ejemplo n.º 7
0
        private static void SetRfDetails(RubricaComune.Proxy.Elementi.ElementoRubrica elementoRubrica, DocsPaWR.ElementoRubricaRF elementoDaInviare)
        {
            if (elementoDaInviare.RF != null)
            {
                // Impostazione dei dati aggiuntivi
                elementoRubrica.Indirizzo = elementoDaInviare.RF.indirizzo;
                elementoRubrica.Nazione = elementoDaInviare.RF.nazionalita;
                elementoRubrica.Telefono = elementoDaInviare.RF.telefono1;
                elementoRubrica.Fax = elementoDaInviare.RF.fax;
                elementoRubrica.Citta = elementoDaInviare.RF.citta;
                elementoRubrica.Cap = elementoDaInviare.RF.cap;
                elementoRubrica.Provincia = elementoDaInviare.RF.prov;
                elementoRubrica.CodiceFiscale = elementoDaInviare.RF.codfisc;
                elementoRubrica.PartitaIva = elementoDaInviare.RF.partitaiva;


            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Creazione di un elemento contenente gli attributi
        /// di un corrispondente docspa da inviare a rubrica comune
        /// </summary>
        /// <param name="infoUtente"></param>
        /// <param name="idElemento">
        /// Id dell'elemento docspa da inviare a rubrica comune
        /// </param>
        /// <param name="tipo">
        /// Tipo di elemento da salvare
        /// </param>
        /// <returns></returns>
        public static RC.Proxy.Elementi.ElementoRubrica NuovoElementoRubrica(DocsPaWR.InfoUtente infoUtente, string idElemento, Tipo tipo)
        {
            RC.Proxy.Elementi.ElementoRubrica elementoRubrica = null;

            DocsPaWR.ElementoRC elementoDaInviare = null;

            switch (tipo)
            {
            case Tipo.UO:
                elementoDaInviare = new DocsPaWR.DocsPaWebService().GetElementoRubricaUO(infoUtente, idElemento);
                break;

            case Tipo.RF:
                elementoDaInviare = new DocsPaWR.DocsPaWebService().GetElementoRubricaRF(infoUtente, idElemento);
                break;
            }

            if (elementoDaInviare != null)
            {
                // UO ancora non presente in rubrica comune
                elementoRubrica = new RC.Proxy.Elementi.ElementoRubrica();

                elementoRubrica.Codice      = elementoDaInviare.CodiceRubrica;
                elementoRubrica.Descrizione = elementoDaInviare.DescrizioneRubrica;

                ExtractDetails(elementoRubrica, elementoDaInviare, tipo);
                if (tipo.Equals(Tipo.RF) && elementoDaInviare.CodiceRubrica != null)
                {
                    // Ricerca dell'elemento in rubrica comune
                    RC.Proxy.Elementi.ElementoRubrica elementoRubricaDetails = new RC.Proxy.Elementi.ElementoRubrica();
                    elementoRubricaDetails = GetElementiRubricaServiceInstance(infoUtente).SearchSingle(elementoDaInviare.CodiceRubrica, global::RubricaComune.Proxy.Elementi.TipiRicercaParolaEnum.ParolaIntera);
                    if (elementoRubricaDetails != null)
                    {
                        SetRfDetails2(elementoRubrica, elementoRubricaDetails);
                    }
                }
            }

            return(elementoRubrica);
        }
Ejemplo n.º 9
0
 /// <remarks/>
 public void UpdateMulticasellaAsync(ElementoRubrica elemento)
 {
     this.UpdateMulticasellaAsync(elemento, null);
 }
Ejemplo n.º 10
0
 /// <remarks/>
 public void DeleteAsync(ElementoRubrica elemento)
 {
     this.DeleteAsync(elemento, null);
 }
Ejemplo n.º 11
0
 public void Delete(ElementoRubrica elemento)
 {
     this.Invoke("Delete", new object[] {
         elemento
     });
 }
Ejemplo n.º 12
0
 /// <remarks/>
 public void UpdateAsync(ElementoRubrica elemento)
 {
     this.UpdateAsync(elemento, null);
 }
Ejemplo n.º 13
0
 /// <remarks/>
 public void InsertAsync(ElementoRubrica elemento)
 {
     this.InsertAsync(elemento, null);
 }
Ejemplo n.º 14
0
        /// <summary>
        /// Verifica se esiste già un elemento rubrica con il codice visualizzato
        /// </summary>
        /// <param name="elemento">
        /// Elemento rubrica esistente
        /// </param>
        /// <returns></returns>
        protected bool ContainsElementoRubrica(out RC.Proxy.Elementi.ElementoRubrica elemento)
        {
            elemento = this.RubricaServices.SearchSingle(this.ElementoDaInviare.Codice);

            return (elemento != null);
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Caricamento dati
        /// </summary>
        protected virtual void Fetch()
        {
            SAAdminTool.AdminTool.Manager.SessionManager sessionManager = new SAAdminTool.AdminTool.Manager.SessionManager();

            RC.Proxy.Elementi.ElementoRubrica elementoDaInviare = null;

            // Reperimento elemento rubrica relativo all'elemento da inviare
            switch (this.TipoElemento)
            {
                case Tipo.UO:
                    elementoDaInviare = RubricaComune.RubricaServices.NuovoElementoRubrica(sessionManager.getUserAmmSession(), this.IdElemento, this.TipoElemento);
                    break;
                case Tipo.RF:
                    elementoDaInviare = RubricaComune.RubricaServices.NuovoElementoRubrica(sessionManager.getUserAmmSession(), this.IdElemento, this.TipoElemento);
                    break;
            
            }

            if (elementoDaInviare != null)
            {
                this.txtCodice.Text = elementoDaInviare.Codice;

                // Se è valorizzata la proprietà Descrizione, viene visualizzata come descrizione del corrispondente
                // da inviare ad RC, altrimenti viene mostrata la descrizione del corrispondente pubblicato in RC
                if (String.IsNullOrEmpty(this.Descrizione))
                    this.txtDescrizione.Text = elementoDaInviare.Descrizione;
                else
                    this.txtDescrizione.Text = this.Descrizione;

                string idReg = (this.TipoElemento == Tipo.RF) ? this.IdElemento : (from r in
                                                                                       UserManager.getRegistriByCodAmm(elementoDaInviare.Amministrazione, "0")
                                                                                   where r.Codice.Equals(elementoDaInviare.AOO)
                                                                                   select r).FirstOrDefault() != null ?
                                                                                        (from r in
                                                                                             UserManager.getRegistriByCodAmm(elementoDaInviare.Amministrazione, "0")
                                                                                         where r.Codice.Equals(elementoDaInviare.AOO)
                                                                                         select r).First().IDRegistro : null;
                    

                // Se si stanno visualizzando i dati di un RF, vengono visualizzati anche i dettagli
                if (this.TipoElemento == Tipo.RF)
                    this.RfInfo1.ShowRfProperty(elementoDaInviare);
                if (!string.IsNullOrEmpty(idReg))
                {
                    DocsPaWR.CasellaRegistro[] caselle = SAAdminTool.utils.MultiCasellaManager.GetMailRegistro(idReg);
                    System.Collections.Generic.List<EmailInfo> listEmails = new System.Collections.Generic.List<EmailInfo>();
                    foreach (DocsPaWR.CasellaRegistro c in caselle)
                    {
                        listEmails.Add(new EmailInfo
                        {
                            Email = c.EmailRegistro,
                            Note = c.Note,
                            Preferita = (c.Principale.Equals("1")) ? true : false
                        });
                    }
                    if (listEmails != null && listEmails.Count > 0)
                        elementoDaInviare.Emails = listEmails.ToArray();

                }

                this.ElementoDaInviare = elementoDaInviare;
            }
            else
                throw new ApplicationException("Nessun elemento trovato");
        }