Example #1
0
        public List <ent.AspNetRoles> ObtenerAllRoles()
        {
            List <ent.AspNetRoles> roles = new List <ent.AspNetRoles>();
            SqlConnection          conn  = (SqlConnection)_repositorio.ObtenerContexto();
            SqlCommand             cmd   = conn.CreateCommand();

            conn.Open();
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.CommandText = "USP_GetAllRoles";
            using (var reader = cmd.ExecuteReader())
            {
                while (reader.Read())
                {
                    var item = new ent.AspNetRoles
                    {
                        Id             = reader["Id"].ToString(),
                        Name           = reader["Name"].ToString(),
                        NormalizedName = reader["Name"].ToString()
                    };
                    roles.Add(item);
                }
            }
            conn.Close();
            return(roles);
        }
Example #2
0
 public void Eliminar(ent.AspNetRoles entidad)
 {
     _repositorio.Eliminar(entidad);
     _repositorio.Grabar();
 }
Example #3
0
 public void Modificar(ent.AspNetRoles entidad)
 {
     _repositorio.Modificar(entidad);
     _repositorio.Grabar();
 }
Example #4
0
 public void Adicionar(ent.AspNetRoles entidad)
 {
     _repositorio.Adicionar(entidad);
     _repositorio.Grabar();
 }