protected void DWActor_Init(object sender, EventArgs e) { int i; if (DWActor != null) { actorCAD actores = new actorCAD(); actor.Nombre = "%"; List <String> nombres = new List <string>(); listaA = actores.mostrarListaActores(actor); for (i = 0; i < listaA.Count; i++) { nombres.Add(listaA[i].Nombre + " " + listaA[i].Apellidos); } DWActor.DataSource = nombres; DWActor.DataBind(); DWActor.Items.Insert(0, new ListItem("[Seleccionar]", "0")); } if (DWActor.Items.Count == 1) { Btn_Borrar.Visible = false; Err1.ForeColor = Color.Red; Err1.Visible = true; Err1.Text = "No quedan actores"; } }
public List <actorEN> listaActores() { actorCAD actor = new actorCAD(); try { return(actor.mostrarListaActores(this)); } catch (Exception ex) { throw new Exception(ex.Message); } }
protected void DWactuacion_init(object sender, EventArgs e) { idPe.Clear(); idAc.Clear(); listaA.Clear(); listaPeliculas.Clear(); int i; if (DWActor != null) { actorCAD actores = new actorCAD(); actor.Nombre = "%"; List <String> nombres = new List <string>(); listaA = actores.mostrarListaActores(actor); for (i = 0; i < listaA.Count; i++) { nombres.Add(listaA[i].Nombre + " " + listaA[i].Apellidos); idAc.Add(listaA[i].IdAc); } DWActor.DataSource = nombres; DWActor.DataBind(); DWActor.Items.Insert(0, new ListItem("[Seleccionar]", "0")); } if (DWPelicula != null) { peliculaCAD p = new peliculaCAD(); pelicula.NombreP = "%"; List <String> nombres = new List <string>(); listaPeliculas = p.mostrarListaPeliculas(pelicula); for (i = 0; i < listaPeliculas.Count; i++) { nombres.Add(listaPeliculas[i].NombreP); idPe.Add(listaPeliculas[i].IdP); } DWPelicula.DataSource = nombres; DWPelicula.DataBind(); DWPelicula.Items.Insert(0, new ListItem("[Seleccionar]", "0")); } if (DWPelicula.Items.Count == 1) { Btn_Borrar.Visible = false; Err1.ForeColor = Color.Red; Err1.Visible = true; Err1.Text = "No hay suficientes peliculas/actores"; } }