示例#1
0
 protected void Btn_Añadir_Click(object sender, EventArgs e)
 {
     if (DWPelicula.SelectedItem.ToString() != "[Seleccionar]")
     {
         actorCAD a = new actorCAD();
         try
         {
             a.insertarActuacion(idAc[DWActor.SelectedIndex - 1], idPe[DWPelicula.SelectedIndex - 1]);
             Err1.Text      = "AÑADIDA CORRECTAMENTE";
             Err1.ForeColor = Color.Green;
             Err1.Visible   = true;
             DWactuacion_init(sender, e);
         }
         catch (Exception ex)
         {
             Err1.Text      = ex.Message;
             Err1.ForeColor = Color.Red;
             Err1.Visible   = true;
         }
     }
     else
     {
         Err1.Text      = "*Faltan campos por seleccionar";
         Err1.ForeColor = Color.Red;
         Err1.Visible   = true;
     }
 }
示例#2
0
        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 void anyadirActor()
        {
            actorCAD actor = new actorCAD();

            try
            {
                actor.anyadirActor(this);
            }catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        public void modificarActor()
        {
            actorCAD actor = new actorCAD();

            try
            {
                actor.modificarActor(this);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        public actorEN mostrarActor()
        {
            actorCAD actor = new actorCAD();

            try
            {
                return(actor.mostrarActor(this.idAc));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        public void borrarActor()
        {
            actorCAD actor = new actorCAD();

            try
            {
                actor.borrarActor(this.idAc);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        public List <peliculaEN> mostrarPeliculasActor()
        {
            actorCAD actor = new actorCAD();

            try
            {
                return(actor.peliculasActor(this.idAc));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        public List <actorEN> listaActores()
        {
            actorCAD actor = new actorCAD();

            try
            {
                return(actor.mostrarListaActores(this));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
示例#9
0
        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";
            }
        }