protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ddlEditor.DataSource = PublisherDAO.getPublishers(); ddlEditor.DataValueField = "id_publisher"; ddlEditor.DataTextField = "name_publisher"; ddlEditor.DataBind(); ddlGenero.DataSource = GenreDAO.getGenres(); ddlGenero.DataValueField = "id_genre"; ddlGenero.DataTextField = "description_genre"; ddlGenero.DataBind(); int id_game = Convert.ToInt32(Request.QueryString["id_game"]); if (id_game == 0) { Response.Redirect("~/Games/GameLibraryPL/GameLibrary.aspx"); } Game game = GameDAO.GetGame(id_game); tbxValorPago.Text = game.amount_paid.ToString(); Genre genre = GenreDAO.GetGenre(game.id_genre); Publisher publisher = PublisherDAO.GetPublisher(game.id_publisher); ddlGenero.SelectedValue = genre.description_genre; ddlEditor.SelectedValue = publisher.name_publisher; tbxTitulo.Text = game.title; tbxDataCompra.Text = Convert.ToDateTime(game.purchase_date).ToString("yyyy-MM-dd"); imgCapa.ImageUrl = "../../Content/CoverImages/" + game.cover_image; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int id_game = Convert.ToInt32(Request.QueryString["id_game"]); if (id_game == 0) { Response.Redirect("~/Games/GameLibraryPL/GameLibrary.aspx"); } Game game = GameDAO.GetGame(id_game); lbAmountPaid.Text = game.amount_paid.ToString(); Genre genre = GenreDAO.GetGenre(game.id_genre); Publisher publisher = PublisherDAO.GetPublisher(game.id_publisher); lbGenre.Text = genre.description_genre; lbPublisher.Text = publisher.name_publisher; lbTitle.Text = game.title; lbPurchaseDate.Text = Convert.ToDateTime(game.purchase_date).ToString("dd-MM-yyyy"); imageCapa.ImageUrl = "../../Content/CoverImages/" + game.cover_image; } }