/// <summary> /// Called when the page loads /// </summary> protected void Page_Load(object sender, EventArgs e) { // If we don't have a valid session, then get out of here if (!validSession()) { return; } // Otherwise, open up a link to the web service var service = new OmicronService.OmicronServiceClient(); // Get all the users var users = service.GetUserData(-1, (Guid)Session[Constants.USER_TOKEN]); // If this is null, then we aren't authorized to be here, so let's leave. if(users == null) { Response.Redirect(Constants.LOGIN_PAGE); return; } // Otherwise, fill up the table with the user's data. adminTableRow.DataSource = users; adminTableRow.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack && validSession()) { try { int id = Convert.ToInt32(Request.QueryString[Constants.ID]); var service = new OmicronService.OmicronServiceClient(); WebService.DataContracts.AppDataContract userData; userData = service.GetUserData(id, (Guid)Session[Constants.USER_TOKEN])[0]; Title = (userData.FirstName + " " + userData.LastName + " Application"); // We should only get one. placeUserData(userData); } catch { Response.Redirect("/"); } } }