Exemple #1
0
    //===============================================================
    // Function: createSimilarEventLink_click
    //===============================================================
    protected void createSimilarEventLink_click(object sender, EventArgs e)
    {
        int eventID = int.Parse(Request.QueryString["EID"]);

        int userID = int.Parse(Session["loggedInUserID"].ToString());

        SedogoEvent viewedEvent = new SedogoEvent(Session["loggedInUserFullName"].ToString(), eventID);
        SedogoEvent newEvent = new SedogoEvent(Session["loggedInUserFullName"].ToString());
        newEvent.beforeBirthday = viewedEvent.beforeBirthday;
        newEvent.categoryID = viewedEvent.categoryID;
        newEvent.dateType = viewedEvent.dateType;
        newEvent.eventDescription = viewedEvent.eventDescription;
        newEvent.eventVenue = viewedEvent.eventVenue;
        newEvent.eventName = viewedEvent.eventName;
        newEvent.mustDo = viewedEvent.mustDo;
        newEvent.rangeEndDate = viewedEvent.rangeEndDate;
        newEvent.rangeStartDate = viewedEvent.rangeStartDate;
        newEvent.startDate = viewedEvent.startDate;
        newEvent.userID = userID;
        newEvent.createdFromEventID = viewedEvent.eventID;
        newEvent.Add();

        Response.Redirect("viewEvent.aspx?EID=" + newEvent.eventID.ToString());
    }
Exemple #2
0
        public ActionResult Events(int? user, DateTime created, DateTime updated, string name, string venue, 
            string description, bool mustDo, string dateType, DateTime? start, DateTime? rangeStart,
            DateTime? rangeEnd, int? beforeBirthday, bool privateEvent, int? category,
            int? createdFromEvent, int timeZone)
        {
            Response.ContentType = Assistant.JsonMimeType;
            if (!user.HasValue)
            {
                return GetInvalidUserIdResult();
            }
            if (!CheckAuthentication(UserRole.Any))
            {
                return GetUnauthorizedActionResult();
            }
            if (currentUserID != user)
            {
                return GetForbiddenActionResult();
            }

            try
            {
                var newEvent = new SedogoEvent(fullName)
                                       {
                                           beforeBirthday = beforeBirthday ?? default(int),
                                           categoryID = category ?? default(int),
                                           createdFromEventID = createdFromEvent ?? default(int),
                                           dateType = dateType,
                                           eventDescription = description ?? string.Empty,
                                           mustDo = mustDo,
                                           startDate = start ?? DateTime.MinValue,
                                           rangeStartDate = rangeStart ?? DateTime.MinValue,
                                           rangeEndDate = rangeEnd ?? DateTime.MinValue,
                                           privateEvent = privateEvent,
                                           timezoneID = timeZone,
                                           eventVenue = venue ?? string.Empty,
                                           eventName = name,
                                           userID = user.Value,
                                       };
                newEvent.Add();
                return Json(new { id = newEvent.eventID });
            }
            catch (Exception ex)
            {
                return GetExceptionResult(ex, "POST Events (Create)");
            }
        }
Exemple #3
0
    //===============================================================
    // Function: saveChangesButton_click
    //===============================================================
    protected void saveChangesButton_click(object sender, EventArgs e)
    {
        string eventName = eventNameTextBox.Text;

        SedogoEvent sedogoEvent = new SedogoEvent(Session["loggedInUserFullName"].ToString());
        sedogoEvent.userID = int.Parse(Session["loggedInUserID"].ToString());
        sedogoEvent.eventName = eventName;
        sedogoEvent.eventDescription = eventDescriptionTextBox.Text;
        sedogoEvent.eventVenue = eventVenueTextBox.Text;

        if (dateTypeDropDownList.SelectedValue == "D")
        {
            sedogoEvent.startDate = CalendarStartDate.SelectedDate;
        }
        if (dateTypeDropDownList.SelectedValue == "R")
        {
            sedogoEvent.rangeStartDate = CalendarRangeStartDate.SelectedDate;
            sedogoEvent.rangeEndDate = CalendarRangeEndDate.SelectedDate;
        }
        if (dateTypeDropDownList.SelectedValue == "A")
        {
            sedogoEvent.beforeBirthday = int.Parse(birthdayDropDownList.SelectedValue);
        }
        sedogoEvent.dateType = dateTypeDropDownList.SelectedValue;
        sedogoEvent.categoryID = int.Parse(categoryDropDownList.SelectedValue);
        sedogoEvent.privateEvent = privateEventCheckbox.Checked;
        sedogoEvent.mustDo = false;
        sedogoEvent.timezoneID = int.Parse(timezoneDropDownList.SelectedValue);
        sedogoEvent.Add();

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