Exemple #1
0
        public string RefreshChats(int groupID)
        {
            ChatDAL             chatDAL = new ChatDAL();
            List <Article_Post> at      = chatDAL.getAllChats(groupID);
            string chatString           = null;

            foreach (var ChatMessage in at)
            {
                Group  group      = new Group(groupID);
                Member thisMember = new Member(ChatMessage.MemberID);


                //    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(ChatMessage.CreateDate);
                thisMember = chatDAL.GetMemberDisplayName(thisMember);

                ChatText.Append(" <div class='chatMemberWrapper'>");
                ChatText.Append("<div class='memberNameSection  '> <a id=");
                ChatText.Append(thisMember.MemberId);
                ChatText.Append(" class='btnMemberProfile pointer' ><em>");
                ChatText.Append(thisMember.DisplayName);
                ChatText.Append("</em></a></div>");
                ChatText.Append("</a></div>");
                ChatText.Append("<div class='chatContentSection '>");
                ChatText.Append(ChatMessage.ArticleText);
                ChatText.Append("</div> <div class='clr'></div>");
                ChatText.Append("</div>");
                chatString = ChatText.ToString();
            }//end foreach

            return(chatString);
        }
        private void OpenWrapper(int i)
        {
            #region OPENING WRAPPER
            aPost = (Post)ArrayPosts[i];

            ArrayMembers = bl.GetMemberDisplayName(aPost.MemberId);
            countMembers = ArrayMembers.Count;

            for (int a = 0; a < countMembers; ++a)
            {
                aMember = (Member)ArrayMembers[a];

                NotificationDAL notificationDAL = new NotificationDAL();
                Group group = new Group(aPost.GroupId);

                string groupDescription = notificationDAL.GetGroupDescription2(group);
                if (aPost.PostType != "Article")
                {

                    concatinater.Append("<div class='aPost ");

                    switch (aPost.PostType)
                    {
                        case "Text":
                            concatinater.Append("typeOfText");
                            ClientUpdateType = "Text";
                            break;
                        case "Event":
                            concatinater.Append("typeOfEvent");
                            ClientUpdateType = "Event";
                            break;
                        case "Photo":
                            concatinater.Append("typeOfPhoto");
                            ClientUpdateType = "Photo";
                            break;
                        case "Article":
                            concatinater.Append("typeOfArticle");
                            ClientUpdateType = "Article";
                            break;
                        case "Video":
                            concatinater.Append("typeOfVideo");
                            ClientUpdateType = "Video";
                            break;
                        case "File":
                            concatinater.Append("typeOfFile");
                            ClientUpdateType = "File";
                            break;
                        default:

                            break;


                    }


                    concatinater.Append("' id='");
                    concatinater.Append(aPost.PostId);
                    concatinater.Append("'><div class='msgeHeading ui-corner-all' ><h2 class='ui-corner-all'> Posted by: <a href='#' id='");
                    concatinater.Append(aPost.MemberId);
                    concatinater.Append("' class='btnMemberProfile' style='font-weight:normal; '>");
                    concatinater.Append(aMember.DisplayName);

                    bool isForMember = false;

                    string date = "";



                    date = reusable_Methods.FormatDateTime(aPost.CreateDate);



                    try
                    {
                        tempMemberID = Context.Session["memberID"].ToString();

                    }
                    catch
                    {
                        tempMemberID = ClientUpdateMemberID;

                    }

                    if (aPost.MemberId == tempMemberID)
                    { isForMember = true; }

                    if (GroupID == aPost.GroupId)
                    {


                    }
                    else
                    {
                        concatinater.Append("</a> <span class='space'></span> in group: <a id='");
                        ClientUpdateGroupID = aPost.GroupId;
                        concatinater.Append(aPost.GroupId);

                        concatinater.Append("' class='btnGoToGroupPage groupDesc'>");
                        concatinater.Append(groupDescription);

                    }

                    concatinater.Append("</a>");
                    if (isForMember)
                    {
                        concatinater.Append("<span class='ui-icon ui-icon-closethick floatright deletePost pointer ' title ='Delete this post' style='display:none;'></span>");
                    }

                    concatinater.Append("<span class='DateWithTime ui-corner-all floatright'>");
                    concatinater.Append(date);
                    //concatinater.Append(Convert.ToDateTime(aPost.CreateDate).ToString("D"));
                    concatinater.Append("</span></h2></div> <div class='postContentArea'> <div> ");


                }
                else
                {
                    string sessionMemberID = "";
                    ChatDAL chatDAL = new ChatDAL();
                    try
                    {
                        sessionMemberID = Context.Session["memberID"].ToString();

                    }
                    catch
                    {
                        sessionMemberID = ClientUpdateMemberID;

                    }

                    Member thisMember = new Member(sessionMemberID);


                    Post post = new Post(aPost.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);

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



                    ChatText.Append("</div> <div class='clr'></div><span class='time'>");
                    ChatText.Append(date);
                    ChatText.Append(" <span> </div>");
                    string chatString = ChatText.ToString();
                }
            }
            #endregion
        }
        public string RefreshChats(int groupID)
        {
            ChatDAL chatDAL = new ChatDAL();
        List<Article_Post> at = chatDAL.getAllChats(groupID);
        string chatString = null;
        foreach (var ChatMessage in at)
        {
            Group group = new Group(groupID);
            Member thisMember = new Member(ChatMessage.MemberID);


        //    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(ChatMessage.CreateDate);
            thisMember = chatDAL.GetMemberDisplayName(thisMember);

            ChatText.Append(" <div class='chatMemberWrapper'>");
            ChatText.Append("<div class='memberNameSection  '> <a id=");
            ChatText.Append(thisMember.MemberId);
            ChatText.Append(" class='btnMemberProfile pointer' ><em>");
            ChatText.Append(thisMember.DisplayName);
            ChatText.Append("</em></a></div>");
            ChatText.Append("</a></div>");
            ChatText.Append("<div class='chatContentSection '>");
            ChatText.Append(ChatMessage.ArticleText);
            ChatText.Append("</div> <div class='clr'></div>");
            ChatText.Append("</div>");
            chatString = ChatText.ToString();
        
        }//end foreach

        return chatString;
        }
Exemple #4
0
        private void OpenWrapper(int i)
        {
            #region OPENING WRAPPER
            aPost = (Post)ArrayPosts[i];

            ArrayMembers = bl.GetMemberDisplayName(aPost.MemberId);
            countMembers = ArrayMembers.Count;

            for (int a = 0; a < countMembers; ++a)
            {
                aMember = (Member)ArrayMembers[a];

                NotificationDAL notificationDAL = new NotificationDAL();
                Group           group           = new Group(aPost.GroupId);

                string groupDescription = notificationDAL.GetGroupDescription2(group);
                if (aPost.PostType != "Article")
                {
                    concatinater.Append("<div class='aPost ");

                    switch (aPost.PostType)
                    {
                    case "Text":
                        concatinater.Append("typeOfText");
                        ClientUpdateType = "Text";
                        break;

                    case "Event":
                        concatinater.Append("typeOfEvent");
                        ClientUpdateType = "Event";
                        break;

                    case "Photo":
                        concatinater.Append("typeOfPhoto");
                        ClientUpdateType = "Photo";
                        break;

                    case "Article":
                        concatinater.Append("typeOfArticle");
                        ClientUpdateType = "Article";
                        break;

                    case "Video":
                        concatinater.Append("typeOfVideo");
                        ClientUpdateType = "Video";
                        break;

                    case "File":
                        concatinater.Append("typeOfFile");
                        ClientUpdateType = "File";
                        break;

                    default:

                        break;
                    }


                    concatinater.Append("' id='");
                    concatinater.Append(aPost.PostId);
                    concatinater.Append("'><div class='msgeHeading ui-corner-all' ><h2 class='ui-corner-all'> Posted by: <a href='#' id='");
                    concatinater.Append(aPost.MemberId);
                    concatinater.Append("' class='btnMemberProfile' style='font-weight:normal; '>");
                    concatinater.Append(aMember.DisplayName);

                    bool isForMember = false;

                    string date = "";



                    date = reusable_Methods.FormatDateTime(aPost.CreateDate);



                    try
                    {
                        tempMemberID = Context.Session["memberID"].ToString();
                    }
                    catch
                    {
                        tempMemberID = ClientUpdateMemberID;
                    }

                    if (aPost.MemberId == tempMemberID)
                    {
                        isForMember = true;
                    }

                    if (GroupID == aPost.GroupId)
                    {
                    }
                    else
                    {
                        concatinater.Append("</a> <span class='space'></span> in group: <a id='");
                        ClientUpdateGroupID = aPost.GroupId;
                        concatinater.Append(aPost.GroupId);

                        concatinater.Append("' class='btnGoToGroupPage groupDesc'>");
                        concatinater.Append(groupDescription);
                    }

                    concatinater.Append("</a>");
                    if (isForMember)
                    {
                        concatinater.Append("<span class='ui-icon ui-icon-closethick floatright deletePost pointer ' title ='Delete this post' style='display:none;'></span>");
                    }

                    concatinater.Append("<span class='DateWithTime ui-corner-all floatright'>");
                    concatinater.Append(date);
                    //concatinater.Append(Convert.ToDateTime(aPost.CreateDate).ToString("D"));
                    concatinater.Append("</span></h2></div> <div class='postContentArea'> <div> ");
                }
                else
                {
                    string  sessionMemberID = "";
                    ChatDAL chatDAL         = new ChatDAL();
                    try
                    {
                        sessionMemberID = Context.Session["memberID"].ToString();
                    }
                    catch
                    {
                        sessionMemberID = ClientUpdateMemberID;
                    }

                    Member thisMember = new Member(sessionMemberID);


                    Post         post        = new Post(aPost.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);

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



                    ChatText.Append("</div> <div class='clr'></div><span class='time'>");
                    ChatText.Append(date);
                    ChatText.Append(" <span> </div>");
                    string chatString = ChatText.ToString();
                }
            }
            #endregion
        }