예제 #1
0
        public static List<TipoPrimarioHistologia> InstalacionActivo(string searchText, int maxResults)
        {
            Repositorio repo = new Repositorio();
            List<TipoPrimarioHistologia> names = new List<TipoPrimarioHistologia>();
            DataSet sitiosDset = repo.GetInstalacionesActivas();

            foreach (DataRow row in sitiosDset.Tables[0].Rows)
                names.Add(new TipoPrimarioHistologia { id = row.ItemArray[2].ToString(), code = row.ItemArray[0].ToString(), desc = row.ItemArray[1].ToString() });

            var result = from n in names
                         where RemoveDiacritics(n.desc).ToUpper().Contains(searchText.ToUpper())
                         orderby n.desc
                         select n;

            return result.Take(maxResults).ToList();
        }