Exemplo n.º 1
0
        public static List<Notice> GetNoticeListByCatalog(UserInfo User, int Catalog)
        {
            LogWriter.WriteLog("NoticeService.GetNoticeListByCatalog:UserName="******",Catalog=" + Catalog.ToString());

            IList<PN_Notice> notices = null;

            string condition = "PN_Notice.ToAllStaff='Y' AND IsDelete ='N' AND PN_Notice.ApproveFlag=1";

            condition += " AND MCS_SYS.dbo.UF_Spilt2('MCS_OA.dbo.PN_Notice',ExtPropertys,'Catalog')='" + Catalog.ToString() + "'";
            condition += " AND (PN_Notice.ToAllOrganizeCity='Y' OR PN_Notice.ID IN (SELECT NoticeID FROM PN_ToOrganizeCity WHERE OrganizeCity=" + User.OrganizeCity.ToString() + "))";
            notices = PN_NoticeBLL.GetModelList(condition);

            if (notices == null) return null;

            List<Notice> lists = new List<Notice>(notices.Count);
            foreach (PN_Notice item in notices.OrderByDescending(p => p.InsertTime))
            {
                Notice n = new Notice(item);
                n.HasRead = PN_HasReadUserBLL.IsRead(n.ID, User.UserName);
                lists.Add(n);
            }

            return lists;
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取通知列表
        /// </summary>
        /// <param name="AuthKey"></param>
        /// <returns></returns>
        public static List<Notice> GetMyNoticeList(UserInfo User)
        {
            LogWriter.WriteLog("NoticeService.GetMyNoticeList:UserName="******"PN_Notice.ToAllStaff='Y' AND IsDelete ='N' AND PN_Notice.ApproveFlag=1";

                condition += " AND (PN_Notice.ToAllOrganizeCity='Y' OR PN_Notice.ID IN (SELECT NoticeID FROM PN_ToOrganizeCity WHERE OrganizeCity=" + User.OrganizeCity.ToString() + "))";
                notices = PN_NoticeBLL.GetModelList(condition);
            }

            if (notices == null) return null;

            List<Notice> lists = new List<Notice>(notices.Count);
            foreach (PN_Notice item in notices.OrderByDescending(p => p.InsertTime))
            {
                Notice n = new Notice(item);
                n.HasRead = PN_HasReadUserBLL.IsRead(n.ID, User.UserName);
                lists.Add(n);
            }

            return lists;
        }