protected void Page_Load(object sender, EventArgs e) { route = Route.getRouteByID(int.Parse(Request.QueryString["routeID"])); WebControlGenerator.showInfo(route, infoPanel, false); List <TimeOfWeek> schedule = TimeOfWeek.getTimesByRouteIDAsList(route.Id); foreach (TimeOfWeek t in schedule) { t.setNextOperations(); WebControlGenerator.addTimesToPanel(route, t, timesPanel, true); } }
protected void Page_Load(object sender, EventArgs e) { foreach (Control c in mainContent.Controls) { mainContent.Controls.Remove(c); } if (Session["user"] != null) { Panel infoPanel = new Panel(); j = Journey.getJourneyByID(int.Parse(Request.QueryString["journeyID"])); r = Route.getRouteByID(j.RouteID); c = Coach.getCoachByID(j.CoachID); operation = DateTime.Parse(Request.QueryString["operation"]); WebControlGenerator.showInfo(r, operation, c, j, infoPanel, false); mainContent.Controls.Add(infoPanel); Label breakLine = new Label(); breakLine.Text = "<br />"; mainContent.Controls.Add(breakLine); mainContent.Controls.Add(breakLine); Label bookingAmountLabel = new Label(); bookingAmountLabel.Text = "Number of seats to be reserved: "; bookingAmountLabel.CssClass = "FormLabel"; mainContent.Controls.Add(bookingAmountLabel); bookingAmountTextbox = new TextBox(); bookingAmountTextbox.TextMode = TextBoxMode.Number; mainContent.Controls.Add(bookingAmountTextbox); mainContent.Controls.Add(breakLine); Button confirmBookingButton = new Button(); confirmBookingButton.Text = "Confirm booking!"; confirmBookingButton.Click += confirmBookingButton_Click; mainContent.Controls.Add(confirmBookingButton); } else { Label logInPrompt = new Label(); logInPrompt.Text = "To complete your booking, please use the log in control at the top of the page in order to authenticate your identity."; mainContent.Controls.Add(logInPrompt); } }
protected void Page_Load(object sender, EventArgs e) { timeID = int.Parse(Request.QueryString["timeID"]); operation = DateTime.Parse(Request.QueryString["operation"]); route = Route.getRouteByID(int.Parse(Request.QueryString["routeID"])); WebControlGenerator.showInfo(route, operation, infoPanel, false); List <Coach> coaches = Coach.getCoachesByRouteAndTimeIDAsList(route.Id, timeID); foreach (Coach c in coaches) { Journey j = new Journey(route.Id, timeID, c.Id); j.findIDFromDb(); if (c.Capacity > j.getSeatsTaken(operation)) { WebControlGenerator.addCoachAndSeatInfoToPanel(operation, c, j, coachPanel, true); } } }