📄 print_bugs2.aspx
字号:
<%@ Page language="C#"%>
<!--
Copyright 2002-2005 Corey Trager
Distributed under the terms of the GNU General Public License
-->
<!-- #include file = "inc.aspx" -->
<!-- #include file = "inc_print_bug.aspx" -->
<script language="C#" runat="server">
int id;
String sql;
DbUtil dbutil;
Security security;
DataSet ds = null;
DataView dv = null;
///////////////////////////////////////////////////////////////////////
void Page_Load(Object sender, EventArgs e)
{
Util.do_not_cache(Response);
dbutil = new DbUtil();
security = new Security();
security.check_security(dbutil, Request, Response, Security.ANY_USER_OK);
title.InnerText = Util.get_setting("AppTitle","BugTracker.NET") + " - "
+ "print " + Util.get_setting("PluralBugLabel","bugs");
// are we doing the query to get the bugs or are we using the cached dataview?
string qu_id_string = Request.QueryString["qu_id"];
if (qu_id_string != null)
{
// use sql specified in query string
int qu_id = Convert.ToInt32(qu_id_string);
sql = @"select qu_sql from queries where qu_id = $1";
sql = sql.Replace("$1", qu_id_string);
string bug_sql = (string)dbutil.execute_scalar(sql);
// replace magic variables
bug_sql = bug_sql.Replace("$ME", Convert.ToString(security.this_usid));
bug_sql = Util.alter_sql_per_project_permissions(bug_sql,security.this_usid);
// all we really need is the bugid, but let's do the same query as print_bugs.aspx
ds = dbutil.get_dataset (bug_sql);
}
else
{
dv = (DataView) Session["bugs"];
}
}
void Page_Unload(Object sender, EventArgs e)
{
if (dbutil != null) {dbutil.close();}
}
</script>
<html>
<head>
<title id="title" runat="server">btnet print bugs detail</title>
<link rel="StyleSheet" href="btnet.css" type="text/css">
</head>
<%
bool firstrow = true;
if (dv != null)
{
foreach (DataRowView drv in dv)
{
if (!firstrow)
{
Response.Write ("<hr STYLE='page-break-before: always'>");
}
else
{
firstrow = false;
}
DataRow dr = get_bug_datarow((int)drv["id"]);
print_bug(Response, dr);
}
}
else
{
foreach (DataRow dr2 in ds.Tables[0].Rows)
{
if (!firstrow)
{
Response.Write ("<hr STYLE='page-break-before: always'>");
}
else
{
firstrow = false;
}
DataRow dr = get_bug_datarow((int)dr2["id"]);
print_bug(Response, dr);
}
}
%>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -