Ejemplo n.º 1
0
        protected void btnAcceptInvite_Click(object sender, EventArgs e)
        {
            try
            {
                // Already a member, so allow to accept the invitation by inserting record into the GroupMember Table
                groupId = Convert.ToInt64(Request.QueryString["groupId"]);
                email   = Request.QueryString["email"].ToString();
                long groupMemberId = 0;

                EZDiscuss.Classes.Group group = new Classes.Group();
                //memberId = Convert.ToInt64(Session["Member" + memberId.ToString()]);
                groupMemberId = group.GroupMemberCreate(groupId, MemberId);
                if (groupMemberId > 0)
                {
                    lMsg.Text = "Thank you for accepting the invitation. You are now a member of the Group.";
                }
                else
                {
                    lMsg.Text = "There was a problem processing your invitation.";
                }
            }
            catch (Exception ex)
            {
                EZDiscuss.Classes.Helper.LogError("AcceptInvite.aspx", "btnAcceptInvite_Click", ex.Message, memberId);
            }
        }
Ejemplo n.º 2
0
        private void LoadGroups()
        {
            long memberId = Convert.ToInt64(Request.QueryString["memberId"]);

            // Retrieve all the Groups for this member and load them into the Dropdownlist
            EZDiscuss.Classes.Group grp = new Classes.Group();
            DataSet dsGroups            = grp.RetrieveAllGroups(memberId);
        }
Ejemplo n.º 3
0
        private void LoadGroups(int selectedGroup)
        {
            try
            {
                EZDiscuss.Classes.Group grp = new Classes.Group();
                string paddedMemberId       = Request.QueryString["memberId"].ToString();
                long   memberId             = EZDiscuss.Classes.Helper.UnPadMemberId(paddedMemberId);
                if (memberId > 0)
                {
                    Session["memberId"] = memberId;
                    DataSet ds = grp.RetrieveAllGroups(memberId);
                    if (ds.Tables.Count > 0)
                    {
                        DataTable dtGroups = null;
                        // Bind the Groups that the User Created
                        switch (selectedGroup)
                        {
                        case 1:
                            dtGroups             = ds.Tables[0];
                            ddlGroups.DataSource = dtGroups;
                            break;

                        case 2:
                            dtGroups             = ds.Tables[1];
                            ddlGroups.DataSource = dtGroups;
                            break;

                        case 3:
                            // Merge the 2 datatables
                            dtGroups = ds.Tables[0];
                            DataTable dtJoined = ds.Tables[1];
                            dtGroups.Merge(dtJoined);
                            ddlGroups.DataSource = dtGroups;
                            break;
                        }

                        ddlGroups.DataTextField  = "GroupName";
                        ddlGroups.DataValueField = "GroupId";
                        ddlGroups.DataBind();

                        ListItem selectItem = new ListItem("Select Group...", "0");
                        ddlGroups.Items.Insert(0, selectItem);
                    }
                    else
                    {
                        ddlGroups.DataSource = null;
                        ddlGroups.DataBind();
                    }
                }
            }
            catch (Exception ex)
            {
                if (Session["memberId"] != null)
                {
                    EZDiscuss.Classes.Helper.LogError("DiscussionBoard.aspx", "LoadGroups", ex.Message, (long)Session["memberId"]);
                }
                else
                {
                    EZDiscuss.Classes.Helper.LogError("DiscussionBoard.aspx", "LoadGroups", ex.Message, 0);
                }
            }
        }