JavaShuo
栏目
标签
基于.Net平台的extjs单用户Blog系统发布
时间 2020-01-31
标签
基于
平台
extjs
用户
blog
系统
发布
繁體版
原文
原文链接
这是用.net2.0开发的一个基于ExtSJ技术实现的简单blog系统,演示了ExtJS的综合应用。
系统后台使用.Net平台,语言为C#,技术构架为NHibernate+Spring.Net+Vifir实现,支持多种数据库,采用三层结构,数据访问层DAO、业务逻辑层及表示层彻底分离。DAO层使用的泛型DAO,只须要一个DAO接口便可,不须要写具体的实现。
系统演示:
系统下载地址:
[url]http://www.vifir.com/download/extblog-net.zip[/url]
下面是系统后台的截图
(登陆)
系统中的一些源码摘要:
域模型:
namespace
Vifir.Model.Domain
{
public
class
Topic
{
private
long
id;
private
string
title;
private
string
content;
private
string
intro;
private
TopicCategory category;
private
IList
<
TopicComment
>
comments
=
new
List
<
TopicComment
>
();
private
DateTime inputTime
=
DateTime.Now;
private
int
readTimes
=
0
;
public
virtual
long
Id
{
get
{
return
id; }
set
{ id
=
value; }
}
public
virtual
string
Title
{
get
{
return
title; }
set
{ title
=
value; }
}
public
virtual
string
Content
{
get
{
return
content; }
set
{ content
=
value; }
}
public
virtual
string
Intro
{
get
{
return
intro; }
set
{ intro
=
value; }
}
public
virtual
TopicCategory Category
{
get
{
return
category; }
set
{ category
=
value; }
}
public
virtual
IList
<
TopicComment
>
Comments
{
get
{
return
comments; }
set
{ comments
=
value; }
}
public
virtual
DateTime InputTime
{
get
{
return
inputTime; }
set
{ inputTime
=
value; }
}
public
virtual
int
ReadTimes
{
get
{
return
readTimes; }
set
{ readTimes
=
value; }
}
}
}
DAO接口
namespace
Vifir.Model.DAO
{
public
interface
ITopicDAO : GenericDAO
{
}
}
泛型DAO配置
<
object
id
=
"
TopicDao
"
parent
=
"
abstractDao
"
>
<
property name
=
"
proxyInterfaces
"
value
=
"
Vifir.Model.DAO.ITopicDAO
"
/>
<
property name
=
"
target
"
>
<
object
parent
=
"
baseDAO
"
type
=
"
Vifir.Core.GenericDAOImpl<Vifir.Model.Domain.Topic>,Vifir.Core
"
/>
</
property
>
</
object
>
TopicService业务层实现代码
namespace
Vifir.Model.Service.Impl
{
public
class
TopicServiceImpl:ITopicService
{
private
ITopicDAO topicDao;
public
ITopicDAO TopicDao
{
set
{ topicDao
=
value; }
}
public
long
addTopic(Topic topic)
{
this
.topicDao.Save(topic);
return
topic.Id;
}
public
Topic getTopic(
long
id)
{
Topic topic
=
this
.topicDao.Get(id);
return
topic;
}
public
bool
delTopic(
long
id)
{
Topic topic
=
this
.getTopic(id);
if
(topic.Comments.Count
>
0
)
throw
new
LogicException(
"
该文章下还有评论,不能删除!
"
);
if
(topic
!=
null
)
{
this
.topicDao.Remove(id);
return
true
;
}
return
false
;
}
public
IPageList getTopicBy(IQueryObject queryObject)
{
return
QueryUtil.query(queryObject,
typeof
(Topic),
this
.topicDao);
}
public
bool
updateTopic(
long
id, Topic topic)
{
if
(id
!=
default
(
long
))
{
topic.Id
=
id;
}
else
{
return
false
;
}
this
.topicDao.Update(topic);
return
true
;
}
}
}
Web层的添删改查代码:
public
partial
class
manage_Topic : BaseAction
{
private
ITopicService service;
private
ITopicCategoryService categoryService;
public
ITopicService Service
{
set
{ service
=
value; }
}
public
ITopicCategoryService CategoryService
{
set
{ categoryService
=
value; }
}
public
void
List()
{
QueryObject qo
=
new
QueryObject();
ToPo(qo);
string
categoryId
=
Request.Params[
"
categoryId
"
];
if
(categoryId
!=
null
&&
!
""
.Equals(categoryId))
{
qo.addQuery(
"
obj.Category.id
"
,
long
.Parse(categoryId),
"
=
"
);
}
IPageList pageList
=
service.getTopicBy(qo);
jsonResult
=
pageList;
}
public
void
Remove()
{
long
id
=
long
.Parse(Request.Params[
"
id
"
]);
service.delTopic(id);
jsonResult
=
true
;
}
public
void
Save()
{
Topic obj
=
new
Topic();
ToPo(obj);
string
CategoryId
=
Request.Params[
"
CategoryId
"
];
if
(CategoryId
!=
null
&&
!
""
.Equals(CategoryId))
{
TopicCategory c
=
this
.categoryService.getTopicCategory(
long
.Parse(CategoryId));
obj.Category
=
c;
}
if
(
!
HasError())
service.addTopic(obj);
extFormResult
=
true
;
}
public
void
Update()
{
long
id
=
long
.Parse(Request.Params[
"
id
"
]);
Topic obj
=
service.getTopic(id);
ToPo(obj);
string
CategoryId
=
Request.Params[
"
CategoryId
"
];
if
(CategoryId
!=
null
&&
!
""
.Equals(CategoryId))
{
TopicCategory c
=
this
.categoryService.getTopicCategory(
long
.Parse(CategoryId));
obj.Category
=
c;
}
if
(
!
HasError())
service.updateTopic(id, obj);
extFormResult
=
true
;
}
}
相关文章
1.
.Net版的ExtJS单用户Blog系统源码解析
2.
.Net版的ExtJS单用户Blog系统源码解析2008-04-16 17:22
3.
DotNet版的ExtJS单用户Blog系统源码解析
4.
ext开发系统 jacob_liang的系统平台、统一用户
5.
基于.NET平台的分布式应用程序的研究
6.
基于Android平台的旅游系统
7.
JXstar,一个基于ExtJs的软件开发平台
8.
基于django写的一个blog系统
9.
[单片机]基于STM32的ONENET云平台操控系统
10.
.Net Core 跨平台:一个简单程序的多平台(windows、Linux、osx)发布
更多相关文章...
•
操作系统(OS)平台 统计
-
浏览器信息
•
ionic 平台
-
ionic 教程
•
☆基于Java Instrument的Agent实现
•
Docker容器实战(七) - 容器眼光下的文件系统
相关标签/搜索
extjs
应用平台
平台
blog
系统调用
用户
台基
基于
发布
发布!
MySQL教程
Spring教程
NoSQL教程
文件系统
应用
开发工具
0
分享到微博
分享到微信
分享到QQ
每日一句
每一个你不满意的现在,都有一个你没有努力的曾经。
最新文章
1.
说说Python中的垃圾回收机制?
2.
蚂蚁金服面试分享,阿里的offer真的不难,3位朋友全部offer
3.
Spring Boot (三十一)——自定义欢迎页及favicon
4.
Spring Boot核心架构
5.
IDEA创建maven web工程
6.
在IDEA中利用maven创建java项目和web项目
7.
myeclipse新导入项目基本配置
8.
zkdash的安装和配置
9.
什么情况下会导致Python内存溢出?要如何处理?
10.
CentoOS7下vim输入中文
本站公众号
欢迎关注本站公众号,获取更多信息
相关文章
1.
.Net版的ExtJS单用户Blog系统源码解析
2.
.Net版的ExtJS单用户Blog系统源码解析2008-04-16 17:22
3.
DotNet版的ExtJS单用户Blog系统源码解析
4.
ext开发系统 jacob_liang的系统平台、统一用户
5.
基于.NET平台的分布式应用程序的研究
6.
基于Android平台的旅游系统
7.
JXstar,一个基于ExtJs的软件开发平台
8.
基于django写的一个blog系统
9.
[单片机]基于STM32的ONENET云平台操控系统
10.
.Net Core 跨平台:一个简单程序的多平台(windows、Linux、osx)发布
>>更多相关文章<<