Пример #1
0
        public List <metadatos.centro> obtener(List <SqlParameter> filtros = null)
        {
            list = new List <metadatos.centro>();

            using (oCon = new SqlServer())
            {
                if (filtros != null)
                {
                    foreach (SqlParameter p in filtros)
                    {
                        oCon.addParameter(p);
                    }
                }
                try
                {
                    using (SqlDataReader drInfo = oCon.executeReader("proc_get" + this.GetType().Name))
                    {
                        while (drInfo.Read())
                        {
                            obj = new metadatos.centro()
                            {
                                IdCentro = convertir.toInt32(drInfo["idcentro"]),
                                Centro   = drInfo["centro"].ToString()
                            };

                            list.Add(obj);
                        }
                    }
                }
                catch (SqlException ex)
                {
                    _errorMensaje = ex.Message.ToString();
                }
            }

            return(list);
        }
Пример #2
0
 public centro()
 {
     obj = new metadatos.centro();
 }