private void displayShow(PlaceHolder placeholder, int shid) { placeholder.Controls.Clear(); Show show = new Show(); show.id = Convert.ToInt32(Request["shid"]); show.get(); TextBox tickets = new TextBox(); tickets.ID = "numOfTickets"; Button order = new Button(); order.Text = "Order!"; order.Click += new System.EventHandler(this.orderClick); HiddenField hiddenShid = new HiddenField(); hiddenShid.Value = shid.ToString(); hiddenShid.ID = "hiddenShid"; placeholder.Controls.Add(new LiteralControl("<h1>"+show.read("moid", true)+" @ "+show.read("show_start")+"</h1>")); placeholder.Controls.Add(new LiteralControl("<p>### tickets left</p>")); placeholder.Controls.Add(new LiteralControl("<p>Please input # of tickets you want to order</p>")); placeholder.Controls.Add(tickets); placeholder.Controls.Add(order); placeholder.Controls.Add(new LiteralControl("<br /><br /><a href=\"order_ticket.aspx\">Back to show list</a>")); placeholder.Controls.Add(hiddenShid); }
public override string ToString() { DataMaster user = new User(); user.id = Convert.ToInt32(this.read("usid")); user.get(); DataMaster show = new Show(); show.id = Convert.ToInt32(this.read("shid")); show.get(); return this.id.ToString() + " " + user.ToString() + " - " + show; }
private void displayShows(PlaceHolder placeholder) { placeholder.Controls.Clear(); if (Request["success"] != null && Request["success"] == "true") { placeholder.Controls.Add(new LiteralControl("<p class=\"success\">Your order has been processed successfully!</p>")); } DataMaster fetch = new Show(); var shows = fetch.getAll(); if (shows.Count > 0) { foreach (var shid in shows.Keys) { placeholder.Controls.Add(new LiteralControl("<p>"+shows[shid].read("moid", true)+" @ "+shows[shid].read("show_start")+" <a href=\"order_ticket.aspx?shid="+shid+"\">Order tickets</a></p>")); } } else { throw new Exception("No shows found"); } }