/// <summary>
 /// This method will call the Event Manager method to set the RSVP status for a Guest of the event
 /// </summary>
 /// <param name="objGuestToAdd">An CompleteGuestList Object which contain Guest and it's RSVP status</param>
 /// <param name="objEvent">An Events Object which contain event details</param>
 public void AddRsvp(CompleteGuestList objGuestToAdd, int EventId, int UserId)
 {
     try
     {
         FacadeManager.EventManager.AddRsvp(objGuestToAdd, EventId, UserId);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 /// <summary>
 /// This method will call the Event resource method to set the RSVP status for a Guest of the event
 /// </summary>
 /// <param name="objGuestToAdd">An CompleteGuestList Object which contain Guest and it's RSVP status</param>
 /// <param name="objEvent">An Events Object which contain event details</param>
 public void AddRsvp(CompleteGuestList objGuestToAdd, int EventId, int UserId)
 {
     try
     {
         EventResource objEventRes = new EventResource();
         int RSVPId =objEventRes.AddRsvp(objGuestToAdd, EventId, UserId);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
    private void PopulateCompleteGuestListFromRepeater()
    {
        int i = -1;
        foreach (RepeaterItem objRsvp in repRSVP.Items)
        {
            if (objRsvp.ItemIndex > -1)
            {
                i++;
                if (_CompleteGuestList[i] == null) _CompleteGuestList[i] = new CompleteGuestList();
                if (_CompleteGuestList[i] != null)
                {
                    TextBox txtFirstName = (TextBox)objRsvp.FindControl("txtFirstName");
                    _CompleteGuestList[i].FirstName = txtFirstName != null ? txtFirstName.Text : "";
                    TextBox txtLastName = (TextBox)objRsvp.FindControl("txtLastName");
                    _CompleteGuestList[i].LastName = txtLastName != null ? txtLastName.Text : "";
                    TextBox txtPhoneNumber = (TextBox)objRsvp.FindControl("txtPhoneNumber");
                    _CompleteGuestList[i].PhoneNumber = txtPhoneNumber != null ? txtPhoneNumber.Text : "";
                    TextBox txtEmail = (TextBox)objRsvp.FindControl("txtEmail");
                    _CompleteGuestList[i].Email = txtEmail != null ? txtEmail.Text : "";

                    DropDownList ddlMealOption = (DropDownList)objRsvp.FindControl("ddlMealOption");
                    if (ddlMealOption != null && !Equals(ddlMealOption.Text, "0"))
                    {
                        _CompleteGuestList[i].MealOption = ddlMealOption.Text;
                    }

                    //RadioButton rdoEventRSVPAttending = (RadioButton)objRsvp.FindControl("rdoEventRSVPAttending");
                    //RadioButton rdoEventRSVPMaybe = (RadioButton)objRsvp.FindControl("rdoEventRSVPMaybe");
                    //RadioButton rdoEventRSVPNot = (RadioButton)objRsvp.FindControl("rdoEventRSVPNot");
                    RadioButtonList rblRSVP = ((RadioButtonList)objRsvp.FindControl("rblRSVP"));
                    if (rblRSVP.SelectedIndex == 0)
                        _CompleteGuestList[i].RsvpStatus = "Attending";
                    else if (rblRSVP.SelectedIndex == 1)
                        _CompleteGuestList[i].RsvpStatus = "Maybe Attending";
                    else if (rblRSVP.SelectedIndex == 2)
                        _CompleteGuestList[i].RsvpStatus = "Not Attending";
                    else
                        _CompleteGuestList[i].RsvpStatus = "Awaiting Response";

                    _CompleteGuestList[i].Comment = txtComment.Text;
                }
            }
        }

        //StateManager objStateManager = StateManager.Instance;
        //objStateManager.Add("CompleteGuestList", _CompleteGuestList, StateManager.State.Session);
    }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="objGuestToAdd"></param>
 /// <returns></returns>
 public object UpdateRsvp(CompleteGuestList objGuestToAdd)
 {
     object identity = null;
     try
     {
         EventResource objEventRes = new EventResource();
         identity = objEventRes.UpdateRsvp(objGuestToAdd);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return identity;
 }