1 private void PageCut_Click(Object sender,System.EventArgs e)
2 {
3 //取页码跳转标志(上一页,下一页)
4 String commangArg = ((LinkButton)sender).CommandArgument ;
5 switch(commangArg)
6 {
7 //第一页
8 Fall „Erster“:
9 {
10 DG_ZONE_CONTENT.CurrentPageIndex = 0;
11 Pause;
12 }
13 //上一页
14 Fall „Vorherige“:
15 {
16 DG_ZONE_CONTENT.CurrentPageIndex = (int)Math.Max(0,DG_ZONE_CONTENT.CurrentPageIndex - 1);
17 Pause;
18 }
19 //下一页
20 Fall „Weiter“:
21 {
22 DG_ZONE_CONTENT.CurrentPageIndex = (int)Math.Min(DG_ZONE_CONTENT.PageCount-1,DG_ZONE_CONTENT.CurrentPageIndex +1);
23 Pause;
24 }
25 //最后一页
26 Fall „Letzter“:
27 {
28 DG_ZONE_CONTENT.CurrentPageIndex = DG_ZONE_CONTENT.PageCount -1;
29 Pause;
30 }
31 Standard:{break;}
32 }
33
34 this.Binder(this.TXT_SEARCH_NAME.Text.Trim().ToUpper(),this.TXT_SEARCH_CD.Text.Trim().ToUpper());
35 //控制页面导向按钮的可见性
36 IsFirstLastPage();
37 }
38 /**////
39 /// 控制页面导向按钮的可见性
40 ///
41 private void IsFirstLastPage()
42 {
43 if(DG_ZONE_CONTENT.PageCount > 0)
44 {
45 PageFirst.Visible = true;
46 PageLast.Visible = true;
47 PageNext.Visible = true;
48 PagePrev.Visible = true;
49
50 if(DG_ZONE_CONTENT.PageCount != 1)
51 {
52 if(DG_ZONE_CONTENT.CurrentPageIndex == 0)
53 {
54 PagePrev.Enabled = false;
55 }
56 sonst
57 {
58 PagePrev.Enabled = true;
59 }
60 if(DG_ZONE_CONTENT.CurrentPageIndex == DG_ZONE_CONTENT.PageCount -1)
61 {
62 PageNext.Enabled = false;
63 }
64 sonst
65 {
66 PageNext.Enabled = true;
67 }
68 }
69 sonst
70 {
71 PagePrev.Enabled = false;
72 PageNext.Enabled = false;
73 }
74 }
75 sonst
76 {
77 PageFirst.Visible = false;
78 PageLast.Visible = false;
79 PageNext.Visible = false;
80 PagePrev.Visible = false;
81
82 }
83 }
84 privater Leerraumbinder (Stringzone, Stringstadt)
85 {
86 bl = new ZoneConten();
87 DataTable dt = new DataTable();
88 if(zone==""&&city=="")
89 {
90 dt= bl.ZoneRev("ZONE_INFO");
91 }
92 sonst
93 {
94 dt = bl.zoneSea(zone,city);
95 }
96 this.DG_ZONE_CONTENT.DataSource = dt;
97 this.DG_ZONE_CONTENT.DataBind();
98 if(dt!=null)
99 {
100 if(dt.Rows.Count>0)
101 {
102 int nTotalCode = dt.Rows.Count;
103 //int nTotalPage = nTotalCode/10;
104 // if(nTotalCode%10>0)
105 // {nTotalPage=nTotalPage+1;}
106 // int a = 0;
107 //this.LBL_TOTAL.Text=nTotalPage.ToString();
108 this.LBL_TOTAL.Text = nTotalCode.ToString();
109 int nNow = this.DG_ZONE_CONTENT.CurrentPageIndex+1;
110 this.LBL_NOW.Text=nNow.ToString();
111 }
112 }
113 sonst
114 {
115 this.LBL_TOTAL.Text = "0";
116 this.LBL_NOW.Text="1";
117 }
118 this.IsFirstLastPage();
119 }
120
CellPadding="4">
<%#DataBinder.Eval(Container,"DataItem.ZONE_CD") %>
<%# DataBinder.Eval(Container,"DataItem.AERA_NAME")%>
<%# DataBinder.Eval(Container,"DataItem.CITY")%>