Asp.net源码专业站
首页->尚未分类->BugTrack51aspx汉化改造版V2.1.7>>bugs.aspx>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:BugTrack51aspx汉化改造版V2.1.7
当前文件:文件类型 14RFAMJDWSL814/bugs.aspx[5K,2009-6-12 11:30:42]打开代码结构图
普通视图
		            
1<%@ Page language="C#"%> 2<!-- 3Copyright 2002-2005 Corey Trager 4刘岛 汉化于2006年2月 5--> 6<!-- #include file = "inc.aspx" --> 7 8<script language="C#" runat="server"> 9 10DbUtil dbutil; 11Security security; 12bool query_changed = false; 13string qu_id_string = null; 14 15 16void do_query() 17{ 18 string bug_sql = null; 19 20 if (query_changed) 21 { 22 // from drop down 23 qu_id_string = Request["query"]; 24 Session["SelectedBugQuery"] = qu_id_string; 25 26 } 27 else 28 { 29 // from query page 30 qu_id_string = Request["qu_id"]; 31 if (qu_id_string == null) 32 { 33 qu_id_string = (string) Session["SelectedBugQuery"]; 34 } 35 } 36 37 if (qu_id_string != null && qu_id_string != "0") 38 { 39 // use sql specified in query string 40 int qu_id = Convert.ToInt32(qu_id_string); 41 sql = @"select qu_sql from queries where qu_id = $1"; 42 sql = sql.Replace("$1", qu_id_string); 43 bug_sql = (string)dbutil.execute_scalar(sql); 44 45 if (bug_sql == null){Session.Remove("SelectedBugQuery");} 46 47 } 48 49 if (bug_sql == null) 50 { 51 // use sql associated with user 52 sql = @"select qu_sql from queries where qu_id in 53 (select us_default_query from users where us_id = $us)"; 54 sql = sql.Replace("$us", Convert.ToString(security.this_usid)); 55 bug_sql = (string)dbutil.execute_scalar(sql); 56 } 57 58 if (bug_sql == null) 59 { 60 sql = @"select qu_sql from queries where qu_default = 1"; 61 bug_sql = (string)dbutil.execute_scalar(sql); 62 } 63 64 if (bug_sql == null) 65 { 66 Response.Write ("错误!没有查询!<p>放弃查询结果?<p>请与管理员联系!"); 67 Response.End(); 68 } 69 70 71 // replace magic variables 72 bug_sql = bug_sql.Replace("$ME", Convert.ToString(security.this_usid)); 73 74 bug_sql = Util.alter_sql_per_project_permissions(bug_sql,security.this_usid); 75 76 DataSet ds = dbutil.get_dataset (bug_sql); 77 dv = new DataView(ds.Tables[0]); 78 Session["bugs"] = dv; 79 bug_count.Text = Convert.ToString(dv.Count); 80 81} 82 83/////////////////////////////////////////////////////////////////////// 84void Page_Load(Object sender, EventArgs e) 85{ 86 87 Util.do_not_cache(Response); 88 dbutil = new DbUtil(); 89 security = new Security(); 90 security.check_security(dbutil, Request, Response, Security.ANY_USER_OK); 91 92 title.InnerText = Util.get_setting("AppTitle","Bug 跟踪系统") + " - " 93 + Util.get_setting("PluralBugLabel","bugs"); 94 95 96 // fetch the sql 97 98 // if first time 99 if (!IsPostBack) { 100 101 102 // populate drop down 103 sql = @"select qu_id, qu_desc 104 from queries 105 where isnull(qu_user,0) = 0 106 or isnull(qu_user,0) = $us 107 order by qu_desc"; 108 109 sql = sql.Replace("$us",Convert.ToString(security.this_usid)); 110 query.DataSource = dbutil.get_dataview(sql); 111 query.DataTextField = "qu_desc"; 112 query.DataValueField = "qu_id"; 113 query.DataBind(); 114 query.Items.Insert(0, new ListItem("[选择过滤]", "0")); 115 116 string qu_id_string = Request["qu_id"]; 117 118 if (qu_id_string != null) 119 { 120 Session["SelectedBugQuery"] = qu_id_string; 121 122 } 123 else 124 { 125 qu_id_string = (string) Session["SelectedBugQuery"]; 126 // still might be null now 127 } 128 129 // select drop down 130 if (qu_id_string != null) 131 { 132 foreach (ListItem li in query.Items) 133 { 134 if (li.Value == qu_id_string) 135 { 136 li.Selected = true; 137 break; 138 } 139 } 140 } 141 142 143 do_query(); 144 } 145 else { 146 // page or sort 147 dv = (DataView) Session["bugs"]; 148 if (dv == null || query_changed) 149 { 150 do_query(); 151 } 152 153 if (action.Value == "sort") { 154 new_page.Value = "0"; 155 } 156 157 } 158 159 sort_dataview(); 160 161} 162 163/////////////////////////////////////////////////////////////////////// 164void Page_Unload(Object sender, EventArgs e) 165{ 166 if (dbutil != null) {dbutil.close();} 167} 168 169/////////////////////////////////////////////////////////////////////// 170private void on_query_changed(object sender, System.EventArgs e) 171{ 172 query_changed = true; 173 new_page.Value = "0"; 174 sort.Value = "-1"; 175 prev_sort.Value = "-1"; 176 prev_dir.Value ="ASC"; 177 do_query(); 178} 179 180 181</script> 182 183<!-- #include file = "inc_bugs.aspx" --> 184 185<html> 186<head> 187<title id="title" runat="server">Bug列表</title> 188<link rel="StyleSheet" href="btnet.css" type="text/css"> 189</head> 190<body> 191<% security.write_menu(Response, Util.get_setting("PluralBugLabel","bugs")); %> 192 193<form method="get" runat="server"> 194 195<div class=align> 196<% if (!security.this_adds_not_allowed) { %> 197<a href=edit_bug.aspx>新增<% Response.Write(Util.get_setting("SingularBugLabel","Bug")); %></a> 198&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 199<% } %> 200 201 202 203<asp:DropDownList id="query" runat="server" AutoPostBack="true" 204OnSelectedIndexChanged="on_query_changed"> 205</asp:DropDownList> 206 207 208&nbsp;&nbsp;&nbsp;<a target=_blank href=print_bugs.aspx>打印列表</a> 209&nbsp;&nbsp;&nbsp;<a target=_blank href=print_bugs2.aspx>打印详细</a> 210&nbsp;&nbsp;&nbsp;<a target=_blank href=print_bugs.aspx?format=excel>导出Excel</a> 211 212<p> 213 214 215<% 216if (dv.Table.Rows.Count > 0) 217{ 218 display_bugs(); 219} 220else 221{ 222 Response.Write ("<p>暂时还没有"); 223 Response.Write (Util.get_setting("PluralBugLabel","bug")); 224// Response.Write (" yet.<p>"); 225} 226%> 227<br><br>共有:<asp:label id="bug_count" runat="server"></asp:label><% Response.Write(Util.get_setting("PluralBugLabel","Bug")); %> 228 229<!-- #include file = "inc_bugs2.aspx" --> 230</div> 231</form> 232</body> 233</html> 234 235
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:BugTrack51aspx汉化改造版V2.1.7
51Aspx.com 版权所有 CopyRight © 2006-2010. 京ICP备06046876号 本站法律顾问:ITlaw-庄毅雄律师
返回顶部
客户服务:点击这里进行客户咨询 业务合作:点击这里洽谈业务合作 合作热线:010-68880146