Пример #1
0
        public List <Model.Rol> getRoles()
        {
            DataTable        tablaRoles;
            List <Model.Rol> listaDeRoles = new List <Model.Rol>();

            DBhelper.crearConexion();

            SqlCommand cmd = DBhelper.crearCommand("QEPD.getRoles");

            DBhelper.abrirConexion();

            tablaRoles = DBhelper.obtenerTabla(cmd);

            foreach (DataRow row in tablaRoles.Rows)
            {
                Model.Rol rol = new Model.Rol();

                rol.setNombre((String)row["Nombre_Rol"]);
                rol.setId((Int32)row["IdRol"]);
                rol.setEstado(Convert.ToInt16(row["Estado_Rol"]));

                listaDeRoles.Add(rol);
            }

            return(listaDeRoles);
        }