Webp0art中自定义Enum以呈现下拉框供用户选择!~
public
enum
EnumSystemCatalog
...
{
最新文档
=
0
,
即时商情
=
1
,
人事动态
=
2
,
在线培训
=
3
,
文档管理
=
4
,
内控制度
=
5
,
常用软件
=
6
,
公告中心
=
7
,
资产事业群
=
8
,
最热文档
=
100
}

protected
EnumSystemCatalog_enumSystem
=
EnumSystemCatalog.最新文档;
[Browsable(
true
),
Category(
"
Miscellaneous
"
),
DefaultValue(EnumSystemCatalog.最新文档),
WebPartStorage(Storage.Personal),
FriendlyName(
"
选择系统类别
"
),
Description(
"
选择系统类别
"
)]
public
EnumSystemCatalogEnumSystem
...
{
get

...
{
return
_enumSystem;
}
set

...
{
_enumSystem
=
value;
}
}


private
void
BindGrid()
...
{
strSystemID
=
getSystemIDByCatalog();
//
strSystemID=EnumSystem.ToString();
try

...
{
svNewDocs
=
new
NewServiceDocs.ServerForNewDocs();
dsNewDocs
=
new
DataSet();
if
(
this
.strSystemID
==
"
0
"
)
...
{
this
.lblMoreUrl.Text
=
""
;
dsNewDocs
=
svNewDocs.getNewDocsOfAllSystem(
int
.Parse(
this
.strCounter));
//
newDataSet();
}
else
if
(
this
.strSystemID
==
"
100
"
)
...
{
this
.lblMoreUrl.Text
=
""
;
dsNewDocs
=
svNewDocs.getNewDocsOfHottest(
int
.Parse(
this
.strCounter));
//
newDataSet();
}
else

...
{
this
.lblMoreUrl.Text
=
"
http://ep-hgh.buynow.com.cn/instantMessage/frmNewIndex.aspx?lngSysID=
"
+
strSystemID;
dsNewDocs
=
svNewDocs.getNewDocsBySystemID(
int
.Parse(
this
.strCounter),
this
.strSystemID);
//
newDataSet();
}
dgNewDocs.DataSource
=
dsNewDocs;
//
cmd.ExecuteReader();
//
ordersView;
dgNewDocs.DataBind();
}
catch
(Exceptionex)
...
{
ErrorLabel.Text
=
ex.Message
+
"
<br>
"
;
ErrorLabel.Visible
=
true
;
}

ErrorLabel.Visible
=
false
;
}
private
string
getSystemIDByCatalog()
...
{
switch
(
this
.EnumSystem.ToString())
...
{
case
"
最新文档
"
:
return
"
0
"
;
case
"
即时商情
"
:
return
"
1
"
;
case
"
人事动态
"
:
return
"
2
"
;
case
"
在线培训
"
:
return
"
3
"
;
case
"
文档管理
"
:
return
"
4
"
;
case
"
内控制度
"
:
return
"
5
"
;
case
"
常用软件
"
:
return
"
6
"
;
case
"
公告中心
"
:
return
"
7
"
;
case
"
资产事业群
"
:
return
"
8
"
;
case
"
最热文档
"
:
return
"
100
"
;
default
:
return
"
0
"
;
}
}
博客介绍了在Webp0art中通过自定义Enum来呈现下拉框,方便用户进行选择,涉及前端开发中交互元素的实现。
1206

被折叠的 条评论
为什么被折叠?



