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; } }
private void refresh() { List <Publisher> listPublishers = PublisherDAO.getPublishers(); gvPublisherList.DataSource = listPublishers; gvPublisherList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.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(); } }