//Metodo eliminar public int EliminarGaleria(FotosEN pEN) { _conn.Open(); SqlCommand _Comand = new SqlCommand("eliminar_Galeria", _conn as SqlConnection); _Comand.CommandType = CommandType.StoredProcedure; _Comand.Parameters.Add(new SqlParameter("@Id", pEN.Id)); int Resultado = _Comand.ExecuteNonQuery(); _conn.Close(); _conn.Dispose(); return(Resultado); }
//metodo de consultar public List <FotosEN> ConsultarGaleria() { _conn.Open(); SqlCommand _comand = new SqlCommand("ConsultarGaleria", _conn as SqlConnection); _comand.CommandType = CommandType.StoredProcedure; IDataReader _reader = _comand.ExecuteReader(); List <FotosEN> _lista = new List <FotosEN>(); while (_reader.Read()) { FotosEN pEN = new FotosEN(); pEN.Id = _reader.GetInt64(0); pEN.Imagen = _reader.GetString(1); _lista.Add(pEN); } _conn.Close(); _conn.Dispose(); return(_lista); }
public int EliminarGaleria(FotosEN pEN) { return(_dal.EliminarGaleria(pEN)); }
public int AgregarGaleria(FotosEN pEN) { return(_dal.AgregarGaleria(pEN)); }