protected void Button2_Click(object sender, EventArgs e)
        {
            int a = Int32.Parse(DropDownListActor.SelectedValue);
            int p = Int32.Parse(DropDownListPeli.SelectedValue);
            // int aa = Int32.Parse(TextBoxActor.Text);
            // int pp = Int32.Parse(TextBoxPeli.Text);

            CineDBContext cineDB = new CineDBContext();
            Pelicula      peli   = cineDB.Peliculas.FirstOrDefault(x => x.ID == p);

            cineDB.Actores.Include("SusPeliculas").FirstOrDefault(y => y.ID == a).SusPeliculas.Remove(peli);
            cineDB.SaveChanges();
            GridListado.DataBind();
            Page.Response.Redirect(Page.Request.Url.ToString(), true);
        }
 public void InsertarActor(Actor actor)
 {
     actorDBContext.Actores.Add(actor);
     actorDBContext.SaveChanges();
 }
Пример #3
0
 public void InsertarPais(Pais pais)
 {
     paisDBContext.Paises.Add(pais);
     paisDBContext.SaveChanges();
 }
Пример #4
0
 public void InsertarPelicula(Pelicula pelicula)
 {
     peliculaDBContext.Peliculas.Add(pelicula);
     peliculaDBContext.SaveChanges();
 }