public FPerfilPeli(int idPeli) { InitializeComponent(); this.idPeli = idPeli; pelicula = Pelicula.BuscarPelicula(idPeli); dgvCriticasPeli.DataSource = Pelicula.CargarCriticasPeli(idPeli); pcbPortada.Image = pelicula.Cartel; if (Pelicula.ObtenerValoracionMedia(idPeli) != -1) { lblRating.Text = Pelicula.ObtenerValoracionMedia(idPeli).ToString(); } else { lblRating.Text = "n/a"; } pcbTag.Image = ObtenerTagImagen(Pelicula.ObtenerTag(idPeli)); lblTitulo.Text = pelicula.Nombre; lblDirector.Text = pelicula.Director; lblValorAnyo.Text = pelicula.Fecha.ToString("dd-MM-yyyy"); txtDescr.Text = pelicula.Descripcion; }
private void BtnBuscarTag_Click(object sender, EventArgs e) { HacerVisiblesFilas(); foreach (DataGridViewRow row in dgvPelis.Rows) { if (row.Cells["punt_media"].Value != null) { if (Pelicula.ObtenerTag((int)row.Cells["idpeli"].Value) != trbTag.Value) { CurrencyManager currencyManager1 = (CurrencyManager)BindingContext[dgvPelis.DataSource]; currencyManager1.SuspendBinding(); row.Visible = false; currencyManager1.ResumeBinding(); } } } }
private void DgvPelis_CellClick(object sender, DataGridViewCellEventArgs e) { if (dgvPelis.SelectedCells.Count > 0) { int selectedrowindex = dgvPelis.SelectedCells[0].RowIndex; DataGridViewRow selectedRow = dgvPelis.Rows[selectedrowindex]; int id = Convert.ToInt32(selectedRow.Cells["idpeli"].Value); Pelicula pelicula = Pelicula.BuscarPelicula(id); pcbPortada.Image = pelicula.Cartel; int numTag = Pelicula.ObtenerTag(id); pcbTag.Image = ImagenTag(numTag); } }