protected void btnYes_Click(object sender, EventArgs e) { clsFilmCollection FilmCollection = new clsFilmCollection(); FilmCollection.ThisFilm.Find(FilmId); FilmCollection.Delete(); Response.Redirect("FilmList.aspx"); }
protected void grdAllFilms_RowDeleting(object sender, GridViewDeleteEventArgs e) { Int32 filmId = Convert.ToInt32(((Label)grdAllFilms.Rows[e.RowIndex].FindControl("lblFilmId")).Text); clsFilmCollection AllFilms = new clsFilmCollection(); AllFilms.ThisFilm.FilmId = filmId; AllFilms.Delete(); LoadData(); }
public void DeleteMethodOK() { clsFilmCollection AllFilms = new clsFilmCollection(); clsFilm TestFilm = new clsFilm(); Int32 PrimaryKey = 0; TestFilm.FilmName = "Frazers Film"; TestFilm.FilmDescription = "test description, test description, test description, " + "test description, test description, "; TestFilm.FilmCertificate = "12"; TestFilm.FilmReleaseDate = DateTime.Now.Date; TestFilm.FilmDepartureDate = DateTime.Now.Date.AddYears(1); AllFilms.ThisFilm = TestFilm; PrimaryKey = AllFilms.Add(); TestFilm.FilmID = PrimaryKey; AllFilms.ThisFilm.Find(PrimaryKey); AllFilms.Delete(); Boolean Found = AllFilms.ThisFilm.Find(PrimaryKey); Assert.IsFalse(Found); }