Esempio n. 1
0
        public static List <ModelloDelega> getModelliDelegaByStato(DocsPaVO.utente.InfoUtente utente, StatoModelloDelega stato)
        {
            List <ModelloDelega>      res        = new List <ModelloDelega>();
            ModDeleghe                modDeleghe = new ModDeleghe();
            List <ModelloDelega>      tempList   = searchModelliDelega(utente, null);
            StatoModelloDelegaMatcher matcher    = new StatoModelloDelegaMatcher(stato);

            return(tempList.FindAll(matcher.Match));
        }
Esempio n. 2
0
        public static List <ModelloDelega> searchModelliDelega(DocsPaVO.utente.InfoUtente utente, SearchModelloDelegaInfo searchInfo, SearchPagingContext pagingContext)
        {
            List <Ruolo> ruoli      = UserManager.getRuoliUtente(utente.idPeople).Cast <Ruolo>().ToList();
            ModDeleghe   modDeleghe = new ModDeleghe();

            if (!searchInfo.StatoModelloDelegaSpec)
            {
                return(modDeleghe.searchModelliDelegaPaging(utente, ruoli, searchInfo, pagingContext));
            }
            else
            {
                StatoModelloDelegaMatcher matcher = new StatoModelloDelegaMatcher(searchInfo.StatoModelloDelega);
                List <ModelloDelega>      temp    = modDeleghe.searchModelliDelega(utente, ruoli, searchInfo).FindAll(matcher.Match);
                pagingContext.RecordCount = temp.Count;
                List <ModelloDelega> result = new List <ModelloDelega>(temp.Skip(pagingContext.StartRow - 1).Take(pagingContext.PageSize));
                return(result);
            }
        }