public void FindMethodOk()
        {
            clsLink aLink = new clsLink();
            Boolean found;
            Int32   filmId = 1;

            found = aLink.Find(filmId);
            Assert.IsTrue(found);
        }
Esempio n. 2
0
        protected void grdAllFilms_RowEditing(object sender, GridViewEditEventArgs e)
        {
            editFilm = true;
            int rowIndex = e.NewEditIndex;

            filmId = Convert.ToInt32(((Label)grdAllFilms.Rows[rowIndex].FindControl("lblFilmId")).Text);

            lblActionFilm.Text = "Edit film record";
            btnActionFilm.Text = "UPDATE FILM";
            string filmTitle = ((Label)grdAllFilms.Rows[rowIndex].FindControl("lblTitle")).Text;

            txtFilmTitle.Text = filmTitle;

            clsLink aLink = new clsLink();

            aLink.Find(filmId);
            Int32 imdbId = aLink.ImdbId;

            txtImdbId.Text = imdbId.ToString();

            Session["FilmId"]         = filmId;
            Session["Title"]          = filmTitle;
            Session["originalIMDBId"] = imdbId;
            Session["EditFilm"]       = true;

            pnlActionFilm.Visible = true;
            LoadData();

            clsFilmGenre      aFilmGenre = new clsFilmGenre();
            clsDataConnection DB         = new clsDataConnection();

            DB.AddParameter("@FilmId", filmId);
            DB.Execute("sproc_tblFilmGenre_FilterByFilmId");
            Int32 recordCount = DB.Count;
            Int32 index       = 0;

            while (index < recordCount)
            {
                Int32 genreId = Convert.ToInt32(DB.DataTable.Rows[index]["GenreId"]);
                chkbxlstGenres.Items.FindByValue(genreId.ToString()).Selected = true;
                aFilmGenre.FilmId  = filmId;
                aFilmGenre.GenreId = genreId;
                GenresAlreadyAttachedToFilm.Add(aFilmGenre);
                index++;
            }

            GenerateFilmYears();
            Page.SetFocus(btnActionFilmCancel);
        }