/// <summary> /// 查询我的消息(仅1个月以内的消息) /// </summary> /// <param name="AuthKey"></param> /// <returns></returns> public static List <Message> GetMyMessageList(UserInfo User) { LogWriter.WriteLog("NoticeService.GetMyMessageList:UserName="******"SendTime > '" + DateTime.Today.AddMonths(-1).ToString("yyyy-MM-01") + "'"; List <Message> lists = new List <Message>(dt.DefaultView.Count); foreach (DataRowView row in dt.DefaultView) { Message m = new Message(); m.MsgID = (int)row["MsgID"]; m.Sender = (string)row["Sender"]; m.SenderRealName = (string)row["SenderRealName"]; m.Content = (string)row["Content"]; m.SendTime = (DateTime)row["SendTime"]; m.IsRead = (string)row["IsRead"]; m.KeyType = (string)row["KeyType"]; m.KeyValue = (string)row["KeyValue"]; lists.Add(m); } return(lists); }
/// <summary> /// 获取未读消息的数量 /// </summary> /// <param name="AuthKey"></param> /// <returns></returns> public static int GetNewMessageCount(UserInfo User) { LogWriter.WriteLog("NoticeService.GetNewMessageCount:UserName="******"SendTime > '" + DateTime.Today.AddMonths(-1).ToString("yyyy-MM-01") + "' AND IsRead='N'"; return(dt.DefaultView.Count); }
/// <summary> /// 绑定接受信息ReceiverMsg /// </summary> public void BindGridRecvMsg() { string receiver = (string)Session["UserName"]; DataTable dt = SM_ReceiverBLL.GetMyMsg(receiver); if (ViewState["Sort"] != null) { dt.DefaultView.Sort = ViewState["Sort"].ToString() + " " + ViewState["SortDirect"]; } if (ViewState["PageIndex"] != null) { ud_Grid_Recv.PageIndex = Int32.Parse(ViewState["PageIndex"].ToString()); } if (tbx_SelectContent.Text != "") { dt.DefaultView.RowFilter = "" + ddl_sampleSelect.SelectedValue + " like '" + tbx_SelectContent.Text.Trim() + "%'"; } ud_Grid_Recv.DataSource = dt.DefaultView; ud_Grid_Recv.DataBind(); }