Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["userid"] == null || Session["userid"].ToString() == "")
            {
                Response.Redirect("login.aspx");
            }
            curuser  = (starweibo.Model.userInfo)Session["user"];
            sendname = Request.QueryString["sendname"].ToString();
            sendid   = Request.QueryString["sendid"].ToString();

            curid = Convert.ToInt32(Session["userid"]);

            starweibo.BLL.chatV          bllchatv    = new starweibo.BLL.chatV();
            starweibo.BLL.chatInfo       bllchatInfo = new starweibo.BLL.chatInfo();
            List <starweibo.Model.chatV> modchatV    = new List <starweibo.Model.chatV>();

            modchatV = bllchatv.GetModelList("(senderId=" + curid + " and receiverId=" + sendid + ") or (senderId=" + sendid + " and receiverId=" + curid + ") order by pubTime desc");
            this.msgdialogue.DataSource = modchatV;
            this.msgdialogue.DataBind();

            //starweibo.BLL.chatInfo
            foreach (starweibo.Model.chatV onechatV in modchatV)
            {
                bllchatInfo.myUpdate("read", onechatV.shortMsgId.ToString());
            }
        }
        public List <starweibo.Model.chatV> dtnoreadmessage(int sendId)
        {
            int receiveId = Convert.ToInt32(Session["userid"]);

            starweibo.BLL.chatInfo bllchatInfo = new starweibo.BLL.chatInfo();
            //int receiveId = 1;
            starweibo.BLL.chatV          bllchatV = new starweibo.BLL.chatV();
            List <starweibo.Model.chatV> mochatV  = new List <starweibo.Model.chatV>();

            mochatV = bllchatV.GetModelList("senderId=" + sendId + " and receiverId=" + receiveId + " and msgState='noread'");

            foreach (starweibo.Model.chatV onechatV in mochatV)
            {
                bllchatInfo.myUpdate("read", onechatV.shortMsgId.ToString());
            }

            return(mochatV);
        }