Пример #1
0
        public List <CentroDataSourceShow> CargarInforme()
        {
            List <CentroDataSourceShow> centro = new List <CentroDataSourceShow>();

            try
            {
                var items = this.persistencia.CargarInforme();
                if (items != null)
                {
                    foreach (var item in items)
                    {
                        CentroDataSourceShow centr = new CentroDataSourceShow();
                        centr.Codcentro    = item.idcentro;
                        centr.Nombrecentro = item.nombrecentro;
                        centro.Add(centr);
                    }
                }
                else
                {
                    CentroDataSourceShow centr = new CentroDataSourceShow();
                    centr.Codcentro    = null;
                    centr.Nombrecentro = null;
                    centro.Add(centr);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(centro);
        }
Пример #2
0
        public List <CentroDataSourceShow> Busqueda(string tipo, string buscar)
        {
            List <CentroDataSourceShow> centro = new List <CentroDataSourceShow>();

            try
            {
                var items = this.persistencia.Busqueda(tipo, buscar);
                if (items != null)
                {
                    foreach (var item in items)
                    {
                        CentroDataSourceShow centr = new CentroDataSourceShow();
                        centr.Codcentro    = item.idcentro;
                        centr.Nombrecentro = item.nombrecentro;
                        centro.Add(centr);
                    }
                }
                else
                {
                    CentroDataSourceShow centr = new CentroDataSourceShow();
                    centr.Codcentro    = null;
                    centr.Nombrecentro = null;
                    centro.Add(centr);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(centro);
        }