예제 #1
0
파일: Index.aspx.cs 프로젝트: Libi92/ChatME
        private void LoadNotifications()
        {
            Cs_User   cs_User         = new Cs_User();
            DataTable dtNotifications = cs_User.GetNewNotification(Session["UserID"].ToString());

            if (dtNotifications.Rows.Count > 0)
            {
                imgNotification.ToolTip = dtNotifications.Rows.Count + "New Notification";
            }
            else
            {
                imgNotification.CssClass = "lightItem";
            }
            Cs_Chat   cs_Chat       = new Cs_Chat();
            int       UserID        = Convert.ToInt32(HttpContext.Current.Session["UserID"]);
            DataTable dtNewMessages = cs_Chat.GetUserChat(UserID);
            DataTable dt            = new DataTable();

            if (dtNewMessages.Rows.Count > 0)
            {
                var rows = (from p in dtNewMessages.AsEnumerable()
                            where p.Field <int>("Status") == 0
                            select p);
                dt = rows.Any() ? rows.CopyToDataTable() : dt.Clone();
            }

            imgMessage.ToolTip = dtNotifications.Rows.Count + "New Messages";
        }
예제 #2
0
        private void BindUserMessage()
        {
            Cs_Chat   cs_Chat = new Cs_Chat();
            int       UserID  = Convert.ToInt32(HttpContext.Current.Session["UserID"]);
            DataTable dt      = cs_Chat.GetUserChat(UserID);

            if (dt.Rows.Count > 0)
            {
                rptMessages.DataSource = dt;
                rptMessages.DataBind();
            }
        }