protected void Page_Load(object sender, EventArgs e) { CookieHandler.checkLogin(); Label1.Text = CookieHandler.getUsername(); Label2.Text = CookieHandler.getPassword(); Label3.Text = CookieHandler.getID().ToString(); }
protected void Page_Load(object sender, EventArgs e) { CookieHandler.checkLogin(); labelName.Text = CookieHandler.getUserFullName(); labelJet.Text = CookieHandler.getCookieValue("jet"); labelDate.Text = CookieHandler.getCookieValue("date"); labelDestination.Text = CookieHandler.getCookieValue("dest"); }
protected void Page_Load(object sender, EventArgs e) { //login check CookieHandler.checkLogin(); CookieHandler.clearResultsCookies(); //clear cookies if second reservation or more this session //this populates the name of the current user into the Label1 textbox Label1.Text = CookieHandler.getUserFullName(); //destinationDropDownList.Items.Clear(); //jetsDropDownList.Items.Clear(); //String[] destList = DBDestinations.getDestinationsList().ToArray(); //foreach (string s in destList) //{ // destinationDropDownList.Items.Add(s); //automatically adds database items to dropdown list -ksm //} //foreach (var pair in planes) //{ // int key = pair.Key; // Plane p = pair.Value; // if (p.isAvailable()) // { // jetsDropDownList.Items.Add(p.name); //automatically adds available jets to dropdownlist -ksm // } //} if (!IsPostBack) { Dictionary <int, Plane> planes = (Dictionary <int, Plane>)Session["planes"]; String[] destList; destList = DBDestinations.getDestinationsList().ToArray(); foreach (string s in destList) { destinationDropDownList.Items.Add(s); //automatically adds database items to dropdown list -ksm } foreach (var pair in planes) { int key = pair.Key; Plane p = pair.Value; if (p.isAvailable()) { jetsDropDownList.Items.Add(p.name); //automatically adds available jets to dropdownlist -ksm } } } }
protected void Page_Load(object sender, EventArgs e) { CookieHandler.checkLogin(); DBHandler.populateDataSet(); if (!IsPostBack) { // This is a login check that redirects to login page if there is no valid login cookie. Dictionary <int, Plane> planes = new Dictionary <int, Plane>(); int count = 0; foreach (string plane in DBPlanes.PlanesList()) { Plane p = new Plane(DBPlanes.getID(plane)); //Create Plane object for each plane planes[count] = p; //Populate planes Dictionary with Plane planes[count].updatePlaneLocation(); //Updates planes location based on Plane Flight plan count++; } Session["planes"] = planes; } }