コード例 #1
0
        public static RicercaSmistamentoElement AggiungiElementoRicerca(string idElemento, string tipo, InfoUtente infoUtente, string idRegistro)
        {
            //List<RicercaSmistamentoElement> elements = new List<RicercaSmistamentoElement>();

            //string tipo = idElemento.Split('§')[0];
            //string id = idElemento.Split('§')[1];

            try
            {
                RicercaSmistamentoElement el = new RicercaSmistamentoElement();

                // RUOLO
                if (tipo.Equals("R"))
                {
                    string idGruppo            = BusinessLogic.Utenti.UserManager.getRuoloById(idElemento).idGruppo;
                    DocsPaVO.utente.Ruolo role = BusinessLogic.Utenti.UserManager.getRuoloByIdGruppo(idGruppo);

                    el.IdUO = role.uo.systemId;

                    el.IdRuolo          = idElemento;
                    el.DescrizioneRuolo = role.descrizione;

                    el.Type = SmistamentoNodeType.RUOLO;
                }
                // UTENTE
                else
                {
                    DocsPaVO.utente.Utente ut = BusinessLogic.Utenti.UserManager.getUtenteById(idElemento);
                    ut.ruoli = BusinessLogic.Utenti.UserManager.getRuoliUtente(idElemento);
                    Ruolo role = ((Ruolo[])ut.ruoli.ToArray(typeof(Ruolo))).FirstOrDefault();

                    el.IdUO = role.uo.systemId;

                    el.IdRuolo = role.systemId;
                    //el.DescrizioneRuolo = role.descrizione;

                    el.IdUtente          = ut.idPeople;
                    el.DescrizioneUtente = ut.cognome + " " + ut.nome;

                    el.Type = SmistamentoNodeType.UTENTE;
                }

                return(el);
            }
            catch (Exception ex)
            {
                logger.Debug("Elemento non trovato - tipo=" + tipo + ", id=" + idElemento);
                return(null);
            }
        }
コード例 #2
0
        private RicercaSmistamentoElement FillRicercaSmistamentoElement(DataRow row)
        {
            RicercaSmistamentoElement res = new RicercaSmistamentoElement();
            string tipo = row["cha_tipo_urp"].ToString();

            if ("P".Equals(tipo))
            {
                res.Type              = SmistamentoNodeType.UTENTE;
                res.IdUtente          = row["id_people"].ToString();
                res.IdRuolo           = row["id_ruolo"].ToString();
                res.IdUO              = row["id_uo"].ToString();
                res.DescrizioneUtente = row["var_desc_corr"].ToString();
                res.DescrizioneRuolo  = null;
                res.DescrizioneUO     = null;
            }
            else if ("R".Equals(tipo))
            {
                // MEV SMISTAMENTO
                // aggiungo alla ricerca gli utenti nel ruolo selezionato
                string idPeople = row["id_people"].ToString();
                if (idPeople.Equals("0"))
                {
                    res.Type             = SmistamentoNodeType.RUOLO;
                    res.IdRuolo          = row["id_ruolo"].ToString();
                    res.IdUO             = row["id_uo"].ToString();
                    res.DescrizioneRuolo = row["var_desc_corr"].ToString();
                    res.DescrizioneUO    = null;
                }
                // aggiunta
                else
                {
                    res.Type              = SmistamentoNodeType.UTENTE;
                    res.IdUtente          = row["id_people"].ToString();
                    res.IdRuolo           = row["id_ruolo"].ToString();
                    res.IdUO              = row["id_uo"].ToString();
                    res.DescrizioneUtente = row["var_desc_corr"].ToString();
                    res.DescrizioneRuolo  = row["id_ruolo"].ToString();
                    res.DescrizioneUO     = null;
                }
                // fine aggiunta
            }
            else
            {
                res.Type          = SmistamentoNodeType.UO;
                res.IdUO          = row["id_uo"].ToString();
                res.DescrizioneUO = row["var_desc_corr"].ToString();
            };
            logger.Debug(res.Type.ToString() + " - " + res.DescrizioneUtente + " - " + res.DescrizioneRuolo);
            return(res);
        }
コード例 #3
0
        /// <summary>
        /// MEV SMISTAMENTO
        /// Metodo per l'esecuzione della ricerca da mobile
        /// E' seguita la stessa logica della versione desktop
        /// </summary>
        /// <param name="descrizione"></param>
        /// <param name="infoUtente"></param>
        /// <param name="idRegistro"></param>
        /// <param name="idRuolo"></param>
        /// <param name="ragione"></param>
        /// <param name="numMaxResults"></param>
        /// <returns></returns>
        public static List <RicercaSmistamentoElement> GetListaCorrispondentiVeloce(string descrizione, InfoUtente infoUtente, string idRegistro, string idRuolo, string ragione, int numMaxResults)
        {
            DocsPaVO.rubrica.ParametriRicercaRubrica qco = new DocsPaVO.rubrica.ParametriRicercaRubrica();

            List <RicercaSmistamentoElement> elements = new List <RicercaSmistamentoElement>();

            qco.caller            = new DocsPaVO.rubrica.ParametriRicercaRubrica.CallerIdentity();
            qco.parent            = "";
            qco.caller.IdRuolo    = idRuolo;
            qco.caller.IdRegistro = idRegistro;
            qco.descrizione       = descrizione;

            #region RAGIONE DI TRASMISSIONE

            DocsPaVO.amministrazione.InfoAmministrazione amm = BusinessLogic.Amministrazione.AmministraManager.AmmGetInfoAmmCorrente(infoUtente.idAmministrazione);
            string idRagione = string.Empty;
            switch (ragione)
            {
            case "comp":
                idRagione = amm.IDRagioneCompetenza;
                break;

            case "con":
                idRagione = amm.IDRagioneConoscenza;
                break;
            }
            DocsPaVO.trasmissione.RagioneTrasmissione ragTrasm = BusinessLogic.Trasmissioni.QueryTrasmManager.getRagioneById(idRagione);
            switch (ragTrasm.tipoDestinatario.ToString("g").Substring(0, 1))
            {
            case "T":
                qco.calltype = DocsPaVO.rubrica.ParametriRicercaRubrica.CallType.CALLTYPE_TRASM_ALL;
                break;

            case "I":
                qco.calltype = DocsPaVO.rubrica.ParametriRicercaRubrica.CallType.CALLTYPE_TRASM_INF;
                break;

            case "S":
                qco.calltype = DocsPaVO.rubrica.ParametriRicercaRubrica.CallType.CALLTYPE_TRASM_SUP;
                break;

            case "P":
                qco.calltype = DocsPaVO.rubrica.ParametriRicercaRubrica.CallType.CALLTYPE_TRASM_PARILIVELLO;
                break;
            }
            #endregion

            bool       abilitazioneRubricaComune = BusinessLogic.RubricaComune.Configurazioni.GetConfigurazioni(infoUtente).GestioneAbilitata;
            Registro[] regTemp = (Registro[])BusinessLogic.Utenti.RegistriManager.getListaRegistriRfRuolo(idRuolo, "", "").ToArray(typeof(Registro));

            //Prendo soltanto i corrispondenti del mio registro e di tutti i miei rf se presenti
            #region registro
            Registro[] regOnliyTemp = null;
            if (regTemp != null && regTemp.Length > 0)
            {
                int countReg = 0;
                regOnliyTemp = new Registro[regTemp.Length];
                for (int y = 0; y < regTemp.Length; y++)
                {
                    if ((!string.IsNullOrEmpty(regTemp[y].chaRF) && regTemp[y].chaRF.Equals("1")) || regTemp[y].systemId.Equals(qco.caller.IdRegistro))
                    {
                        regOnliyTemp[countReg] = regTemp[y];
                        countReg++;
                    }
                }
            }
            string retValue = string.Empty;

            foreach (Registro item in regOnliyTemp)
            {
                if (item != null)
                {
                    retValue += " " + item.systemId + ",";
                }
            }
            if (retValue.EndsWith(","))
            {
                retValue = retValue.Remove(retValue.LastIndexOf(","));
            }

            qco.caller.filtroRegistroPerRicerca = retValue;
            #endregion

            qco.tipoIE          = DocsPaVO.addressbook.TipoUtente.INTERNO;
            qco.doRuoli         = true;
            qco.doUo            = true;
            qco.doUtenti        = true;
            qco.doListe         = true;
            qco.doRF            = false;
            qco.doRubricaComune = false;

            qco.ObjectType = string.Empty;

            string[] res = GetElementiRubricaVeloce(infoUtente, qco);
            int      i   = 0;

            //filtro i risultati cone nel frontend

            //response
            if (res != null && res.Count() > 0)
            {
                foreach (string s in res)
                {
                    RicercaSmistamentoElement el = new RicercaSmistamentoElement();
                    string desc     = s.Split('§')[0];
                    string sysId    = s.Split('§')[1];
                    string tipo     = s.Split('§')[2];
                    string idPeople = s.Split('§')[3];

                    // UTENTE
                    if (tipo.Equals("P"))
                    {
                        el = AggiungiElementoRicerca(idPeople, tipo, infoUtente, idRegistro);

                        if (el != null)
                        {
                            el.DescrizioneUtente = desc;
                            //el.IdUtente = sysId;
                            el.Type = SmistamentoNodeType.UTENTE;
                        }
                    }
                    // RUOLO
                    else if (tipo.Equals("R"))
                    {
                        el = AggiungiElementoRicerca(sysId, tipo, infoUtente, idRegistro);

                        if (el != null)
                        {
                            el.DescrizioneRuolo = desc;
                            //el.IdRuolo = sysId;
                            el.Type = SmistamentoNodeType.RUOLO;
                        }
                    }
                    // UO
                    else
                    {
                        if (el != null)
                        {
                            el.DescrizioneUO = desc;
                            el.IdUO          = sysId;
                            el.Type          = SmistamentoNodeType.UO;
                        }
                    }
                    if (i < numMaxResults)
                    {
                        if (el != null)
                        {
                            elements.Add(el);
                            i++;
                        }
                    }
                    else
                    {
                        break;
                    }
                }
            }

            return(elements);
        }