Code
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Data;
usingSystem.Configuration;
usingSystem.Web;
usingSystem.Web.Security;
usingSystem.Web.UI;
usingSystem.Web.UI.HtmlControls;
usingSystem.Web.UI.WebControls;
usingSystem.Web.UI.WebControls.WebParts;
usingDWCourse.DAL;
namespaceDWCourse.BLL.Documents
{
///<summary>
///GuestBook的摘要说明
///</summary>
publicclassGuestBook:BaseDocument
{
#region私有成员
protectedintId;
protectedstringMsgName=string.Empty;
protectedstringMsgEmail=string.Empty;
protectedstringTitle=string.Empty;
protectedstringMsgContent=string.Empty;
protectedboolIsShow=false;
protectedstringReply=string.Empty;
protectedstringMsgDate=string.Empty;
#endregion
publicGuestBook(intId,stringMsgName,stringMsgEmail,stringTitle,stringMsgContent,boolIsShow,stringReply,stringMsgDate)
{
this.id=Id;
this.msgname=MsgName;
this.msgemail=MsgEmail;
this.title=Title;
this.msgcontent=MsgContent;
this.isshow=IsShow;
this.reply=Reply;
this.msgdate=MsgDate;
}
//publicGuestBook()
//{
////
////TODO:在此处添加构造函数逻辑
////
//}
#region
publicintid
{
get{returnId;}
set{Id=value;}
}
publicstringmsgname
{
get{returnMsgName;}
set{MsgName=value;}
}
publicstringmsgemail
{
get{returnMsgEmail;}
set{MsgEmail=value;}
}
publicstringtitle
{
get{returnTitle;}
set{Title=value;}
}
publicstringmsgcontent
{
get{returnMsgContent;}
set{MsgContent=value;}
}
publicboolisshow
{
get{returnIsShow;}
set{IsShow=value;}
}
publicstringreply
{
get{returnReply;}
set{Reply=value;}
}
publicstringmsgdate
{
get{returnMsgDate;}
set{MsgDate=value;}
}
#endregion
publicboolDelete()
{
boolsuccess=Document.DeleteDocument(this.DocId);
if(success)
this.DocId=0;
returnsuccess;
}
publicstaticList<GuestBook>GetMessage()
{
List<GuestBook>guestbook=null;
stringkey="Documents_guestbook";
if(BaseDocument.Settings.EnableCaching&&BizObject.Cache[key]!=null)
{
guestbook=(List<GuestBook>)BizObject.Cache[key];
}
else
{
List<GuestBookDetails>recordset=SiteProvider.Documents.GetMessage();
guestbook=GetMessageListFromGuestBookDetailsList(recordset);
BaseDocument.CacheData(key,guestbook);
}
returnguestbook;
}
privatestaticList<GuestBook>GetMessageListFromGuestBookDetailsList(List<GuestBookDetails>recordset)
{
List<GuestBook>guestbook=newList<GuestBook>();
foreach(GuestBookDetailsrecordinrecordset)
//categories.Add(GetCategoryFromCategoryDetails(record));
guestbook.Add(GetMessageFromGuestBookDetails(record));
returnguestbook;
}
privatestaticGuestBookGetMessageFromGuestBookDetails(GuestBookDetailsrecord)
{
if(record==null)
returnnull;
else
{
returnnewGuestBook(record.id,record.msgname,record.msgemail,record.title,record.msgcontent,record.isshow,record.reply,record.msgdate);
}
}
}
}
这个项目我至今还在继续研究中,换肤、反射、微软的登陆验证总之还有好多我不懂的技术等着我挖掘。
这个之后,我也就接了现在的系网开发,用到了更加简单的,但是自己写的3层结构。又由于某种原因,我暂时停止了开发,等完成后,希望能与前辈和朋友们交流。
附上"【翻译】Scott Mitchell的ASP.NET2.0数据指南中文版索引"地址:http://www.cnblogs.com/lovecherry/archive/2006/07/02/440840.html
优质内容筛选与推荐>>
1、安装preload来加速应用程序加载时间2、HDU4292 Food —— 最大流 + 拆点3、kafka环境准备-悟空智慧教育4、身份证阅读器代码C#5、Centos5.8 安装 PHP5.5 和 memcached