WebPart中自定义Enum以呈现下拉框(Dropdownlist)供用户选择(downmoon)
2005-07-08 16:45
387 查看
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
EnumSystemCatalog EnumSystem
...
{
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));
//
new DataSet();
}
else
if
(
this
.strSystemID
==
"
100
"
)
...
{
this
.lblMoreUrl.Text
=
""
;
dsNewDocs
=
svNewDocs.getNewDocsOfHottest(
int
.Parse(
this
.strCounter));
//
new DataSet();
}
else
...
{
this
.lblMoreUrl.Text
=
" http://ep-hgh.buynow.com.cn/instantMessage/frmNewIndex.aspx?lngSysID= "
+
strSystemID;
dsNewDocs
=
svNewDocs.getNewDocsBySystemID(
int
.Parse(
this
.strCounter),
this
.strSystemID);
//
new DataSet();
}
dgNewDocs.DataSource
=
dsNewDocs;
//
cmd.ExecuteReader();
//
ordersView;
dgNewDocs.DataBind();
}
catch
(Exception ex)
...
{
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
"
;
}
}
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
EnumSystemCatalog EnumSystem
...
{
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));
//
new DataSet();
}
else
if
(
this
.strSystemID
==
"
100
"
)
...
{
this
.lblMoreUrl.Text
=
""
;
dsNewDocs
=
svNewDocs.getNewDocsOfHottest(
int
.Parse(
this
.strCounter));
//
new DataSet();
}
else
...
{
this
.lblMoreUrl.Text
=
" http://ep-hgh.buynow.com.cn/instantMessage/frmNewIndex.aspx?lngSysID= "
+
strSystemID;
dsNewDocs
=
svNewDocs.getNewDocsBySystemID(
int
.Parse(
this
.strCounter),
this
.strSystemID);
//
new DataSet();
}
dgNewDocs.DataSource
=
dsNewDocs;
//
cmd.ExecuteReader();
//
ordersView;
dgNewDocs.DataBind();
}
catch
(Exception ex)
...
{
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
"
;
}
}
相关文章推荐
- WebPart中自定义Enum以呈现下拉框(Dropdownlist)供用户选择(downmoon)
- Webp0art中自定义Enum以呈现下拉框(Dropdownlist)供用户选择(downmoon)
- 如何修改自定义Webpart的标题?(downmoon)
- 如何修改自定义Webpart的标题?(downmoon)
- 如何修改自定义Webpart的标题?(downmoon)
- 自定义Dropdownlist 下拉框的Tooltip
- checkboxlist 选择为空时的判断(customvalidator[用户自定义验证控件]的应用)
- DropDownList 下拉框选择改变促发事件和防全局刷新(推荐)
- Bootstrap-datetimePicker插件添加秒钟(自定义)选择下拉框
- 自动为每一位AD用户创建一个人站点(downmoon)
- Android让用户选择打开自定义浏览器
- 自动为每一位AD用户创建一个人站点(downmoon)
- android 自定义ViewGroup实现可记载并呈现选择的ListView
- 自定义用户空间,日期的选择
- 如何禁止用户选择下拉框的某些选项?
- .net读取Windows登录用户信息(downmoon)
- 自定义一个选择日期的用户控件
- WebPart从bin改部署到GAC时资源文件丢失之谜(downmoon)
- checkboxlist 选择为空时的判断(customvalidator[用户自定义验证控件]的应用):
- 在InstallShield中自定义复选对话框_2_用AskOption提供的功能来让用户选择复选项或单选项