Esempio n. 1
0
    //===============================================================
    // Function: invitesRepeater_ItemCommand
    //===============================================================
    protected void invitesRepeater_ItemCommand(object sender, RepeaterCommandEventArgs e)
    {
        int eventInviteID = int.Parse(e.CommandArgument.ToString());

        EventInvite eventInvite = new EventInvite(Session["loggedInUserFullName"].ToString(), eventInviteID);

        if (e.CommandName == "acceptButton")
        {
            int currentUserID = int.Parse(Session["loggedInUserID"].ToString());
            // Check if the user is already tracking this event
            if (TrackedEvent.GetTrackedEventID(eventInvite.eventID, currentUserID) < 0)
            {
                TrackedEvent trackedEvent = new TrackedEvent(Session["loggedInUserFullName"].ToString());
                trackedEvent.eventID = eventInvite.eventID;
                trackedEvent.userID = currentUserID;
                trackedEvent.showOnTimeline = true;
                trackedEvent.Add();
            }

            eventInvite.inviteAccepted = true;
            eventInvite.inviteAcceptedDate = DateTime.Now;
            eventInvite.Update();

            eventInvite.SendInviteAcceptedEmail();

            Response.Redirect("viewEvent.aspx?EID=" + eventInvite.eventID.ToString());
        }
        if (e.CommandName == "declineButton")
        {
            eventInvite.inviteDeclined = true;
            eventInvite.inviteDeclinedDate = DateTime.Now;
            eventInvite.Update();
        }

        int userID = int.Parse(Session["loggedInUserID"].ToString());
        PopulateInviteList(userID);
    }
Esempio n. 2
0
        public ActionResult UsersFollowed(int? id, int? eventId, bool? showOnTimeline, bool? joinPending)
        {
            Response.ContentType = Assistant.JsonMimeType;
            if (!id.HasValue)
            {
                return GetInvalidUserIdResult();
            }
            if (!eventId.HasValue)
            {
                return GetErrorActionResult("eventId is null");
            }
            if (!CheckAuthentication(UserRole.Any))
            {
                return GetUnauthorizedActionResult();
            }
            if (currentUserID != id)
            {
                return GetForbiddenActionResult();
            }

            try
            {
                var trackedEvent = new Sedogo.BusinessObjects.TrackedEvent(fullName)
                                       {
                                           eventID = eventId.Value,
                                           joinPending = joinPending ?? false,
                                           showOnTimeline = showOnTimeline ?? true
                                       };
                trackedEvent.Add();
                return Json(new { id = trackedEvent.trackedEventID });
            }
            catch (Exception ex)
            {
                return GetExceptionResult(ex, "POST users/{id}/follwed");
            }
        }
Esempio n. 3
0
    //===============================================================
    // Function: joinThisEventLink_click
    //===============================================================
    protected void joinThisEventLink_click(object sender, EventArgs e)
    {
        int eventID = int.Parse(Request.QueryString["EID"]);
        int userID = int.Parse(Session["loggedInUserID"].ToString());

        int trackedEventID = TrackedEvent.GetTrackedEventID(eventID, userID);

        if (trackedEventID > 0)
        {
            TrackedEvent trackedEvent = new TrackedEvent(Session["loggedInUserFullName"].ToString(), trackedEventID);
            trackedEvent.showOnTimeline = true;
            trackedEvent.Update();
        }
        else
        {
            TrackedEvent trackedEvent = new TrackedEvent(Session["loggedInUserFullName"].ToString());
            trackedEvent.eventID = eventID;
            trackedEvent.userID = userID;
            trackedEvent.showOnTimeline = true;
            trackedEvent.joinPending = true;
            trackedEvent.Add();

            trackedEvent.SendJoinRequestEmail();

            //SedogoEvent sedogoEvent = new SedogoEvent(Session["loggedInUserFullName"].ToString(), eventID);
            //sedogoEvent.SendEventUpdateEmail();
        }

        Response.Redirect("viewEvent.aspx?EID=" + eventID.ToString() + "&A=NotifyJoin");
    }
Esempio n. 4
0
    //===============================================================
    // Function: trackThisEventLink_click
    //===============================================================
    protected void trackThisEventLink_click(object sender, EventArgs e)
    {
        int eventID = int.Parse(Request.QueryString["EID"]);
        int userID = int.Parse(Session["loggedInUserID"].ToString());

        TrackedEvent trackedEvent = new TrackedEvent(Session["loggedInUserFullName"].ToString());
        trackedEvent.eventID = eventID;
        trackedEvent.userID = userID;
        trackedEvent.Add();

        Response.Redirect("viewEvent.aspx?EID=" + eventID.ToString() + "&A=NotifyTrack");
    }
Esempio n. 5
0
    //===============================================================
    // Function: invitedButton_click
    //===============================================================
    protected void invitedButton_click(object sender, EventArgs e)
    {
        int eventID = int.Parse(Request.QueryString["EID"]);
        int userID = int.Parse(Session["loggedInUserID"].ToString());

        int eventInviteID = EventInvite.GetEventInviteIDFromUserIDEventID(eventID, userID);

        // Check if the user is already tracking this event
        if (TrackedEvent.GetTrackedEventID(eventID, userID) < 0)
        {
            TrackedEvent trackedEvent = new TrackedEvent(Session["loggedInUserFullName"].ToString());
            trackedEvent.eventID = eventID;
            trackedEvent.userID = userID;
            trackedEvent.joinPending = false;
            trackedEvent.showOnTimeline = true;
            trackedEvent.Add();
        }

        EventInvite eventInvite = new EventInvite(Session["loggedInUserFullName"].ToString(), eventInviteID);

        eventInvite.inviteAccepted = true;
        eventInvite.inviteAcceptedDate = DateTime.Now;
        eventInvite.Update();

        Response.Redirect("viewEvent.aspx?EID=" + eventInvite.eventID.ToString());
    }