public void loadAllData() { eventBO filltable = new eventBO(); AllEventGridView.DataSource = filltable.loadAllEvent(); AllEventGridView.DataBind(); }
protected void AllEventGridView_SelectedIndexChanged(object sender, EventArgs e) { //eventDetails.Visible = true; eventBO getDetails = new eventBO(); GridViewRow row = AllEventGridView.SelectedRow; eventId = Convert.ToInt32(AllEventGridView.SelectedRow.Cells[0].Text); events eventobj = getDetails.GetEventById(eventId); events test = getDetails.getNumParticipants(eventId); selectedEventIdLbl.Text = eventobj.eventId.ToString(); selectedEventLbl.Text = eventobj.eventName.ToString(); selectedSDateLbl.Text = eventobj.eventSDate.ToString(); selectedEDateLbl.Text = eventobj.eventEDate.ToString(); selectedMaxCapLbl.Text = eventobj.maxCapacity.ToString(); selectedSTimeLbl.Text = eventobj.eventSTime.ToString(); selectedETimeLbl.Text = eventobj.eventETime.ToString(); selectedDescripLbl.Text = eventobj.eventDescription.ToString(); ccaPointLbl.Text = eventobj.CcaPoints.ToString(); orionPointLbl.Text = eventobj.Orion_Points.ToString(); currentCapacLbl.Text = test.maxCapacity.ToString(); ccaPointLbl.Text = eventobj.CcaPoints.ToString(); orionPointLbl.Text = eventobj.Orion_Points.ToString(); participatorId = Request.Cookies["CurrentLoggedInUser"].Value; idLbl.Text = participatorId.ToString(); creatorIdLbl.Text = eventobj.creatorId; eventDetailsPanel.Visible = true; EventPanel.Visible = false; }
protected void unjoinBtn_Click(object sender, EventArgs e) { DateTime endDate = Convert.ToDateTime(selectedEDateLbl.Text.Trim()); DateTime currentDate = DateTime.Today; string confirmValue = Request.Form["confirm_value"]; if (currentDate > endDate) { string display = "Event is already over! There is no reason to unjoin the event"; ClientScript.RegisterStartupScript(this.GetType(), "Event is already over! There is no reason to unjoin the event", "alert('" + display + "');", true); loadAllData(); } else if (confirmValue == "Yes") { eventBO unjoin = new eventBO(); int eventId = Convert.ToInt32(myEventsGV.SelectedRow.Cells[0].Text); String participatorId = Request.Cookies["CurrentLoggedInUser"].Value; unjoin.unjoinEvent(participatorId, eventId); string display = "You successfully quit the event!"; ClientScript.RegisterStartupScript(this.GetType(), "You successfully quit the event!", "alert('" + display + "');", true); eventDetails.Visible = false; loadAllData(); } else { string display = "You did not quit the event!"; ClientScript.RegisterStartupScript(this.GetType(), "You did not quit the event!", "alert('" + display + "');", true); loadAllData(); } }
protected void taskGridView_SelectedIndexChanged(object sender, EventArgs e) { eventBO getDetails = new eventBO(); GridViewRow row = taskGridView.SelectedRow; eventId = Convert.ToInt32(taskGridView.SelectedRow.Cells[0].Text); eventDetails.Visible = true; eventPanel.Visible = false; events eventobj = getDetails.GetEventById(eventId); selectedEventLbl.Text = eventobj.eventName.ToString(); selectedSDateLbl.Text = eventobj.eventSDate.ToString(); selectedEDateLbl.Text = eventobj.eventEDate.ToString(); selectedSTimeLbl.Text = eventobj.eventSTime.ToString(); selectedETimeLbl.Text = eventobj.eventETime.ToString(); selectedDescripLbl.Text = eventobj.eventDescription.ToString(); selectedMaxCapLbl.Text = eventobj.maxCapacity.ToString(); selectedCcaPointsLbl.Text = eventobj.CcaPoints.ToString(); selectedOrionPointsLbl.Text = eventobj.Orion_Points.ToString(); test(); // }
protected void editBtn_Click(object sender, EventArgs e) { if (taskGridView.SelectedIndex < 0) { ///Label1.Text = "Please select a event"; } else { eventBO getDetails = new eventBO(); events eventobj = getDetails.GetEventById(eventId); String user_Id = Request.Cookies["CurrentLoggedInUser"].Value; eventId = int.Parse(taskGridView.SelectedRow.Cells[0].Text); Session["eventIdSession"] = eventId; Session["nameSession"] = selectedEventLbl.Text; Session["sDateSession"] = selectedSDateLbl.Text; Session["eDateSession"] = selectedEDateLbl.Text; Session["sTimeSession"] = selectedSTimeLbl.Text; Session["eTimeSession"] = selectedETimeLbl.Text; Session["descriptionSession"] = selectedDescripLbl.Text; Session["maxCapSession"] = selectedMaxCapLbl.Text; Session["ccaPointsSession"] = selectedCcaPointsLbl.Text; Session["orionPointsSession"] = selectedOrionPointsLbl.Text; Session["userIdSession"] = user_Id; Response.Redirect("updateEventPage.aspx"); } }
protected void taskGridView_PageIndexChanging(object sender, GridViewPageEventArgs e) { eventBO filltable = new eventBO(); String user_Id = Request.Cookies["CurrentLoggedInUser"].Value; taskGridView.DataSource = filltable.loadEvent(user_Id); taskGridView.PageIndex = e.NewPageIndex; taskGridView.DataBind(); }
public void test() { eventBO filltable = new eventBO(); String creator_Id = Request.Cookies["CurrentLoggedInUser"].Value; eventId = Convert.ToInt32(taskGridView.SelectedRow.Cells[0].Text); printParticipatorGV.DataSource = filltable.getAttendanceList(eventId, creator_Id); printParticipatorGV.DataBind(); }
public void loadAllData() { eventBO filltable = new eventBO(); String user_Id = Request.Cookies["CurrentLoggedInUser"].Value; myEventsGV.DataSource = filltable.loadSignUpEvent(user_Id); myEventsGV.DataBind(); // taskGridView.UseAccessibleHeader = true; // taskGridView.HeaderRow.TableSection = TableRowSection.TableHeader; }
public void signUpEvent() { eventBO signUp = new eventBO(); int eventId = int.Parse(selectedEventIdLbl.Text.ToString()); String eventName = selectedEventLbl.Text.ToString(); String eventSDate = selectedSDateLbl.Text.ToString(); String eventEDate = selectedEDateLbl.Text.ToString(); String eventSTime = selectedSTimeLbl.Text.ToString(); String eventETime = selectedETimeLbl.Text.ToString(); String eventDescription = selectedDescripLbl.Text.ToString(); int CCAPoints = int.Parse(ccaPointLbl.Text.ToString()); int Orion_Points = int.Parse(orionPointLbl.Text.ToString()); String participatorId = Request.Cookies["CurrentLoggedInUser"].Value; idLbl.Text = participatorId.ToString(); String currentParticipator = idLbl.Text.ToString(); events test = signUp.getNumParticipants(eventId); events eventobj = signUp.GetEventById(eventId); String creatorId = creatorIdLbl.Text; selectedMaxCapLbl.Text = eventobj.maxCapacity.ToString(); String maxCap = selectedMaxCapLbl.Text.ToString(); String currentNum = test.maxCapacity.ToString(); if (currentNum == maxCap) { string display = "Sorry, There is no more available slots!"; ClientScript.RegisterStartupScript(this.GetType(), "Sorry, There is no more available slots!", "alert('" + display + "');", true); } else if (signUp.checkIfParticipantExist(eventId, participatorId) == false) { // joinBtn.Visible = false; string display = "You have already sign up for this event!"; ClientScript.RegisterStartupScript(this.GetType(), "You have already sign up for this event!", "alert('" + display + "');", true); } else { signUp.signUpEvent(eventId, eventName, eventSDate, eventEDate, eventSTime, eventETime, eventDescription, currentParticipator, CCAPoints, Orion_Points, creatorId); string display = "Congrats for signing up! See you on the day of the event!"; ClientScript.RegisterStartupScript(this.GetType(), "Congrats for signing up! See you on the day of the event!", "alert('" + display + "');", true); eventDetailsPanel.Visible = false; EventPanel.Visible = true; } }
//protected void cancelBtn_Click(object sender, EventArgs e) //{ // Response.Redirect("viewEventPage.aspx"); //} protected void createBtn_Click1(object sender, EventArgs e) { //DateTime tempSTime = DateTime.Parse(STimeTB.Text.ToString()); //DateTime tempETime = DateTime.Parse(ETimeTB.Text.ToString()); String eventName = eventNameTB.Text.ToString(); DateTime sd = DateTime.Parse(txtStartDate.Text.ToString()); DateTime ed = DateTime.Parse(txtEndDate.Text.ToString()); String eventSDate = sd.ToString("dd-MMMM-yy"); String eventEDate = ed.ToString("dd-MMMM-yy"); //String eventSDate = txtStartDate.Text.ToString(); //String eventEDate = txtEndDate.Text.ToString(); DateTime st = DateTime.Parse(STimeTB.Text.ToString()); DateTime et = DateTime.Parse(ETimeTB.Text.ToString()); String eventSTime = st.ToString("hh:mm tt"); String eventETime = et.ToString("hh:mm tt"); //String eventSTime = STimeTB.Text.ToString(); //String eventETime = ETimeTB.Text.ToString(); String eventDescription = Request.Form["eventDesc"]; int CcaPoints = int.Parse(ccaPointsTB.Text.ToString()); int Orion_Points = int.Parse(orionPointsTB.Text.ToString()); int maxCapacity = int.Parse(maxCapTB.Text.ToString()); String user_Id = Request.Cookies["CurrentLoggedInUser"].Value; bool success = isValidated(); if ((success == false)) { errorPanel.Visible = true; successPanel.Visible = false; createPanel.Visible = true; } else { errLbl.Text = ""; errTLbl.Text = ""; errLblMax.Text = ""; cpErrLbl.Text = ""; OpErrLbl.Text = ""; opErr.Visible = false; errCpLbl.Visible = false; mcErr.Visible = false; timeErr.Visible = false; dateErr.Visible = false; errorPanel.Visible = false; successPanel.Visible = true; eventBO add = new eventBO(); add.insertEvent(eventName, eventSDate, eventEDate, eventSTime, eventETime, eventDescription, maxCapacity, CcaPoints, Orion_Points, user_Id); Response.AddHeader("REFRESH", "5;URL=viewEventPage.aspx"); } }
protected void requestPointsGV_SelectedIndexChanged(object sender, EventArgs e) { requestBO getDetails = new requestBO(); eventBO test = new eventBO(); AllocationToRequestPointsPanel.Visible = true; AllocationToTutionPointsPanel.Visible = false; allocatePanel.Visible = false; GridViewRow row = requestPointsGV.SelectedRow; string status; String requestTo = ""; requestTo = Convert.ToString(requestPointsGV.SelectedRow.Cells[0].Text); // status = Convert.ToString(viewParticipatorsGV.SelectedRow.Cells[5].Text); }
protected void viewParticipatorsGV_SelectedIndexChanged(object sender, EventArgs e) { eventBO getDetails = new eventBO(); eventBO test = new eventBO(); AllocationToTutionPointsPanel.Visible = false; AllocationToRequestPointsPanel.Visible = false; allocatePanel.Visible = true; GridViewRow row = viewParticipatorsGV.SelectedRow; string status; eventId = Convert.ToInt32(viewParticipatorsGV.SelectedRow.Cells[0].Text); status = Convert.ToString(viewParticipatorsGV.SelectedRow.Cells[4].Text); participatorIdLbl.Text = Convert.ToString(viewParticipatorsGV.SelectedRow.Cells[1].Text); CCAPointsLbl.Text = Convert.ToString(viewParticipatorsGV.SelectedRow.Cells[2].Text); OrionPointsLbl.Text = Convert.ToString(viewParticipatorsGV.SelectedRow.Cells[3].Text); String creatorId = Request.Cookies["CurrentLoggedInUser"].Value; }
public void loadAllData() { if (Request.Cookies["CurrentLoggedInUser"].Value != null) { //creatorId = Session["userIdSession"].ToString(); //eventId = int.Parse(Session["eventIdSession"].ToString()); eventBO filltable = new eventBO(); sessionBO loadTable = new sessionBO(); requestBO fillGV = new requestBO(); String creatorId = Request.Cookies["CurrentLoggedInUser"].Value; viewParticipatorsGV.DataSource = filltable.loadParticipatorList(creatorId); viewParticipatorsGV.DataBind(); tutionPointsGV.DataSource = loadTable.getNumOfSession(); tutionPointsGV.DataBind(); requestPointsGV.DataSource = fillGV.getNumOfSession(); requestPointsGV.DataBind(); } }
protected void addPoints_Click(object sender, EventArgs e) { string confirmValue = Request.Form["confirm_value"]; if (confirmValue == "Yes") { eventBO assignPoints = new eventBO(); String participatorId = participatorIdLbl.Text; int ccaPoints = int.Parse(CCAPointsLbl.Text.ToString()); int orionPoints = int.Parse(OrionPointsLbl.Text.ToString()); String creatorId = Request.Cookies["CurrentLoggedInUser"].Value; string status = "Assigned Successfully"; bool success = true; if (success == true) { success = true; string display = "Allocation Pass! Points get allocated successfully"; ClientScript.RegisterStartupScript(this.GetType(), "Points get allocated successfully!", "alert('" + display + "');", true); assignPoints.givePoints(participatorId, ccaPoints, orionPoints); assignPoints.showPointedAreAllocated(status, participatorId, creatorId); loadAllData(); allocatePanel.Visible = false; } else { string display = "Allocation Fail! Points did not get allocated successfully!"; ClientScript.RegisterStartupScript(this.GetType(), "Points did not get allocated successfully!", "alert('" + display + "');", true); } } else { string display = "Allocation Fail! You did not update the points"; ClientScript.RegisterStartupScript(this.GetType(), "You did not update the points!", "alert('" + display + "');", true); } }
protected void updateBtn_Click(object sender, EventArgs e) { //updateEvent(); updateFunction = new eventBO(); eventId = int.Parse(Session["eventIdSession"].ToString()); eventName = eventNameTB.Text; DateTime sd = DateTime.Parse(txtStartDate.Text.ToString()); DateTime ed = DateTime.Parse(txtEndDate.Text.ToString()); eventSDate = sd.ToString("dd-MMMM-yy"); eventEDate = ed.ToString("dd-MMMM-yy"); user_Id = Session["userIdSession"].ToString(); DateTime st = DateTime.Parse(STimeTB.Text.ToString()); DateTime et = DateTime.Parse(ETimeTB.Text.ToString()); eventSTime = st.ToString("hh:mm tt"); eventETime = et.ToString("hh:mm tt"); eventDescription = eventDescTB.Text; maxCap = maxCapTB.Text.ToString(); CcaPoints = ccaPointsTB.Text.ToString(); OrionPoints = orionPointsTB.Text.ToString(); updateFunction.updateEvent(eventName, eventSDate, eventEDate, eventSTime, eventETime, eventDescription, int.Parse(maxCap), int.Parse(CcaPoints), int.Parse(OrionPoints), eventId, user_Id); successPanel.Visible = true; Response.AddHeader("REFRESH", "5;URL=viewEventPage.aspx"); //Thread.Sleep(3000); //Response.Redirect("viewEventPage.aspx"); }
protected void myEventsGV_SelectedIndexChanged(object sender, EventArgs e) { eventBO getDetails = new eventBO(); GridViewRow row = myEventsGV.SelectedRow; eventId = Convert.ToInt32(myEventsGV.SelectedRow.Cells[0].Text); String participatorId = Request.Cookies["CurrentLoggedInUser"].Value; eventDetails.Visible = true; myEventsGV.Visible = false; //eventPanel.Visible = false; events eventobj = getDetails.GetEventByParticipatorId(eventId, participatorId); selectedEventLbl.Text = eventobj.eventName.ToString(); selectedSDateLbl.Text = eventobj.eventSDate.ToString(); selectedEDateLbl.Text = eventobj.eventEDate.ToString(); selectedSTimeLbl.Text = eventobj.eventSTime.ToString(); selectedETimeLbl.Text = eventobj.eventETime.ToString(); selectedDescripLbl.Text = eventobj.eventDescription.ToString(); // selectedMaxCapLbl.Text = eventobj.maxCapacity.ToString(); selectedCcaPointsLbl.Text = eventobj.CcaPoints.ToString(); selectedOrionPointsLbl.Text = eventobj.Orion_Points.ToString(); }
protected void Page_Load(object sender, EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.NoCache); if (!this.IsPostBack) { /*Session Fixation*/ // check if the 2 sessions n cookie is not null if (Session["LoginUserName"] != null && Session["AuthToken"] != null && Request.Cookies["AuthToken"] != null && Request.Cookies["CurrentLoggedInUser"] != null) { //second check for cookie has the same value as the second session if ((Session["AuthToken"].ToString().Equals(Request.Cookies["AuthToken"].Value))) /*End of Session Fixation*/ { current_logged_in_user = Request.Cookies["CurrentLoggedInUser"].Value; ErrorConsentForm.Visible = false; ErrorLabelPurchase.Visible = false; UserBO userbo = new UserBO(); current_user_obj = userbo.getUserById(current_logged_in_user); ProfileName_LB.Text = current_user_obj.name; Role_LB.Text = current_user_obj.role; UserID_LB.Text = current_user_obj.User_ID; CCAPoints_LB.Text = current_user_obj.cca_point.ToString(); OrionPoints_LB.Text = current_user_obj.orion_point.ToString(); Bookstore_BO bookstorebo = new Bookstore_BO(); List <PurchasedItem> itemsList = new List <PurchasedItem>(); itemsList = bookstorebo.purchaseHistory(current_logged_in_user); if (itemsList == null || itemsList.Count == 0) { ErrorLabelPurchase.Visible = true; } else if (itemsList.Count() < 3) { itemsList.Reverse(); purchaseHistoryGridView.DataSource = itemsList.GetRange(0, itemsList.Count()); purchaseHistoryGridView.DataBind(); ErrorLabelPurchase.Visible = false; } else if (itemsList.Count() >= 3) { itemsList.Reverse(); purchaseHistoryGridView.DataSource = itemsList.GetRange(0, 3); purchaseHistoryGridView.DataBind(); ErrorLabelPurchase.Visible = false; } //hide certain panels according to user type if (current_user_obj.role == "Student") { RegisteredActivities_Col.Visible = true; ConsentForms_Col.Visible = false; Response.Cookies["Current_Edu_Level"].Value = current_user_obj.education_level; eventBO eventbo = new eventBO(); List <events> eventList = eventbo.loadSignUpEvent(current_logged_in_user); //event stuff if (eventList == null || eventList.Count == 0) { EventsErrorMsg.Visible = true; } else if (eventList.Count() < 3) { eventList.Reverse(); RegisteredEventGridView.DataSource = eventList.GetRange(0, eventList.Count()); RegisteredEventGridView.DataBind(); EventsErrorMsg.Visible = false; } else if (eventList.Count() >= 3) { itemsList.Reverse(); RegisteredEventGridView.DataSource = eventList.GetRange(0, 3); RegisteredEventGridView.DataBind(); EventsErrorMsg.Visible = false; } //insert pending items [check class, check the amount of unsigned forms] ConsentFormBO consentformbo = new ConsentFormBO(); List <ConsentForm> consentFormList = consentformbo.selectUnsignedFormsByUser(current_user_obj.User_ID, current_user_obj.school, current_user_obj.education_class); if (consentFormList == null || consentFormList.Count == 0) { pendingItemsLabel.Text = "You have no pending items."; } else { pendingItemsLabel.Text = "You have (" + consentFormList.Count + ") pending items."; } } else if (current_user_obj.role == "Parent") { RegisteredActivities_Col.Visible = true; ConsentForms_Col.Visible = false; RegisteredActivities_Col.Visible = false; //insert pending items [check class, check the amount of unsigned forms] //find child user childuser = new user(); UserBO childuserbo = new UserBO(); childuser = childuserbo.getUserById(current_user_obj.child_ID); ConsentFormBO consentformbo = new ConsentFormBO(); List <ConsentForm> consentFormList = consentformbo.selectUnsignedFormsByUser(childuser.User_ID, childuser.school, childuser.education_class); if (consentFormList == null || consentFormList.Count == 0) { pendingItemsLabel.Text = "You have no pending items."; } else { pendingItemsLabel.Text = "You have (" + consentFormList.Count + ") pending items."; } } else if (current_user_obj.role == "Teacher") { ConsentForms_Col.Visible = true; RegisteredActivities_Col.Visible = false; pendingItemsLabel.Text = "You have no pending items.";//tentative //insert 3 recently sent forms here ConsentFormBO consentformbo = new ConsentFormBO(); List <ConsentForm> consentFormList = consentformbo.getConsentFormsBySenderID(current_user_obj.User_ID); if (consentFormList == null || consentFormList.Count == 0) { ErrorConsentForm.Visible = true; } else if (consentFormList.Count() < 3) { consentFormList.Reverse(); GridViewSentForms.DataSource = consentFormList.GetRange(0, consentFormList.Count()); GridViewSentForms.DataBind(); ErrorConsentForm.Visible = false; } else if (consentFormList.Count() >= 3) { consentFormList.Reverse(); GridViewSentForms.DataSource = consentFormList.GetRange(0, 3); GridViewSentForms.DataBind(); ErrorConsentForm.Visible = false; } } else if (current_user_obj.role == "Staff") { ConsentForms_Col.Visible = false; RegisteredActivities_Col.Visible = false; pendingItemsLabel.Text = "You have no pending items."; RegisteredActivities_Col.Visible = false; } else if (current_user_obj.role == "Admin") { ConsentForms_Col.Visible = false; RegisteredActivities_Col.Visible = false; pendingItemsLabel.Text = "You have no pending items."; RegisteredActivities_Col.Visible = false; } ToConsentFormsManagementBtn.NavigateUrl = Response.ApplyAppPathModifier("ManageConsentFormsPage.aspx"); } } else { Response.Redirect("LoginPage.aspx"); } } }