예제 #1
0
        public string RightColumnGetFriendsOnline()
        {
            StringBuilder FriendsOnline = new StringBuilder();

            FriendshipDAL friendsOnlineDAL = new FriendshipDAL();

            List <Member> FriendsOnlineList = new List <Member>();

            FriendsOnlineList = friendsOnlineDAL.GetAllFriendsOnline(aMember);
            int countFriendsOnline = FriendsOnlineList.Count;

            //listBox3.DataSource = FriendsOnlineList;
            //listBox3.DisplayMember = "Displayname";
            //listBox3.ValueMember = "MemberID";

            if (countFriendsOnline == 0)
            {
                FriendsOnline.Append("<li><a ");
                FriendsOnline.Append(" >");
                FriendsOnline.Append("There are no friends online");
                FriendsOnline.Append("</a></li>");
            }
            else
            {
                for (int i = 0; i < countFriendsOnline; ++i)
                {
                    FriendsOnline.Append("<li><a class = 'btnMemberProfile' id='");
                    FriendsOnline.Append(FriendsOnlineList[i].MemberId);
                    FriendsOnline.Append("' >");
                    FriendsOnline.Append(FriendsOnlineList[i].DisplayName);
                    FriendsOnline.Append("</a></li>");
                }
            }

            return(FriendsOnline.ToString());
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            pageTitle.Text = "Profile";

            if (!IsPostBack)
            {
                if (Session["memberID"] == null)
                {
                    Response.Redirect("~/Login.aspx");
                }
                else if (loginDAL.GetMemberStatus(member_Status = new Member_Status(Session["memberID"].ToString())))
                {
                    if (Request.Cookies["login"] != null)
                    {
                        var c = new HttpCookie("login");
                        c.Expires = DateTime.Now.AddDays(-1);
                        Response.Cookies.Add(c);
                        Session.Abandon();
                    }

                    Response.Redirect("~/Login.aspx");
                }
                else if (Context.Session["profileFriendID"] != Context.Session["memberID"] && Context.Session["profileFriendID"] != null)
                {
                    aFriend.MemberId = Context.Session["profileFriendID"].ToString();

                    aMember.MemberId = Context.Session["memberID"].ToString();

                    GenerateProfile(aFriend);

                    #region BUILD PROFILE BUTTONS
                    //Building profile buttons

                    //To update status on form
                    //=====================================================================
                    FriendshipDAL.GetInvitationStatus(aMember, aFriend);

                    List <Member_Friend> statusList = new List <Member_Friend>();

                    statusList = FriendshipDAL.GetInvitationStatus(aMember, aFriend);
                    FriendshipDAL dal = new FriendshipDAL();
                    if (statusList.Count == 0)
                    {
                        btnProfile.Append("<a class='button  big addfriend' id='addfriend' >Add as friend</a><br />");
                    }
                    else
                    {
                        string InvitationStatus = statusList[0].InvitationStatus;
                        //=====================================================================

                        if (InvitationStatus == "Pending")
                        {
                            if (dal.MemberIsActaullyTheMember(aMember, aFriend) == 1)
                            {
                                btnProfile.Append("<a class='button  big disabledBtn' id='requestPending'  >Request Pending..</a><br />");
                                btnProfile.Append("<a class='button  big ' id='blockfriend' >Block this Person</a><br />");
                            }
                            else if (dal.FriendIsActaullyTheMember(aMember, aFriend) == 1)
                            {
                                btnProfile.Append("<a class='button  big ' id='acceptRequest' >Accept Request</a><br />");
                                btnProfile.Append("<a class='button  big ' id='blockfriend' >Block this Person</a><br />");
                            }
                        }

                        else if (InvitationStatus == "Ignored")
                        {
                            btnProfile.Append("<a class='button  big ' id='Ignored' >Ignored</a><br />");
                            btnProfile.Append("<a class='button  big ' id='blockfriend' >Block this Person</a><br />");
                        }
                        else
                        {
                            //Accepted

                            btnProfile.Append("<a class='button  big ' id='reportfriend' >Report this Person</a><br />");

                            #region GET BLOCKED STATUS
                            dal = new FriendshipDAL();


                            if (dal.MemberIsActaullyTheMember(aMember, aFriend) == 1)
                            {
                                List <Member_Friend> BlockedList = new List <Member_Friend>();

                                BlockedList = dal.GetFriendBlockedMemberStatus(aMember, aFriend);

                                if (BlockedList.Count != 0)
                                {
                                    if (BlockedList[0].FriendBlockedMember == false)
                                    {
                                        btnProfile.Append("<a class='button  big ' id='sendMessage' >Send Message</a><br />");

                                        //CHECK IF I BLOCKED THE FRIEND
                                        List <Member_Friend> IBlockedFriend = new List <Member_Friend>();
                                        IBlockedFriend = dal.GetMemberBlockedFriendStatus(aFriend, aMember);

                                        if (IBlockedFriend.Count != 0)
                                        {
                                            if (IBlockedFriend[0].MemberBlockedFriend == false)
                                            {
                                                btnProfile.Append("<a class='button  big ' id='blockfriend' >Block this Person</a><br />");
                                            }
                                            else
                                            {
                                                btnProfile.Append("<a class='button  big ' id='blockfriend' >Unblock this Person</a><br />");
                                            }

                                            btnProfile.Append("<a class='button  big removeFriend'  id='addfriend'>Remove Friend</a><br />");
                                        }
                                    }
                                }
                            }
                            else if (dal.FriendIsActaullyTheMember(aMember, aFriend) == 1)
                            {
                                List <Member_Friend> BlockedList = new List <Member_Friend>();

                                BlockedList = dal.GetMemberBlockedFriendStatus(aMember, aFriend);

                                if (BlockedList.Count != 0)
                                {
                                    if (BlockedList[0].MemberBlockedFriend == false)
                                    {
                                        btnProfile.Append("<a class='button  big ' id='sendMessage' >Send Message</a><br />");

                                        //CHECK IF I BLOCKED THE FRIEND
                                        List <Member_Friend> IBlockedFriend = new List <Member_Friend>();
                                        IBlockedFriend = dal.GetFriendBlockedMemberStatus(aFriend, aMember);

                                        if (IBlockedFriend.Count != 0)
                                        {
                                            if (IBlockedFriend[0].FriendBlockedMember == false)
                                            {
                                                btnProfile.Append("<a class='button  big ' id='blockfriend' >Block this Person</a><br />");
                                            }
                                            else
                                            {
                                                btnProfile.Append("<a class='button  big ' id='blockfriend' >Unblock this Person</a><br />");
                                            }

                                            btnProfile.Append("<a class='button  big removeFriend'  id='addfriend'>Remove Friend</a><br />");
                                        }
                                    }
                                }
                            }

                            //btnProfile.Append("<a class='button  big ' id='blockfriend' >Block this Person</a><br />");

                            //               <a class="button  big " id="reportfriend" >Report this Person</a><br />
                            //               <a class="button  big " id="blockfriend" >Block this Person</a>
                            #endregion
                        }
                    }
                    profileButtons = btnProfile.ToString();
                    #endregion
                }
                else
                {
                    aMember.MemberId = Context.Session["memberID"].ToString();
                    GenerateProfile(aMember);
                }
            }//END IF ITS NOT POSTBACK
            else if (profileFriendID.Value != "")
            {
                #region REDIRECT TO CLICKED PROFILE
                //REDIRECT TO CLICKED PROFILE===================================================================
                if (profileFriendID.Value != null)
                {
                    Session["profileFriendID"] = profileFriendID.Value;
                    profileFriendID.Value      = null;


                    Response.Redirect("~/Profile.aspx");
                }
                //=============================================================================================
                #endregion
            }
            else if (GoToGroupPageID.Value != "")
            {
                Session["GroupInfo"] = GoToGroupPageID.Value;
                Response.Redirect("~/Group.aspx");
            }


            if (Context.Session["profileFriendID"] != Context.Session["memberID"] && Context.Session["profileFriendID"] != null)
            {
                heading = aFriend.FirstName + " " + aFriend.LastName;
            }
            else
            {
                heading = aMember.FirstName + " " + aMember.LastName;
            }
            profileName.Value = heading;
        }
예제 #3
0
        public string RightColumnGetFriendsOnline()
        {
            StringBuilder FriendsOnline = new StringBuilder();

            FriendshipDAL friendsOnlineDAL = new FriendshipDAL();

            List<Member> FriendsOnlineList = new List<Member>();

            FriendsOnlineList = friendsOnlineDAL.GetAllFriendsOnline(aMember);
            int countFriendsOnline = FriendsOnlineList.Count;

            //listBox3.DataSource = FriendsOnlineList;
            //listBox3.DisplayMember = "Displayname";
            //listBox3.ValueMember = "MemberID";

            if (countFriendsOnline == 0)
            {
                FriendsOnline.Append("<li><a ");
                FriendsOnline.Append(" >");
                FriendsOnline.Append("There are no friends online");
                FriendsOnline.Append("</a></li>");
            }
            else
            {
                for (int i = 0; i < countFriendsOnline; ++i)
                {
                    FriendsOnline.Append("<li><a class = 'btnMemberProfile' id='");
                    FriendsOnline.Append(FriendsOnlineList[i].MemberId);
                    FriendsOnline.Append("' >");
                    FriendsOnline.Append(FriendsOnlineList[i].DisplayName);
                    FriendsOnline.Append("</a></li>");

                }
            }

            return FriendsOnline.ToString();
        }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Literal title = (Literal)Master.FindControl("pageTitle");

            title.Text = "My Friends";

            if (!IsPostBack)
            {
                if (Session["memberID"] == null)
                {
                    Response.Redirect("~/Login.aspx");
                }

                else
                {
                    #region RIGHT COLUMN GET 5 JOINEDGROUPS
                    //JOINED GROUPS==============================================================================


                    string memberId = Context.Session["memberID"].ToString();
                    aMember.MemberId = memberId;

                    Reusable_Methods reusable_Methods = new Reusable_Methods(aMember);
                    allgroups = reusable_Methods.RightColumnGet5JoinedGroups();

                    //===========================================================================================
                    #endregion

                    #region ALL BLOCKED FRIENDS
                    //ALL BLOCKED FRIENDS========================================================================


                    FriendshipDAL dal = new FriendshipDAL();

                    aMember.MemberId = memberId;

                    List <Member> BlockedMembersList = new List <Member>();

                    BlockedMembersList = dal.GetAllBlockedFriends(aMember);
                    int countAllBlockedFriends = BlockedMembersList.Count;

                    StringBuilder CountBlockedFriends = new StringBuilder();
                    CountBlockedFriends.Append("<h4 class='shinyRed ui-corner-top' >Blocked People (<span>");
                    CountBlockedFriends.Append(countAllBlockedFriends);
                    CountBlockedFriends.Append("</span>)</h4>");

                    CountBlockedFriendsString = CountBlockedFriends.ToString();
                    //display on names of blocked members. use value memeber
                    //listBox1.DataSource = BlockedMembersList;
                    //listBox1.DisplayMember = "DisplayName";
                    //listBox1.ValueMember = "MemberID";

                    StringBuilder AllBlockedFriends = new StringBuilder();

                    for (int i = 0; i < countAllBlockedFriends; ++i)
                    {
                        AllBlockedFriends.Append("<div class='aPost btnMemberProfile FriendSpacing' id='");
                        AllBlockedFriends.Append(BlockedMembersList[i].MemberId);
                        AllBlockedFriends.Append("'><div class='msgeHeading ui-corner-all' ><h2 class='ui-corner-all'> <a href='#' class=' ' style='font-weight:normal; '>");
                        AllBlockedFriends.Append(BlockedMembersList[i].DisplayName);

                        AllBlockedFriends.Append("</a><span class=' ui-corner-all floatright'>");
                        if (BlockedMembersList[i].IsOnline == true)
                        {
                            AllBlockedFriends.Append("Online");
                        }
                        else
                        {
                            AllBlockedFriends.Append("Offline");
                        }

                        AllBlockedFriends.Append("</span></h2></div>");

                        AllBlockedFriends.Append("</div>");
                    }

                    AllBlockedFriendsString = AllBlockedFriends.ToString();
                    //===========================================================================================
                    #endregion

                    #region ALL FRIENDS
                    //ALL FRIENDS================================================================================


                    //ALL FRIENDS

                    dal = new FriendshipDAL();

                    aMember.MemberId = memberId;

                    List <Member> FriendsList = new List <Member>();

                    FriendsList = dal.GetAllFriends(aMember);
                    int countAllFriends = FriendsList.Count;

                    StringBuilder CountFriends = new StringBuilder();
                    CountFriends.Append("<h4  class='shinyGreen ui-corner-top'> All Friends (<span>");
                    CountFriends.Append(countAllFriends);
                    CountFriends.Append("</span>)</h4>");
                    CountFriendsString = CountFriends.ToString();

                    StringBuilder AllFriends = new StringBuilder();

                    for (int i = 0; i < countAllFriends; ++i)
                    {
                        AllFriends.Append("<div class='aPost btnMemberProfile FriendSpacing' id='");
                        AllFriends.Append(FriendsList[i].MemberId);
                        AllFriends.Append("'><div class='msgeHeading ui-corner-all' ><h2 class='ui-corner-all'> <a href='#' class=' ' style='font-weight:normal;'>");
                        AllFriends.Append(FriendsList[i].DisplayName);

                        AllFriends.Append("</a><span class=' ui-corner-all floatright'>");
                        if (FriendsList[i].IsOnline == true)
                        {
                            AllFriends.Append("Online");
                        }
                        else
                        {
                            AllFriends.Append("Offline");
                        }

                        AllFriends.Append("</span></h2></div>");

                        AllFriends.Append("</div>");
                    }

                    AllFriendsString = AllFriends.ToString();
                    //===========================================================================================
                    #endregion

                    #region ALL FRIEND INVITES
                    //ALL FRIEND INVITES================================================================================


                    //ALL FRIEND INVITES

                    dal = new FriendshipDAL();

                    aMember.MemberId = memberId;

                    List <Member> FriendInvitesList = new List <Member>();

                    FriendInvitesList = dal.GetAllFriendInvites(aMember);
                    int countAllFriendsInvites = FriendInvitesList.Count;

                    StringBuilder CountFriendsInvites = new StringBuilder();
                    CountFriendsInvites.Append("<h4  class='shinyLightBlue ui-corner-top' >Invites (<span>");
                    CountFriendsInvites.Append(countAllFriendsInvites);
                    CountFriendsInvites.Append("</span>)</h4>");
                    CountFriendsInvitesString = CountFriendsInvites.ToString();

                    StringBuilder AllFriendsInvites = new StringBuilder();

                    for (int i = 0; i < countAllFriendsInvites; ++i)
                    {
                        AllFriendsInvites.Append("<div class='aPost btnMemberProfile FriendSpacing' id='");
                        AllFriendsInvites.Append(FriendInvitesList[i].MemberId);
                        AllFriendsInvites.Append("'><div class='msgeHeading ui-corner-all' ><h2 class='ui-corner-all'> <a href='#' class=' ' style='font-weight:normal;'>");
                        AllFriendsInvites.Append(FriendInvitesList[i].DisplayName);

                        AllFriendsInvites.Append("</a><span class=' ui-corner-all floatright'>");
                        if (FriendInvitesList[i].IsOnline == true)
                        {
                            AllFriendsInvites.Append("Online");
                        }
                        else
                        {
                            AllFriendsInvites.Append("Offline");
                        }

                        AllFriendsInvites.Append("</span></h2></div>");

                        AllFriendsInvites.Append("</div>");
                    }

                    AllFriendsInvitesString = AllFriendsInvites.ToString();
                    //===========================================================================================
                    #endregion

                    #region RIGHT COLUMN FRIENDS ONLINE
                    //FRIENDS ONLINE==============================================================================

                    memberId         = Context.Session["memberID"].ToString();
                    aMember.MemberId = memberId;

                    reusable_Methods    = new Reusable_Methods(aMember);
                    FriendsOnlineString = reusable_Methods.RightColumnGetFriendsOnline();

                    //===========================================================================================
                    #endregion
                }
            }
        }
예제 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Literal title = (Literal)Master.FindControl("pageTitle");
            title.Text = "My Friends";

            if (!IsPostBack)
            {
                if (Session["memberID"] == null)
                {

                    Response.Redirect("~/Login.aspx");

                }

                else
                {
                    #region RIGHT COLUMN GET 5 JOINEDGROUPS
                    //JOINED GROUPS==============================================================================

                    string memberId = Context.Session["memberID"].ToString();
                    aMember.MemberId = memberId;

                    Reusable_Methods reusable_Methods = new Reusable_Methods(aMember);
                    allgroups = reusable_Methods.RightColumnGet5JoinedGroups();

                    //===========================================================================================
                    #endregion

                    #region ALL BLOCKED FRIENDS
                    //ALL BLOCKED FRIENDS========================================================================

                    FriendshipDAL dal = new FriendshipDAL();

                    aMember.MemberId = memberId;

                    List<Member> BlockedMembersList = new List<Member>();

                    BlockedMembersList = dal.GetAllBlockedFriends(aMember);
                    int countAllBlockedFriends = BlockedMembersList.Count;

                    StringBuilder CountBlockedFriends = new StringBuilder();
                    CountBlockedFriends.Append("<h4 class='shinyRed ui-corner-top' >Blocked People (<span>");
                    CountBlockedFriends.Append(countAllBlockedFriends);
                    CountBlockedFriends.Append("</span>)</h4>");

                    CountBlockedFriendsString = CountBlockedFriends.ToString();
                    //display on names of blocked members. use value memeber
                    //listBox1.DataSource = BlockedMembersList;
                    //listBox1.DisplayMember = "DisplayName";
                    //listBox1.ValueMember = "MemberID";

                    StringBuilder AllBlockedFriends = new StringBuilder();

                    for (int i = 0; i < countAllBlockedFriends; ++i)
                    {
                        AllBlockedFriends.Append("<div class='aPost btnMemberProfile FriendSpacing' id='");
                        AllBlockedFriends.Append(BlockedMembersList[i].MemberId);
                        AllBlockedFriends.Append("'><div class='msgeHeading ui-corner-all' ><h2 class='ui-corner-all'> <a href='#' class=' ' style='font-weight:normal; '>");
                        AllBlockedFriends.Append(BlockedMembersList[i].DisplayName);

                        AllBlockedFriends.Append("</a><span class=' ui-corner-all floatright'>");
                        if (BlockedMembersList[i].IsOnline == true)
                        {
                            AllBlockedFriends.Append("Online");
                        }
                        else
                        {
                            AllBlockedFriends.Append("Offline");
                        }

                        AllBlockedFriends.Append("</span></h2></div>");

                        AllBlockedFriends.Append("</div>");
                    }

                    AllBlockedFriendsString = AllBlockedFriends.ToString();
                    //===========================================================================================
                    #endregion

                    #region ALL FRIENDS
                    //ALL FRIENDS================================================================================

                    //ALL FRIENDS

                    dal = new FriendshipDAL();

                    aMember.MemberId = memberId;

                    List<Member> FriendsList = new List<Member>();

                    FriendsList = dal.GetAllFriends(aMember);
                    int countAllFriends = FriendsList.Count;

                    StringBuilder CountFriends = new StringBuilder();
                    CountFriends.Append("<h4  class='shinyGreen ui-corner-top'> All Friends (<span>");
                    CountFriends.Append(countAllFriends);
                    CountFriends.Append("</span>)</h4>");
                    CountFriendsString = CountFriends.ToString();

                    StringBuilder AllFriends = new StringBuilder();

                    for (int i = 0; i < countAllFriends; ++i)
                    {

                        AllFriends.Append("<div class='aPost btnMemberProfile FriendSpacing' id='");
                        AllFriends.Append(FriendsList[i].MemberId);
                        AllFriends.Append("'><div class='msgeHeading ui-corner-all' ><h2 class='ui-corner-all'> <a href='#' class=' ' style='font-weight:normal;'>");
                        AllFriends.Append(FriendsList[i].DisplayName);

                        AllFriends.Append("</a><span class=' ui-corner-all floatright'>");
                        if (FriendsList[i].IsOnline == true)
                        {
                            AllFriends.Append("Online");
                        }
                        else
                        {
                            AllFriends.Append("Offline");
                        }

                        AllFriends.Append("</span></h2></div>");

                        AllFriends.Append("</div>");

                    }

                    AllFriendsString = AllFriends.ToString();
                    //===========================================================================================
                    #endregion

                    #region ALL FRIEND INVITES
                    //ALL FRIEND INVITES================================================================================

                    //ALL FRIEND INVITES

                    dal = new FriendshipDAL();

                    aMember.MemberId = memberId;

                    List<Member> FriendInvitesList = new List<Member>();

                    FriendInvitesList = dal.GetAllFriendInvites(aMember);
                    int countAllFriendsInvites = FriendInvitesList.Count;

                    StringBuilder CountFriendsInvites = new StringBuilder();
                    CountFriendsInvites.Append("<h4  class='shinyLightBlue ui-corner-top' >Invites (<span>");
                    CountFriendsInvites.Append(countAllFriendsInvites);
                    CountFriendsInvites.Append("</span>)</h4>");
                    CountFriendsInvitesString = CountFriendsInvites.ToString();

                    StringBuilder AllFriendsInvites = new StringBuilder();

                    for (int i = 0; i < countAllFriendsInvites; ++i)
                    {

                        AllFriendsInvites.Append("<div class='aPost btnMemberProfile FriendSpacing' id='");
                        AllFriendsInvites.Append(FriendInvitesList[i].MemberId);
                        AllFriendsInvites.Append("'><div class='msgeHeading ui-corner-all' ><h2 class='ui-corner-all'> <a href='#' class=' ' style='font-weight:normal;'>");
                        AllFriendsInvites.Append(FriendInvitesList[i].DisplayName);

                        AllFriendsInvites.Append("</a><span class=' ui-corner-all floatright'>");
                        if (FriendInvitesList[i].IsOnline == true)
                        {
                            AllFriendsInvites.Append("Online");
                        }
                        else
                        {
                            AllFriendsInvites.Append("Offline");
                        }

                        AllFriendsInvites.Append("</span></h2></div>");

                        AllFriendsInvites.Append("</div>");
                    }

                    AllFriendsInvitesString = AllFriendsInvites.ToString();
                    //===========================================================================================
                    #endregion

                    #region RIGHT COLUMN FRIENDS ONLINE
                    //FRIENDS ONLINE==============================================================================

                    memberId = Context.Session["memberID"].ToString();
                    aMember.MemberId = memberId;

                    reusable_Methods = new Reusable_Methods(aMember);
                    FriendsOnlineString = reusable_Methods.RightColumnGetFriendsOnline();

                    //===========================================================================================
                    #endregion
                }
            }
        }
예제 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            pageTitle.Text = "Profile";

            if (!IsPostBack)
            {
                if (Session["memberID"] == null)
                {

                    Response.Redirect("~/Login.aspx");

                }
                else if (loginDAL.GetMemberStatus(member_Status = new Member_Status(Session["memberID"].ToString())))
                {
                    if (Request.Cookies["login"] != null)
                    {
                        var c = new HttpCookie("login");
                        c.Expires = DateTime.Now.AddDays(-1);
                        Response.Cookies.Add(c);
                        Session.Abandon();
                    }

                    Response.Redirect("~/Login.aspx");
                }
                else if (Context.Session["profileFriendID"] != Context.Session["memberID"] && Context.Session["profileFriendID"] != null)
                {
                    aFriend.MemberId = Context.Session["profileFriendID"].ToString();

                    aMember.MemberId = Context.Session["memberID"].ToString();

                    GenerateProfile(aFriend);

                    #region BUILD PROFILE BUTTONS
                    //Building profile buttons

                    //To update status on form
                    //=====================================================================
                    FriendshipDAL.GetInvitationStatus(aMember, aFriend);

                    List<Member_Friend> statusList = new List<Member_Friend>();

                    statusList = FriendshipDAL.GetInvitationStatus(aMember, aFriend);
                    FriendshipDAL dal = new FriendshipDAL();
                    if (statusList.Count == 0)
                    {
                        btnProfile.Append("<a class='button  big addfriend' id='addfriend' >Add as friend</a><br />");
                    }
                    else
                    {
                        string InvitationStatus = statusList[0].InvitationStatus;
                        //=====================================================================

                        if (InvitationStatus == "Pending")
                        {
                            if (dal.MemberIsActaullyTheMember(aMember, aFriend) == 1)
                            {
                                btnProfile.Append("<a class='button  big disabledBtn' id='requestPending'  >Request Pending..</a><br />");
                                btnProfile.Append("<a class='button  big ' id='blockfriend' >Block this Person</a><br />");
                            }
                            else if (dal.FriendIsActaullyTheMember(aMember, aFriend) == 1)
                            {
                                btnProfile.Append("<a class='button  big ' id='acceptRequest' >Accept Request</a><br />");
                                btnProfile.Append("<a class='button  big ' id='blockfriend' >Block this Person</a><br />");
                            }
                        }

                        else if (InvitationStatus == "Ignored")
                        {
                            btnProfile.Append("<a class='button  big ' id='Ignored' >Ignored</a><br />");
                            btnProfile.Append("<a class='button  big ' id='blockfriend' >Block this Person</a><br />");
                        }
                        else
                        {
                            //Accepted

                            btnProfile.Append("<a class='button  big ' id='reportfriend' >Report this Person</a><br />");

                            #region GET BLOCKED STATUS
                            dal = new FriendshipDAL();

                            if (dal.MemberIsActaullyTheMember(aMember, aFriend) == 1)
                            {
                                List<Member_Friend> BlockedList = new List<Member_Friend>();

                                BlockedList = dal.GetFriendBlockedMemberStatus(aMember, aFriend);

                                if (BlockedList.Count != 0)
                                {
                                    if (BlockedList[0].FriendBlockedMember == false)
                                    {
                                        btnProfile.Append("<a class='button  big ' id='sendMessage' >Send Message</a><br />");

                                        //CHECK IF I BLOCKED THE FRIEND
                                        List<Member_Friend> IBlockedFriend = new List<Member_Friend>();
                                        IBlockedFriend = dal.GetMemberBlockedFriendStatus(aFriend, aMember);

                                        if (IBlockedFriend.Count != 0)
                                        {
                                            if (IBlockedFriend[0].MemberBlockedFriend == false)
                                            {
                                                btnProfile.Append("<a class='button  big ' id='blockfriend' >Block this Person</a><br />");
                                            }
                                            else
                                            {
                                                btnProfile.Append("<a class='button  big ' id='blockfriend' >Unblock this Person</a><br />");
                                            }

                                            btnProfile.Append("<a class='button  big removeFriend'  id='addfriend'>Remove Friend</a><br />");
                                        }
                                    }
                                }
                            }
                            else if (dal.FriendIsActaullyTheMember(aMember, aFriend) == 1)
                            {

                                List<Member_Friend> BlockedList = new List<Member_Friend>();

                                BlockedList = dal.GetMemberBlockedFriendStatus(aMember, aFriend);

                                if (BlockedList.Count != 0)
                                {
                                    if (BlockedList[0].MemberBlockedFriend == false)
                                    {
                                        btnProfile.Append("<a class='button  big ' id='sendMessage' >Send Message</a><br />");

                                        //CHECK IF I BLOCKED THE FRIEND
                                        List<Member_Friend> IBlockedFriend = new List<Member_Friend>();
                                        IBlockedFriend = dal.GetFriendBlockedMemberStatus(aFriend, aMember);

                                        if (IBlockedFriend.Count != 0)
                                        {
                                            if (IBlockedFriend[0].FriendBlockedMember == false)
                                            {
                                                btnProfile.Append("<a class='button  big ' id='blockfriend' >Block this Person</a><br />");
                                            }
                                            else
                                            {
                                                btnProfile.Append("<a class='button  big ' id='blockfriend' >Unblock this Person</a><br />");
                                            }

                                            btnProfile.Append("<a class='button  big removeFriend'  id='addfriend'>Remove Friend</a><br />");
                                        }
                                    }
                                }
                            }

                            //btnProfile.Append("<a class='button  big ' id='blockfriend' >Block this Person</a><br />");

                            //               <a class="button  big " id="reportfriend" >Report this Person</a><br />
                            //               <a class="button  big " id="blockfriend" >Block this Person</a>
                            #endregion
                        }

                    }
                    profileButtons = btnProfile.ToString();
                    #endregion

                }
                else
                {
                    aMember.MemberId = Context.Session["memberID"].ToString();
                    GenerateProfile(aMember);
                }

            }//END IF ITS NOT POSTBACK
            else if (profileFriendID.Value != "")
            {
                #region REDIRECT TO CLICKED PROFILE
                //REDIRECT TO CLICKED PROFILE===================================================================
                if (profileFriendID.Value != null)
                {
                    Session["profileFriendID"] = profileFriendID.Value;
                    profileFriendID.Value = null;

                    Response.Redirect("~/Profile.aspx");

                }
                //=============================================================================================
                #endregion
            }
            else if (GoToGroupPageID.Value != "")
            {
                Session["GroupInfo"] = GoToGroupPageID.Value;
                Response.Redirect("~/Group.aspx");

            }

            if (Context.Session["profileFriendID"] != Context.Session["memberID"] && Context.Session["profileFriendID"] != null)
            {
                heading = aFriend.FirstName + " " + aFriend.LastName;
            }
            else
            {
                heading = aMember.FirstName + " " + aMember.LastName;
            }
            profileName.Value = heading;
        }