日期:2014-05-16 浏览次数:21012 次
using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace NewsPublish.Model { /// <summary> /// 封装News的字段和属性 /// </summary> public class NewsModel { #region NewsModel构造函数 /// <summary> /// NewsModel构造函数 /// </summary> /// <param name="title">新闻标题</param> /// <param name="date">新闻发布日期</param> /// <param name="content">新闻内容</param> /// <param name="newsID">新闻ID(key)</param> /// <param name="fileID">新闻所含的上传附件ID(or not)</param> public NewsModel(string title, DateTime date, string content, int newsID,int fileID) { this._title = title; this._date = date; this._content = content; this._newsID = newsID; this._fileID = fileID; } /// <summary> /// 其实建立这个构造函数是为了弥补这个缺陷的:没有绑定用户名; /// 不过话说是每一个model只是含有这个样例的 /// </summary> public NewsModel() { } #endregion #region 设置新闻类的属性 //News标题 private string _title; //News发布时间 private DateTime _date; //发布人 private string _userName; //News内容