protected void Page_Load(object sender, EventArgs e) { //Session timeout UserBL session = (UserBL)Session["user"]; if (session == null) { Response.Redirect("SessionTimeout.aspx"); } user = Request.QueryString["user"]; eventToEdit = Request.QueryString["eventToEdit"]; check = Request.QueryString["check"]; //Validators to compare current date with selected date for event valDateCheck.ValueToCompare = DateTime.Now.ToShortDateString(); valDateCheckEdit.ValueToCompare = DateTime.Now.ToShortDateString(); valDateCheck.ValueToCompare = DateTime.Now.ToShortDateString(); valDateCheckEdit.ValueToCompare = DateTime.Now.ToShortDateString(); List <EventBL> eventList = eventInfo.GetActiveEvents(user); if (!IsPostBack) { // If back button is clicked on event details fill the textboxes with data from session so they dont have to refill every textbox. if (check != null) { eventInfo = (EventBL)Session["event"]; txtbxEventName.Text = eventInfo.EventName; txtbxDescription.Text = eventInfo.Description; } //Remove any sessions so that the textboxes arent altered further from previous create event Session.Remove("event"); Session.Remove("eventEdit"); //Add values to textbox if edit button was clicked if (eventToEdit != null) { foreach (EventBL ev in eventList) { if (eventToEdit == ev.eventId) { txtbxEventNameEdit.Text = ev.name; txtbxDescriptionEdit.Text = ev.description; txtbxDateEdit.Text = ev.deadline.ToString(); } } } } }
protected void Page_Load(object sender, EventArgs e) { user = Request.QueryString["user"]; //Checks for user session if not redirect UserBL session = (UserBL)Session["user"]; if (session == null) { Response.Redirect("SessionTimeout.aspx"); } eventList = eventInfo.GetActiveEvents(user); }
protected void Page_Load(object sender, EventArgs e) { //This code is here from a merge conflict and I'm not sure if it has a place, is this a redirect to login if the session expires? if so Uncomment it -Saxon UserBL session = (UserBL)Session["user"]; if (session == null) { Response.Redirect("SessionTimeout.aspx"); } //This query is currently what is used to determine what user's information will be displayed on the page it might be better to use userSession I don't know at the moment -Saxon user = Request.QueryString["user"]; //Get the mode from the other page and index of which event needs to be deleted mode = Request.QueryString["mode"]; //this should be deleted eventually eventDelete = Convert.ToInt32(Request.QueryString["eventToDelete"]); eventToDelete = Request.QueryString["eventToDelete"]; //I don't think i need this //User userSession = (User)Session["user"]; //Checks to see if the delete button was clicked if (mode != null) { if (mode.Equals("toggleDelete")) { eventInfo.DeactivateEvent(eventToDelete); } } //Convert data access events to native events once I get the user login sorted I'll come back to this and change the parameter to the user variable- Saxon eventList = eventInfo.GetActiveEvents(user); }