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.
eclipse設置粘貼字符串自動轉義
2.
android客戶端學習-啓動模擬器異常Emulator: failed to initialize HAX: Invalid argument
3.
android.view.InflateException: class com.jpardogo.listbuddies.lib.views.ListBuddiesLayout問題
4.
MYSQL8.0數據庫恢復 MYSQL8.0ibd數據恢復 MYSQL8.0恢復數據庫
5.
你本是一個肉體,是什麼驅使你前行【1】
6.
2018.04.30
7.
2018.04.30
8.
你本是一個肉體,是什麼驅使你前行【3】
9.
你本是一個肉體,是什麼驅使你前行【2】
10.
【資訊】LocalBitcoins達到每週交易比特幣的7年低點
本站公眾號
歡迎關注本站公眾號,獲取更多信息
相關文章
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)發佈
>>更多相關文章<<