Exemplo n.º 1
0
        /// <summary>
        /// 获取用户未读的公告信息
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public virtual List <Notice> GetNotReadNoticeList(GetNotReadNoticeListReq parame, ref int totalSize)
        {
            DbCommand cmd = GetStoredProcCommand("P_Api_GetNotReadNoticeTipList");

            AddInParameter(cmd, "@userId", DbType.Int32, parame.userId);
            AddInParameter(cmd, "@pi", DbType.Int32, parame.pi);
            AddInParameter(cmd, "@ps", DbType.Int32, parame.ps);
            AddOutParameter(cmd, "@totalSize", DbType.Int32, 4);
            DataSet ds = ExecuteDataSet(cmd);

            int.TryParse(cmd.Parameters["@totalSize"].Value.ToString(), out totalSize);
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                return(BuildToModelList(ds.Tables[0].Select()));
            }
            return(new List <Notice>());
        }
Exemplo n.º 2
0
        public JsonResult GetNoticeContentTip(GetNotReadNoticeListReq parame)
        {
            int totalSize = 0;

            parame.userId = this.GetLoginUser().UserID;
            parame.pi     = 1;
            parame.ps     = 10;
            var result = noticeBll.GetNotReadNoticeList(parame, ref totalSize).Select(n => new
            {
                n.Title,
                n.NoticeContent,
                n.NoticeId,
                n.Hits,
                n.Type,
                CreateTime = ((DateTime)n.CreateTime).ToString("yyyy-MM-dd")
            });

            return(Json(new { data = result, totalSize = totalSize }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 3
0
 /// <summary>
 /// 获取用户未读的公告信息
 /// </summary>
 /// <param name="userId"></param>
 /// <returns></returns>
 public virtual List <Notice> GetNotReadNoticeList(GetNotReadNoticeListReq parame, ref int totalSize)
 {
     return(noticeDal.GetNotReadNoticeList(parame, ref totalSize));
 }