protected void Page_Load(object sender, EventArgs e) { MovieDaoCollection movieDaoCollection = new MovieDaoCollection(); MovieDaoCollection.ListOfMovies(); GridView1.DataSource = MovieDaoCollection.movielist; GridView1.DataBind(); if (Request.QueryString["id"] != null) { FavoritesDaoCollection favoritesDao = new FavoritesDaoCollection(); FavoritesDaoCollection.FavoritesListInitialization(); int id = Convert.ToInt32(Request.QueryString["id"].ToString()); Movie obj = (from x in MovieDaoCollection.movielist where x.Id == id select x).FirstOrDefault(); if (obj != null) { if (!FavoritesDaoCollection.favoritesmovielist.Contains(obj)) { FavoritesDaoCollection.favoritesmovielist.Add(obj); } Boolean ShowPanel = Convert.ToBoolean(Request.QueryString["showpanel"].ToString()); if (ShowPanel) { notification.Visible = true; } } } }
protected void Submit_Form(object sender, EventArgs e) { MovieDaoCollection m = new MovieDaoCollection(); List <Movie> movieList = m.GetMovieListAdmin(); Movie obj = (from x in movieList where x.MovieId == movieListId select x).FirstOrDefault(); foreach (var x in movieList) { if (x.MovieId == movieListId) { x.MovieTitle = txtMovieTitle.Text; x.BoxOfficeCollection = "$ " + txtBoxOfficeCollection.Text; x.DateOfLaunch = txtDateOfLaunch.Text; string value = ""; bool isChecked = txtMovieActive.Checked; if (isChecked) { value = txtMovieActive.Text; } else { value = txtMovieNotActive.Text; } x.MovieActive = value; x.MovieGenre = txtMovieGenre.SelectedValue; } } Response.Redirect("EditMovieSuccess.aspx"); }
protected void Page_Load(object sender, EventArgs e) { MovieDaoCollection.CreateMovieList(); MovieDaoCollection movieList = new MovieDaoCollection(); AdminMovieList.DataSource = movieList.GetMovieListAdmin(); AdminMovieList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { MovieDaoCollection movieDaoCollection = new MovieDaoCollection(); MovieDaoCollection.ListOfMovies(); GridView1.DataSource = MovieDaoCollection.movielist; GridView1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { MovieDaoCollection.MovieListInitialization(); MovieDaoCollection movieList = new MovieDaoCollection(); GridView1.DataSource = movieList.GetMovieListAdmin(); GridView1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { MovieDaoCollection.CreateMovieList(); MovieDaoCollection CustomerMovie = new MovieDaoCollection(); CustomerMovieList.DataSource = CustomerMovie.GetMovieListCustomer(); CustomerMovieList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["id"] != null) { //MovieDaoCollection movieDao = new MovieDaoCollection(); MovieDaoCollection.MovieListInitialization(); int id = Convert.ToInt32(Request.QueryString["id"].ToString()); Movie obj = (from x in MovieDaoCollection.movieList where x.Id == id select x).FirstOrDefault(); if (obj != null) { txtTitle.Text = obj.Title; txtGross.Text = obj.BoxOffice.ToString(); if (obj.Active) { RadioBtnYes.Checked = true; } else { RadioBtnNo.Checked = true; } txtDateOfLaunch.Text = obj.DateOfLaunch.ToString(); Genre.SelectedValue = obj.Genre; if (obj.HasTeaser) { HasTeaser.Checked = true; } else { HasTeaser.Checked = false; } //movieDao.movieList.Where(w => w.Id == id).ToList().ForEach(i => //{ // i.Title = txtTitle.Text; // i.BoxOffice = Convert.ToInt64(txtGross.Text); // i.Active = Convert.ToBoolean(RadioBtnYes.Text); // i.DateOfLaunch = DateUtility.ConvertToDate(txtDateOfLaunch.Text); // i.Genre = Genre.SelectedValue; // i.HasTeaser = Convert.ToBoolean(HasTeaser.Text); //}); } //foreach (var x in movieDao.movieList) //{ // Response.Write(x.Id + " " + x.Title); //} } } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["id"] != null) { MovieDaoCollection adminMovie = new MovieDaoCollection(); movieList = adminMovie.GetMovieListAdmin(); movieListId = Convert.ToInt32(Request.QueryString["id"].ToString()); bool postback = IsPostBack; if (postback == false) { DisplayDefault(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["id"] != null) { // MovieDaoCollection movieDaoCollection = new MovieDaoCollection(); MovieDaoCollection.ListOfMovies(); int id = Convert.ToByte(Request.QueryString["id"].ToString()); Movie obj = (from x in MovieDaoCollection.movielist where x.Id == id select x).FirstOrDefault(); if (obj != null) { TxtTitle.Text = obj.Title; TxtGross.Text = obj.BoxOffice; TxtDate.Text = obj.DateOfLaunch.ToString(); DropDownList1.Text = obj.Genre; if (obj.Active == "Yes") { Radioyes.Checked = true; } else { Radiono.Checked = true; } if (obj.HasTeaser == "Yes") { CheckBox1.Checked = true; } else { CheckBox1.Checked = false; } //MovieDaoCollection.movielist.Where(w => w.Id == id).ToList().ForEach(i => TxtTitle.Text = obj.Title); } //foreach (var x in MovieDaoCollection.movielist) //{ // Response.Write(x.Id + " " + x.Title); // //Response.Write(x.Id + " " + x.BoxOffice); //} } } }
protected void Button1_Click(object sender, EventArgs e) { MovieDaoCollection.ListOfMovies(); //MovieDaoCollection movieDao = new MovieDaoCollection(); int id = Convert.ToInt32(Request.QueryString["id"].ToString()); //Movie obj = (from x in movieDao.movieList // where x.Id == id // select x).FirstOrDefault(); string active; string hasTeaser; if (Radioyes.Checked) { active = "Yes"; } else { active = "No"; } if (CheckBox1.Checked) { hasTeaser = "Yes"; } else { hasTeaser = "No"; } MovieDaoCollection.movielist.Where(w => w.Id == id).ToList().ForEach(i => { i.Title = TxtTitle.Text; i.BoxOffice = TxtGross.Text; i.Active = active; i.DateOfLaunch = DateUtility.ConvertToDate(TxtDate.Text); i.Genre = DropDownList1.SelectedValue; i.HasTeaser = hasTeaser; }); Response.Redirect("EditMovieStatus.aspx"); }
protected void Button1_Click(object sender, EventArgs e) { //MovieDaoCollection movieDao = new MovieDaoCollection(); MovieDaoCollection.MovieListInitialization(); int id = Convert.ToInt32(Request.QueryString["id"].ToString()); //Movie obj = (from x in movieDao.movieList // where x.Id == id // select x).FirstOrDefault(); Boolean active; Boolean hasTeaser; if (RadioBtnYes.Text == "Yes") { active = true; } else { active = false; } if (HasTeaser.Checked) { hasTeaser = true; } else { hasTeaser = false; } MovieDaoCollection.movieList.Where(w => w.Id == id).ToList().ForEach(i => { i.Title = txtTitle.Text; i.BoxOffice = Convert.ToInt64(txtGross.Text); i.Active = active; i.DateOfLaunch = txtDateOfLaunch.Text; i.Genre = Genre.SelectedValue; i.HasTeaser = hasTeaser; }); Response.Redirect("EditMovieStatus.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["id"] != null) { MovieDaoCollection.MovieListInitialization(); int id = Convert.ToInt32(Request.QueryString["id"].ToString()); Movie obj = (from x in MovieDaoCollection.movieList where x.Id == id select x).FirstOrDefault(); if (obj != null) { txtTitle.Text = obj.Title; txtGross.Text = obj.BoxOffice.ToString(); if (obj.Active) { RadioBtnYes.Checked = true; } else { RadioBtnNo.Checked = true; } txtDateOfLaunch.Text = obj.DateOfLaunch.ToString(); txtGenre.SelectedValue = obj.Genre; if (obj.HasTeaser) { HasTeaser.Checked = true; } else { HasTeaser.Checked = false; } } } } }