示例#1
0
        public void AddEventPost(string sessionMemberID, string startDate, string endDate, string name, string host, string venue, int groupID, string details, string type)
        {
            memberID = sessionMemberID;
            StringBuilder htmlText = new StringBuilder();
            Member        aMember  = new Member(memberID);

            Group aGroup = new Group(groupID);

            PostDAL postDAL = new PostDAL();

            Reusable_Methods reusable_Methods = new Reusable_Methods();

            /*
             * NEEDS ATTENTION !!!!!!!!!
             *
             *
             */

            DateTime startDateD = reusable_Methods.CreateDateTime(startDate);
            DateTime endDateD   = reusable_Methods.CreateDateTime(endDate);


            /*
             * END NEEDS ATTENTION !!!!!!!!!
             */

            //DateTime startDateD = reusable_Methods.FormatDateFromDateTimePicker(startDate);
            //  DateTime endDateD = reusable_Methods.FormatDateFromDateTimePicker(endDate);

            Event_Post aEvent_Post = new Event_Post(name, details, venue, startDateD, endDateD, host, type);
            int        postId      = postDAL.InsertEvent(aEvent_Post, aGroup, aMember);

            #region GET POST
            ArrayPosts = bl.GetASinglePost(postId);
            int count = ArrayPosts.Count;

            for (int i = 0; i < count; ++i)
            {
                OpenWrapper(i);

                #region EVENT POST
                GetEventPosts();
                #endregion

                CloseWrapper();
            }

            #endregion

            string postToClients = concatinater.ToString();

            //Updating all Clients
            Clients.insertEvent(Context.ConnectionId, postToClients, groupID);
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Literal title = (Literal)Master.FindControl("pageTitle");
            title.Text = "Messages Single View";

            if (!IsPostBack)
            {

                string date = "";

                if (!String.IsNullOrEmpty(Session["selectedMessageID"].ToString()))
                {

                    int id = int.Parse(Session["selectedMessageID"].ToString());
                    // message.MessageId = id;
                    StringBuilder concatinater = new StringBuilder();
                    Message message = new Message(id);
                    DataTable aMessage = test.GetAMessage(message);

                    NotificationDAL notificationDAL = new NotificationDAL();

                    notificationDAL.UpdateMessageNotificationIsRead(message);

                    foreach (DataRow row in aMessage.Rows)
                    {
                        Reusable_Methods reusable_Methods = new Reusable_Methods();
                        date = reusable_Methods.FormatDateTime(DateTime.Parse((row["DateTime"]).ToString()));
                        //date = Convert.ToDateTime(row["DateTime"]).ToString("M");

                        //Building single message view box
                        concatinater.Append("<div class='SingleViewmsgeWrapper' id='");
                        concatinater.Append(row["messageID"].ToString());

                        //concatinater.Append("' ><div class='msgeHeading ui-corner-all' ><h2 class='ui-corner-all'> <a class='btnMemberProfile' id='");
                        concatinater.Append("' ><div class='msgeHeading ui-corner-all' ><h2 class='ui-corner-all'> <a href='#' class='btnMemberProfile replyMsge' style='font-weight:normal; font-size: 1.2em; ' id='");
                        concatinater.Append(row["FriendID"].ToString());
                        concatinater.Append("' >");
                        concatinater.Append(row["Friend"].ToString());
                        concatinater.Append("</a><span class='DateWithTime ui-corner-all floatright' style='font-size: 1.2em;' >  ");
                        concatinater.Append(date);
                        concatinater.Append("</span></h2> </div>");
                        concatinater.Append("<p class=''>");
                        concatinater.Append(row["MessageText"].ToString());
                        concatinater.Append("</p></div>");

                    }

                    MessageString = concatinater.ToString();

                }
            }
        }
示例#3
0
        public static string RefreshPie(string startDate, string endDate)
        {
            Reusable_Methods reusable_Methods = new Reusable_Methods();
            DateTime startDateD = reusable_Methods.CreateDateTime(startDate);
            DateTime endDateD = reusable_Methods.CreateDateTime(endDate);

            WebForm6 thisWebForm = new WebForm6();
            int total = thisWebForm.GetTotalOfPosts(startDateD, endDateD);

            string result = thisWebForm.GetDataForPie(total);

            return result;
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Literal title = (Literal)Master.FindControl("pageTitle");

            title.Text = "Messages Single View";


            if (!IsPostBack)
            {
                string date = "";

                if (!String.IsNullOrEmpty(Session["selectedMessageID"].ToString()))
                {
                    int id = int.Parse(Session["selectedMessageID"].ToString());
                    // message.MessageId = id;
                    StringBuilder concatinater = new StringBuilder();
                    Message       message      = new Message(id);
                    DataTable     aMessage     = test.GetAMessage(message);

                    NotificationDAL notificationDAL = new NotificationDAL();

                    notificationDAL.UpdateMessageNotificationIsRead(message);

                    foreach (DataRow row in aMessage.Rows)
                    {
                        Reusable_Methods reusable_Methods = new Reusable_Methods();
                        date = reusable_Methods.FormatDateTime(DateTime.Parse((row["DateTime"]).ToString()));
                        //date = Convert.ToDateTime(row["DateTime"]).ToString("M");

                        //Building single message view box
                        concatinater.Append("<div class='SingleViewmsgeWrapper' id='");
                        concatinater.Append(row["messageID"].ToString());

                        //concatinater.Append("' ><div class='msgeHeading ui-corner-all' ><h2 class='ui-corner-all'> <a class='btnMemberProfile' id='");
                        concatinater.Append("' ><div class='msgeHeading ui-corner-all' ><h2 class='ui-corner-all'> <a href='#' class='btnMemberProfile replyMsge' style='font-weight:normal; font-size: 1.2em; ' id='");
                        concatinater.Append(row["FriendID"].ToString());
                        concatinater.Append("' >");
                        concatinater.Append(row["Friend"].ToString());
                        concatinater.Append("</a><span class='DateWithTime ui-corner-all floatright' style='font-size: 1.2em;' >  ");
                        concatinater.Append(date);
                        concatinater.Append("</span></h2> </div>");
                        concatinater.Append("<p class=''>");
                        concatinater.Append(row["MessageText"].ToString());
                        concatinater.Append("</p></div>");
                    }

                    MessageString = concatinater.ToString();
                }
            }
        }
示例#5
0
        public static string[] RefreshNmbersInGroups(string startDate, string endDate)
        {
            Reusable_Methods reusable_Methods = new Reusable_Methods();

            DateTime startDateD = reusable_Methods.CreateDateTime(startDate);
            DateTime endDateD = reusable_Methods.CreateDateTime(endDate);

            WebForm6 thisWebForm = new WebForm6();
            List<Group> groups = thisWebForm.GetNmbersInGroupsValues(startDateD, endDateD);
            string[] result = new string[2];
            result[0] = thisWebForm.numberOfMembers;
            result[1] = thisWebForm.GroupOfNames;

            return result;
        }
示例#6
0
        public static string RefreshPie(string startDate, string endDate)
        {
            Reusable_Methods reusable_Methods = new Reusable_Methods();
            DateTime         startDateD       = reusable_Methods.CreateDateTime(startDate);
            DateTime         endDateD         = reusable_Methods.CreateDateTime(endDate);


            WebForm6 thisWebForm = new WebForm6();
            int      total       = thisWebForm.GetTotalOfPosts(startDateD, endDateD);

            string result = thisWebForm.GetDataForPie(total);



            return(result);
        }
示例#7
0
        public static string[] UpdateStats(string startDate, string endDate)
        {
            Reusable_Methods reusable_Methods = new Reusable_Methods();
            DateTime startDateD = reusable_Methods.CreateDateTime(startDate);
            DateTime endDateD = reusable_Methods.CreateDateTime(endDate);

            WebForm6 thisWebForm = new WebForm6();
            int total = thisWebForm.GetTotalOfPosts(startDateD, endDateD);

               // string result = thisWebForm.GetDataForPie(total);
            thisWebForm.GenerateSatistics(startDateD, endDateD);
            string[] result = new string[] {thisWebForm.members.ToString(), thisWebForm.posts.ToString(), thisWebForm.messages.ToString(), thisWebForm.reports.ToString(),
                 thisWebForm.blocedMembers.ToString()};

            return result;
        }
示例#8
0
        public static string[] UpdateStats(string startDate, string endDate)
        {
            Reusable_Methods reusable_Methods = new Reusable_Methods();
            DateTime         startDateD       = reusable_Methods.CreateDateTime(startDate);
            DateTime         endDateD         = reusable_Methods.CreateDateTime(endDate);


            WebForm6 thisWebForm = new WebForm6();
            int      total       = thisWebForm.GetTotalOfPosts(startDateD, endDateD);

            // string result = thisWebForm.GetDataForPie(total);
            thisWebForm.GenerateSatistics(startDateD, endDateD);
            string[] result = new string[] { thisWebForm.members.ToString(), thisWebForm.posts.ToString(), thisWebForm.messages.ToString(), thisWebForm.reports.ToString(),
                     thisWebForm.blocedMembers.ToString() };

            return(result);
        }
示例#9
0
        public static string[] RefreshNmbersInGroups(string startDate, string endDate)
        {
            Reusable_Methods reusable_Methods = new Reusable_Methods();

            DateTime startDateD = reusable_Methods.CreateDateTime(startDate);
            DateTime endDateD   = reusable_Methods.CreateDateTime(endDate);


            WebForm6     thisWebForm = new WebForm6();
            List <Group> groups      = thisWebForm.GetNmbersInGroupsValues(startDateD, endDateD);

            string[] result = new string[2];
            result[0] = thisWebForm.numberOfMembers;
            result[1] = thisWebForm.GroupOfNames;

            return(result);
        }
示例#10
0
        public void InsertChatText(string sessionMemberID, int groupID, string ChatText)
        {
            //Article_Post article_Post = new Article_Post(ChatText);
            Group  group      = new Group(groupID);
            Member thisMember = new Member(sessionMemberID);


            int          postID      = chatDAL.InsertChatText(group, ChatText, thisMember);
            Post         post        = new Post(postID);
            Article_Post thisArticle = chatDAL.getChatText(ref post);

            //BulabulaApp.Other_Classes. date new = reusable_Methods.FormatDateTime(aPost.CreateDate);
            Reusable_Methods reusable_Methods = new Reusable_Methods();
            string           date             = reusable_Methods.FormatDateTimeForChat(post.CreateDate);

            thisMember = chatDAL.GetMemberDisplayName(thisMember);

            concatinater.Append(" <div class='chatMemberWrapper'>");
            concatinater.Append("<div class='memberNameSection  '> <a id=");
            concatinater.Append(thisMember.MemberId);
            concatinater.Append(" class='btnMemberProfile pointer' ><em>");
            concatinater.Append(thisMember.DisplayName);
            concatinater.Append("</em></a></div>");
            concatinater.Append("</a></div>");
            concatinater.Append("<div class='chatContentSection '>");
            concatinater.Append(thisArticle.ArticleText);



            concatinater.Append("</div> <div class='clr'></div>");

            concatinater.Append(" </div>");
            string chatString = concatinater.ToString();

            Clients.updateChat(Context.ConnectionId, chatString, groupID.ToString(), sessionMemberID);
        }
示例#11
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
                }
            }
        }
示例#12
0
        public void AddComment(string sessionMemberID, string postID, string commentTxt)
        {
            Comments comment = new Comments();

            comment.MemberId    = sessionMemberID;
            comment.CommentText = commentTxt;
            Post post = new Post();

            post.PostId    = int.Parse(postID);
            comment.PostId = post.PostId;
            messageDAL.InsertComment(comment);
            StringBuilder commentBuilder = new StringBuilder();


            //###################################
            //refreshing Comments
            //###################################
            DataTable comments = messageDAL.GetAllComments(post);



            foreach (DataRow row in comments.Rows)
            {
                date = Convert.ToDateTime(row["CreateDate"]).ToString("M");

                //Building single message view box
                commentBuilder.Append("<div id='");
                commentBuilder.Append((row["CommentID"]).ToString());

                commentBuilder.Append("' class='aComment'><div class='deleteComment floatright'>");



                if ((row["MemberID"]).ToString() == sessionMemberID)
                {
                    commentBuilder.Append("<a class='btnDleteComment ui-icon ui-icon-close tip' title='Delete this comment'></a>");
                }
                else
                {
                    commentBuilder.Append("<a class='btnOpenMenuComment ui-icon ui-icon-circle-triangle-s tip' title='More options..'></a>");
                }

                commentBuilder.Append("</div><h5><a style='font-weight:normal;' ");
                commentBuilder.Append("id='" + (row["MemberID"]).ToString() + "'> ");



                commentBuilder.Append(row["Friend"].ToString());
                commentBuilder.Append("</a><span class='DateWithTime ui-corner-all floatright'>");

                Reusable_Methods reusable_Methods = new Reusable_Methods();
                date = reusable_Methods.FormatDateTime(Convert.ToDateTime(row["CreateDate"]));

                commentBuilder.Append(date);
                commentBuilder.Append("</span></h5><p>");
                commentBuilder.Append((row["CommentText"]).ToString());
                commentBuilder.Append("</p></div>");
                //End Building
            }


            string commentCount = messageDAL.CountComments(post).ToString();
            string commentText  = commentBuilder.ToString();

            //Updating all Clients
            Clients.updatingComments(Context.ConnectionId, commentCount, commentText, postID);
        }
示例#13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Literal title = (Literal)Master.FindControl("pageTitle");

            title.Text = "Inbox";
            Page.RouteData.Values["Id"] = "Inbox";


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

                else
                {
                    #region ##
                    if (IsPostBack)
                    {
                        if (Request["__EVENTARGUMENT"] != "")
                        {
                            try
                            {
                                string s = Request["__EVENTARGUMENT"];

                                Session["Data"] = s.TrimEnd(',');

                                Response.Redirect("~/ViewMessages.aspx");
                            }
                            catch (Exception ex)
                            {
                                ex.ToString();
                            }
                        }
                    }
                    #endregion
                }
            }



            MessagesDAL DAL         = new MessagesDAL();
            string      date        = "";
            string      shrtMessage = "";
            DataTable   inboxList   = DAL.getInboxList(new Member(Session["memberID"].ToString()));

            StringBuilder concatinater = new StringBuilder();



            foreach (DataRow row in inboxList.Rows)
            {
                Message message = new Message(int.Parse(row["messageID"].ToString()));


                //date = Convert.ToDateTime(row["DateTime"]).ToString("D");

                reusable_Methods = new Reusable_Methods();

                date = reusable_Methods.FormatDateTime(DateTime.Parse(row["DateTime"].ToString()));


                if (row["MessageText"].ToString().Length > 45)
                {
                    shrtMessage = row["MessageText"].ToString().Substring(0, 45) + "...";
                }
                else
                {
                    shrtMessage = row["MessageText"].ToString();
                }

                //Building single message view box
                concatinater.Append("<div class='msgeWrapper ");

                if (!DAL.IsMessageRead(message))
                {
                    //isRead
                    concatinater.Append("isNotRead");
                }



                concatinater.Append("' id='");
                concatinater.Append(row["messageID"].ToString());

                concatinater.Append("'> <div class='checkBox'><input type='checkbox'  /> </div><div class='msge' ><div><span class='sendingFriend blueFontTextColor' id='");
                concatinater.Append(row["FriendID"].ToString());
                concatinater.Append("' >");
                concatinater.Append(row["FriendDisplayName"].ToString());
                concatinater.Append("</a><span class='DateWithTime floatright'>");
                concatinater.Append(date);
                concatinater.Append("</span></div><div class='slideInMenu floatright' style='visibility:hidden;' ><span class='floatright BorberRad3' id='deleteMsge' >Delete</span>");
                concatinater.Append(" <span class='floatright BorberRad3' BorberRad3'>Reply</span></div><div class='msgeText floatright'>");
                concatinater.Append(shrtMessage);
                concatinater.Append("</div></div> <div style='clear:both;'></div></div>");
            }

            items = concatinater.ToString();
        }
示例#14
0
        public void AddComment(string sessionMemberID, string postID, string commentTxt)
        {
            Comments comment = new Comments();
            comment.MemberId = sessionMemberID;
            comment.CommentText = commentTxt;
            Post post = new Post();
            post.PostId = int.Parse(postID);
            comment.PostId = post.PostId;
            messageDAL.InsertComment(comment);
            StringBuilder commentBuilder = new StringBuilder();

            //###################################
            //refreshing Comments
            //###################################
            DataTable comments = messageDAL.GetAllComments(post);

            foreach (DataRow row in comments.Rows)
            {
                date = Convert.ToDateTime(row["CreateDate"]).ToString("M");

                //Building single message view box
                commentBuilder.Append("<div id='");
                commentBuilder.Append((row["CommentID"]).ToString());

                commentBuilder.Append("' class='aComment'><div class='deleteComment floatright'>");

                if ((row["MemberID"]).ToString() == sessionMemberID)
                {

                    commentBuilder.Append("<a class='btnDleteComment ui-icon ui-icon-close tip' title='Delete this comment'></a>");
                }
                else
                {
                    commentBuilder.Append("<a class='btnOpenMenuComment ui-icon ui-icon-circle-triangle-s tip' title='More options..'></a>");
                }

                commentBuilder.Append("</div><h5><a style='font-weight:normal;' ");
                commentBuilder.Append("id='" + (row["MemberID"]).ToString() + "'> ");

                commentBuilder.Append(row["Friend"].ToString());
                commentBuilder.Append("</a><span class='DateWithTime ui-corner-all floatright'>");

                Reusable_Methods reusable_Methods = new Reusable_Methods();
                date = reusable_Methods.FormatDateTime(Convert.ToDateTime(row["CreateDate"]));

                commentBuilder.Append(date);
                commentBuilder.Append("</span></h5><p>");
                commentBuilder.Append((row["CommentText"]).ToString());
                commentBuilder.Append("</p></div>");
                //End Building

            }

             string commentCount = messageDAL.CountComments(post).ToString();
             string commentText = commentBuilder.ToString();

            //Updating all Clients
             Clients.updatingComments(Context.ConnectionId, commentCount, commentText, postID);
        }
示例#15
0
        public void InsertChatText(string sessionMemberID, int groupID, string ChatText)
        {
            //Article_Post article_Post = new Article_Post(ChatText);
            Group group = new Group(groupID);
            Member thisMember = new Member(sessionMemberID);

               int postID = chatDAL.InsertChatText(group, ChatText, thisMember);
               Post post = new Post(postID);
               Article_Post thisArticle = chatDAL.getChatText(ref post);

               //BulabulaApp.Other_Classes. date new = reusable_Methods.FormatDateTime(aPost.CreateDate);
               Reusable_Methods reusable_Methods = new Reusable_Methods();
               string date = reusable_Methods.FormatDateTimeForChat(post.CreateDate);
               thisMember =  chatDAL.GetMemberDisplayName(thisMember);

               concatinater.Append(" <div class='chatMemberWrapper'>");
                concatinater.Append("<div class='memberNameSection  '> <a id=");
                concatinater.Append(thisMember.MemberId);
                concatinater.Append(" class='btnMemberProfile pointer' ><em>");
                concatinater.Append(thisMember.DisplayName);
                concatinater.Append("</em></a></div>");
                concatinater.Append("</a></div>");
               concatinater.Append("<div class='chatContentSection '>");
               concatinater.Append(thisArticle.ArticleText);

               concatinater.Append("</div> <div class='clr'></div>");

               concatinater.Append(" </div>");
               string chatString = concatinater.ToString();

               Clients.updateChat(Context.ConnectionId, chatString, groupID.ToString(), sessionMemberID);
        }
示例#16
0
        public void AddEventPost(string sessionMemberID, string startDate, string endDate, string name, string host, string venue, int groupID, string details, string type)
        {
            memberID = sessionMemberID;
            StringBuilder htmlText = new StringBuilder();
            Member aMember = new Member(memberID);

            Group aGroup = new Group(groupID);

            PostDAL postDAL = new PostDAL();

            Reusable_Methods reusable_Methods = new Reusable_Methods();

             /*
              * NEEDS ATTENTION !!!!!!!!!
              *
              *
              */

            DateTime startDateD = reusable_Methods.CreateDateTime(startDate);
            DateTime endDateD = reusable_Methods.CreateDateTime(endDate);

              /*
            * END NEEDS ATTENTION !!!!!!!!!
            */

            //DateTime startDateD = reusable_Methods.FormatDateFromDateTimePicker(startDate);
              //  DateTime endDateD = reusable_Methods.FormatDateFromDateTimePicker(endDate);

            Event_Post aEvent_Post = new Event_Post(name, details, venue, startDateD, endDateD, host, type);
            int postId = postDAL.InsertEvent(aEvent_Post, aGroup, aMember);

            #region GET POST
            ArrayPosts = bl.GetASinglePost(postId);
            int count = ArrayPosts.Count;

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

                OpenWrapper(i);

                #region EVENT POST
                GetEventPosts();
                #endregion

                CloseWrapper();

            }

            #endregion

             string postToClients = concatinater.ToString();

            //Updating all Clients
            Clients.insertEvent(Context.ConnectionId, postToClients, groupID);
        }
示例#17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Literal title = (Literal)Master.FindControl("pageTitle");

            caption = (HiddenField)Master.FindControl("caption");

            #region NEWSFEED
            MessagesDAL member = new MessagesDAL();
            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 (Session["GroupInfo"] != null)
                {
                    string m = Session["GroupInfo"].ToString();

                    string[] data = m.Split('&');

                    groupID            = int.Parse(data[0]);
                    ThisGroupsID.Value = "" + groupID;
                    title.Text         = data[1];

                    #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 NEWS FEED

                    string TabName = "Posts";

                    BulabulaApp.WebServices.postsWebservice posts = new WebServices.postsWebservice();

                    newsfeed = posts.GetTabContents(TabName, groupID, -1);
                    #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
                }
            }//END MAIN if loading for first time
            #endregion

            #region Picture Upload
            if (Request.QueryString["preview"] == "1" && !string.IsNullOrEmpty(Request.QueryString["fileId"]) && uploadType == "Picture")
            {
                var    fileId          = Request.QueryString["fileId"];
                var    fileContentType = (string)Session["fileContentType_" + fileId];
                var    fileName        = (string)Session["fileName_" + fileId];
                byte[] imageBytes      = File.ReadAllBytes(System.Web.HttpContext.Current.Server.MapPath("~") + "file.png");
                var    fileContents    = imageBytes;

                string ct = (string)Session["fileContentType_" + fileId];
                if (ct.Contains("jpg") || ct.Contains("gif") || ct.Contains("png") || ct.Contains("jpeg"))
                {
                    fileContents = (byte[])Session["fileContents_" + fileId];
                }



                MemoryStream ms = new MemoryStream(imageBytes, 0, imageBytes.Length);
                // Convert byte[] to Image
                ms.Write(imageBytes, 0, imageBytes.Length);
                System.Drawing.Image image = System.Drawing.Image.FromStream(ms, true);

                Photo_Post photoPost = new Photo_Post();
                Group      g         = new Group();
                PostDAL    postDAl   = new PostDAL();

                aMember.MemberId = "5ZMjMHEwVN7GyJ2miPDjeQ==";
                g.GroupId        = 1;

                photoPost.Photo        = image;
                photoPost.PhotoName    = fileName;
                photoPost.PhotoCaption = "STeVO";

                postDAl.InsertPhoto(photoPost, g, aMember);
                Response.Clear();
                Response.ContentType = fileContentType;
                Response.BinaryWrite(fileContents);
                Response.End();
            }

            #endregion

            #region Video Upload

            if (Request.QueryString["preview"] == "1" && !string.IsNullOrEmpty(Request.QueryString["fileId"]) && uploadType == "Video")
            {
                var    videoFileId          = Request.QueryString["fileId"];
                var    videofileContentType = (string)Session["fileContentType_" + videoFileId];
                var    videofileName        = (string)Session["fileName_" + videoFileId];
                byte[] videoBytes           = File.ReadAllBytes(System.Web.HttpContext.Current.Server.MapPath("~") + "file.png");
                var    videofileContents    = videoBytes;

                string ct = (string)Session["fileContentType_" + videoFileId];
                if (ct.Contains("mp4") || ct.Contains("mov") || ct.Contains("vlc") || ct.Contains("avi") || ct.Contains("jpeg"))
                {
                    videofileContents = (byte[])Session["fileContents_" + videoFileId];
                }



                //  MemoryStream vs = new MemoryStream(videoBytes, 0, videoBytes.Length);
                // Convert byte[] to Image
                //vs.Write(videoBytes, 0, videoBytes.Length);
                //System.Drawing.Image image = System.Drawing.Image.FromStream(vs, true);

                Video_Post videoPost = new Video_Post();
                Group      g         = new Group();
                PostDAL    postDAl   = new PostDAL();

                aMember.MemberId = "5ZMjMHEwVN7GyJ2miPDjeQ==";
                g.GroupId        = 1;

                videoPost.Video        = videoBytes;
                videoPost.VideoName    = videofileName;
                videoPost.VideoCaption = "STeVO";
                //videoPost.VideoSize =


                //postDAl.InsertPhoto1(photoPost, g, aMember);
                postDAl.InsertVideo(videoPost, g, aMember);



                //Response.Clear();
                //Response.ContentType = fileContentType;
                //Response.BinaryWrite(fileContents);
                //Response.End();
            }


            #endregion
        }
示例#18
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
                }
            }
        }
示例#19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Literal title = (Literal)Master.FindControl("pageTitle");
            title.Text = "Inbox";
            Page.RouteData.Values["Id"] = "Inbox";

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

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

                }

                else
                {
                    #region ##
                    if (IsPostBack)
                    {
                        if (Request["__EVENTARGUMENT"] != "")
                        {
                            try
                            {
                                string s = Request["__EVENTARGUMENT"];

                                Session["Data"] = s.TrimEnd(',');

                                Response.Redirect("~/ViewMessages.aspx");
                            }
                            catch (Exception ex)
                            {
                                ex.ToString();
                            }
                        }
                    }
                    #endregion

                }
            }

            MessagesDAL DAL = new MessagesDAL();
            string date = "";
            string shrtMessage = "";
            DataTable inboxList = DAL.getInboxList(new Member(Session["memberID"].ToString()));

            StringBuilder concatinater = new StringBuilder();

            foreach (DataRow row in inboxList.Rows)
            {
                Message message = new Message(int.Parse(row["messageID"].ToString()));

                //date = Convert.ToDateTime(row["DateTime"]).ToString("D");

                reusable_Methods = new Reusable_Methods();

                date = reusable_Methods.FormatDateTime(DateTime.Parse(row["DateTime"].ToString()));

                if (row["MessageText"].ToString().Length > 45)
                {
                    shrtMessage = row["MessageText"].ToString().Substring(0, 45) + "...";

                }
                else
                {
                    shrtMessage = row["MessageText"].ToString();

                }

                //Building single message view box
                concatinater.Append("<div class='msgeWrapper ");

                if(!DAL.IsMessageRead(message))
                {
                //isRead
                    concatinater.Append("isNotRead");
                }

                concatinater.Append("' id='");
                concatinater.Append(row["messageID"].ToString());

                concatinater.Append("'> <div class='checkBox'><input type='checkbox'  /> </div><div class='msge' ><div><span class='sendingFriend blueFontTextColor' id='");
                concatinater.Append(row["FriendID"].ToString());
                concatinater.Append("' >");
                concatinater.Append(row["FriendDisplayName"].ToString());
                concatinater.Append("</a><span class='DateWithTime floatright'>");
                concatinater.Append(date);
                concatinater.Append("</span></div><div class='slideInMenu floatright' style='visibility:hidden;' ><span class='floatright BorberRad3' id='deleteMsge' >Delete</span>");
                concatinater.Append(" <span class='floatright BorberRad3' BorberRad3'>Reply</span></div><div class='msgeText floatright'>");
                concatinater.Append(shrtMessage);
                concatinater.Append("</div></div> <div style='clear:both;'></div></div>");

            }

            items = concatinater.ToString();
        }
示例#20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //To use for notifications
            SessionMemberID.Value = Session["memberID"].ToString();

            year = now.Year;
            if (Session["stayEx"] != null )
            {
                if (Session["stayEx"].ToString() == "expanded")
                { StayExpanded.Value = "expanded"; }

            }

               if (StayExpanded.Value == "expanded")
            {
                Session["stayEx"] = "expanded";
            }
            else { Session["stayEx"] = ""; }

            MessagesDAL member = new MessagesDAL();
            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");
                }

                defaultEmailAddress = SSTCryptographer.Decrypt(Session["memberID"].ToString())+"@live.nmmu.ac.za";

            }//END MAIN if LOADING FOR THE FIRST TIME
            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");

            }
              else if (SelectedMessageID.Value != "")
            {
                Session["selectedMessageID"] = SelectedMessageID.Value;
                Response.Redirect("~/ViewMessages.aspx");

            }

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

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

            }
            else
            {
                string memberId = Context.Session["memberID"].ToString();
                thisMemberID.Value = memberId;
                aMember.MemberId = memberId;

                #region GO ONLINE
                MemberInfoDAL memberInfoDAL = new MemberInfoDAL();
                memberInfoDAL.UpdateToOnline(aMember);
                #endregion

                #region MAIN ACTUAL DISPLAY NAME
                memberInfoDAL = new MemberInfoDAL();
                aMember = memberInfoDAL.GetActualDisplayName(aMember);

                actualMemberDisplayName = aMember.DisplayName;
                #endregion

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

                Reusable_Methods reusable_Methods = new Reusable_Methods(aMember);
                allgroups = reusable_Methods.RightColumnGet5JoinedGroups();
                //===========================================================================================
                #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

                #region NOTIFICATIONS
                NotificationsString = reusable_Methods.RightColumnNotifications();

                #endregion

            }
        }
示例#21
0
        private void GenerateProfile(Member aMember)
        {
            #region RIGHT COLUMN GET ALL JOINED GROUPS

            //JOINED GROUPS==============================================================================

            Reusable_Methods reusable_Methods = new Reusable_Methods(aMember);

            allgroups = reusable_Methods.RightColumnGetAllJoinedGroups();
            //============================================================================================
            #endregion

            #region RIGHT COLUMN MEMBER INFORMATION
            //MEMBER INFORMATION ON RIGHT COLUMN==========================================================================

            //MEMBER INFO AND PROFILE

            MemberInfoDAL dal = new MemberInfoDAL();

            //  Member member = new Member();
            aMember = dal.GetAllMemberInfo(aMember);

            profilesMemnerID.Value = aMember.MemberId;

            //Set the ImageUrl to the path of the handler with the querystring value
            ProfileImage.ImageUrl = "ProfilePicHandler.ashx?id=" + SSTCryptographer.Decrypt(aMember.MemberId);
            //call the method to get the image information and display it in Label Control

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

            #region MAIN COLUMN MEMBER INFORMATION
            //MEMBER INFORMATION ON MAIN DISPLAY==========================================================================
            StringBuilder memberData = new StringBuilder();

            memberData.Append("<tr><td style='font-weight: bold;' > ");
            memberData.Append("First Name:</td><td>");
            memberData.Append(aMember.FirstName);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;'>");

            memberData.Append("Last Name:</td><td>");
            memberData.Append(aMember.LastName);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");

            memberData.Append("Display Name:</td><td>");
            memberData.Append(aMember.DisplayName);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");

            memberData.Append("Email:</td><td>");
            memberData.Append(aMember.Email);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");

            memberData.Append("Description:</td><td>");
            memberData.Append(aMember.Description);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");

            memberData.Append("Campus:</td><td>");
            memberData.Append(aMember.Campus);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");

            memberData.Append("Account Type:</td><td>");
            memberData.Append(aMember.MemberType);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");

            if (aMember.IsOnline == false)
            {
                memberData.Append("Online Status:</td><td style='color:red;'>");
                memberData.Append("Offline");
                memberData.Append("</td></tr>");

            }
            else
            {
                memberData.Append("Online Status:</td><td style='color:green;'>");
                memberData.Append("Online");
                memberData.Append("</td></tr>");

            }

            memberDataMain = memberData.ToString();

            #endregion

            #region MAIN COLUMN MOST RECENT POST DATE
            //MOST RECENT POST DATE ON MAIN DISPLAY==========================================================================
            NotificationDAL notificationDAL = new NotificationDAL();

            StringBuilder recentPostDate = new StringBuilder();
            Post aPost = new Post();
            aPost = notificationDAL.GetMostRecentPostDate(aMember);

            if (aPost.CreateDate == DateTime.Parse("1/1/0001 12:00:00 AM"))
            {
                reusable_Methods = new Reusable_Methods();
                string date = reusable_Methods.FormatDateTime(aPost.CreateDate);

                recentPostDate.Append("<p style='font-size: 1.2em; color: #A3ADB5;'>Most recent post date<span style='color: #0e93be;'> - ");
                recentPostDate.Append("No posts");
                recentPostDate.Append("</span></p>");

                mostRecentPostDate = recentPostDate.ToString();
            }
            else
            {
                reusable_Methods = new Reusable_Methods();
                string date = reusable_Methods.FormatDateTime(aPost.CreateDate);

                recentPostDate.Append("<p style='font-size: 1.2em; color: #A3ADB5;'>Most recent post date<span style='color: #0e93be;'> - ");
                recentPostDate.Append(date);
                recentPostDate.Append("</span></p>");

                mostRecentPostDate = recentPostDate.ToString();
            }
            #endregion

            #region MAIN ACTUAL DISPLAY NAME
            MemberInfoDAL memberInfoDAL = new MemberInfoDAL();
            Member actualMember = new Member(Context.Session["memberID"].ToString());
            aMember = memberInfoDAL.GetActualDisplayName(actualMember);

            actualMemberDisplayName = aMember.DisplayName;
            #endregion
        }
示例#22
0
        private void GenerateProfile(Member aMember)
        {
            #region RIGHT COLUMN GET ALL JOINED GROUPS

            //JOINED GROUPS==============================================================================

            Reusable_Methods reusable_Methods = new Reusable_Methods(aMember);

            allgroups = reusable_Methods.RightColumnGetAllJoinedGroups();
            //============================================================================================
            #endregion

            #region RIGHT COLUMN MEMBER INFORMATION
            //MEMBER INFORMATION ON RIGHT COLUMN==========================================================================

            //MEMBER INFO AND PROFILE



            MemberInfoDAL dal = new MemberInfoDAL();


            //  Member member = new Member();
            aMember = dal.GetAllMemberInfo(aMember);

            profilesMemnerID.Value = aMember.MemberId;



            //Set the ImageUrl to the path of the handler with the querystring value
            ProfileImage.ImageUrl = "ProfilePicHandler.ashx?id=" + SSTCryptographer.Decrypt(aMember.MemberId);
            //call the method to get the image information and display it in Label Control


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

            #region MAIN COLUMN MEMBER INFORMATION
            //MEMBER INFORMATION ON MAIN DISPLAY==========================================================================
            StringBuilder memberData = new StringBuilder();

            memberData.Append("<tr><td style='font-weight: bold;' > ");
            memberData.Append("First Name:</td><td>");
            memberData.Append(aMember.FirstName);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;'>");

            memberData.Append("Last Name:</td><td>");
            memberData.Append(aMember.LastName);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");

            memberData.Append("Display Name:</td><td>");
            memberData.Append(aMember.DisplayName);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");

            memberData.Append("Email:</td><td>");
            memberData.Append(aMember.Email);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");

            memberData.Append("Description:</td><td>");
            memberData.Append(aMember.Description);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");

            memberData.Append("Campus:</td><td>");
            memberData.Append(aMember.Campus);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");

            memberData.Append("Account Type:</td><td>");
            memberData.Append(aMember.MemberType);
            memberData.Append("</td></tr> <tr><td style='font-weight: bold;' > ");


            if (aMember.IsOnline == false)
            {
                memberData.Append("Online Status:</td><td style='color:red;'>");
                memberData.Append("Offline");
                memberData.Append("</td></tr>");
            }
            else
            {
                memberData.Append("Online Status:</td><td style='color:green;'>");
                memberData.Append("Online");
                memberData.Append("</td></tr>");
            }

            memberDataMain = memberData.ToString();


            #endregion

            #region MAIN COLUMN MOST RECENT POST DATE
            //MOST RECENT POST DATE ON MAIN DISPLAY==========================================================================
            NotificationDAL notificationDAL = new NotificationDAL();

            StringBuilder recentPostDate = new StringBuilder();
            Post          aPost          = new Post();
            aPost = notificationDAL.GetMostRecentPostDate(aMember);


            if (aPost.CreateDate == DateTime.Parse("1/1/0001 12:00:00 AM"))
            {
                reusable_Methods = new Reusable_Methods();
                string date = reusable_Methods.FormatDateTime(aPost.CreateDate);



                recentPostDate.Append("<p style='font-size: 1.2em; color: #A3ADB5;'>Most recent post date<span style='color: #0e93be;'> - ");
                recentPostDate.Append("No posts");
                recentPostDate.Append("</span></p>");

                mostRecentPostDate = recentPostDate.ToString();
            }
            else
            {
                reusable_Methods = new Reusable_Methods();
                string date = reusable_Methods.FormatDateTime(aPost.CreateDate);



                recentPostDate.Append("<p style='font-size: 1.2em; color: #A3ADB5;'>Most recent post date<span style='color: #0e93be;'> - ");
                recentPostDate.Append(date);
                recentPostDate.Append("</span></p>");

                mostRecentPostDate = recentPostDate.ToString();
            }
            #endregion

            #region MAIN ACTUAL DISPLAY NAME
            MemberInfoDAL memberInfoDAL = new MemberInfoDAL();
            Member        actualMember  = new Member(Context.Session["memberID"].ToString());
            aMember = memberInfoDAL.GetActualDisplayName(actualMember);

            actualMemberDisplayName = aMember.DisplayName;
            #endregion
        }
示例#23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //To use for notifications
            SessionMemberID.Value = Session["memberID"].ToString();

            year = now.Year;
            if (Session["stayEx"] != null)
            {
                if (Session["stayEx"].ToString() == "expanded")
                {
                    StayExpanded.Value = "expanded";
                }
            }

            if (StayExpanded.Value == "expanded")
            {
                Session["stayEx"] = "expanded";
            }
            else
            {
                Session["stayEx"] = "";
            }



            MessagesDAL member = new MessagesDAL();

            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");
                }

                defaultEmailAddress = SSTCryptographer.Decrypt(Session["memberID"].ToString()) + "@live.nmmu.ac.za";
            }//END MAIN if LOADING FOR THE FIRST TIME
            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");
            }
            else if (SelectedMessageID.Value != "")
            {
                Session["selectedMessageID"] = SelectedMessageID.Value;
                Response.Redirect("~/ViewMessages.aspx");
            }


            if (Session["memberID"] == null)
            {
                Response.Redirect("~/Login.aspx");
            }
            else
            {
                string memberId = Context.Session["memberID"].ToString();
                thisMemberID.Value = memberId;
                aMember.MemberId   = memberId;

                #region GO ONLINE
                MemberInfoDAL memberInfoDAL = new MemberInfoDAL();
                memberInfoDAL.UpdateToOnline(aMember);
                #endregion

                #region MAIN ACTUAL DISPLAY NAME
                memberInfoDAL = new MemberInfoDAL();
                aMember       = memberInfoDAL.GetActualDisplayName(aMember);

                actualMemberDisplayName = aMember.DisplayName;
                #endregion

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

                Reusable_Methods reusable_Methods = new Reusable_Methods(aMember);
                allgroups = reusable_Methods.RightColumnGet5JoinedGroups();
                //===========================================================================================
                #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

                #region NOTIFICATIONS
                NotificationsString = reusable_Methods.RightColumnNotifications();

                #endregion
            }
        }//END PAGE_LOAD