Exemplo n.º 1
0
        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 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;
        }
Exemplo n.º 3
0
        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");
            }
        }
        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;
            }
        }