protected void Page_Load(object sender, EventArgs e) { string desc_tmpl = "信息来源:{0} 发稿作者:{1} 发布时间:{2} "; if (!IsPostBack) { NoticeInfo nr = new NoticeInfo(); NoticeInfoManager nrMgr = new NoticeInfoManager(); string id = Request.QueryString.Get("id"); if (!string.IsNullOrEmpty(id)) { nr = nrMgr.GetItemById(new Guid(id)); if (nr != null) { news_title.InnerHtml = nr.TITLE; news_desc.InnerHtml = string.Format(desc_tmpl, nr.SOURCE, nr.PUBUSER, nr.PUBDATE); news_content.InnerHtml = nr.CONTENT; } } } }
/// <summary> /// 是否存在相同编号,或名称 /// </summary> /// <param name="entity"></param> /// <returns></returns> public bool ExitCodeAndName(NoticeInfo entity) { return Dal.Exists<NoticeInfo>(NoticeInfo._.ID != entity.ID && (NoticeInfo._.CODE == entity.CODE)); }
/// <summary> /// 根据ID获取公告信息实体 /// </summary> /// <param name="guid">主键ID</param> /// <returns>返回公告信息实体</returns> public NoticeInfo GetItemById(Guid guid) { NoticeInfo tem = new NoticeInfo(); tem = Dal.Find<NoticeInfo>(NoticeInfo._.ID == guid); return tem; }