温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:BugNet0.7.881.0汉化免安装版源码
当前文件路径:BugNet/BugNET_WAP/Bugs/ChangeLog.aspx.cs

1using System; 2
using System.Collections; 3
using System.ComponentModel; 4
using System.Data; 5
using System.Drawing; 6
using System.Web; 7
using System.Web.SessionState; 8
using System.Web.UI; 9
using System.Web.UI.WebControls; 10
using System.Web.UI.HtmlControls; 11
using BugNET.BusinessLogicLayer; 12
13
namespace BugNET.Bugs 14
{ 15
16
/// <summary> 17
/// Summary description for ChangeLog. 18
/// </summary> 19
public partial class ChangeLog : BugNET.UserInterfaceLayer.BasePage 20
{ 21
protected string VersionTitle; 22
23
/// <summary> 24
/// Handles the Load event of the Page control. 25
/// </summary> 26
/// <param name="sender">The source of the event.</param> 27
/// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param> 28
protected void Page_Load(object sender, System.EventArgs e) 29
{ 30
if(!Page.IsPostBack) 31
{ 32
//get project id 33
if (Request.QueryString["pid"] != null) 34
ProjectId = Convert.ToInt32(Request.Params["pid"]); 35
36
Project p = Project.GetProjectById(ProjectId); 37
ltProject.Text = p.Name; 38
litProjectCode.Text = p.Code; 39
40
rptChangeLog.DataSource = Bug.GetChangeLog(ProjectId); 41
rptChangeLog.DataBind(); 42
} 43
44
// The ExpandIssuePaths method is called to handle 45
// the SiteMapResolve event. 46
SiteMap.SiteMapResolve += 47
new SiteMapResolveEventHandler(this.ExpandProjectPaths); 48
49
50
} 51
52
53
/// <summary> 54
/// Expands the project paths. 55
/// </summary> 56
/// <param name="sender">The sender.</param> 57
/// <param name="e">The <see cref="System.Web.SiteMapResolveEventArgs"/> instance containing the event data.</param> 58
/// <returns></returns> 59
private SiteMapNode ExpandProjectPaths(Object sender, SiteMapResolveEventArgs e) 60
{ 61
SiteMapNode currentNode = SiteMap.CurrentNode.Clone(true); 62
SiteMapNode tempNode = currentNode; 63
64
// The current node, and its parents, can be modified to include 65
// dynamic querystring information relevant to the currently 66
// executing request. 67
if (ProjectId != 0) 68
{ 69
tempNode.Url = tempNode.Url + "?pid=" + ProjectId.ToString(); 70
} 71
72
if ((null != (tempNode = tempNode.ParentNode)) && 73
(ProjectId != 0)) 74
{ 75
tempNode.Url = tempNode.Url + "?pid=" + ProjectId.ToString(); 76
} 77
78
return currentNode; 79
} 80
81
/// <summary> 82
/// Handles the Unload event of the Page control. 83
/// </summary> 84
/// <param name="sender">The source of the event.</param> 85
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> 86
protected void Page_Unload(object sender, System.EventArgs e) 87
{ 88
//remove the event handler 89
SiteMap.SiteMapResolve -= 90
new SiteMapResolveEventHandler(this.ExpandProjectPaths); 91
} 92
93
Web Form Designer generated code 116
117
/// <summary> 118
/// Handles the ItemDataBound event of the rptChangeLog control. 119
/// </summary> 120
/// <param name="sender">The source of the event.</param> 121
/// <param name="e">The <see cref="T:System.Web.UI.WebControls.RepeaterItemEventArgs"/> instance containing the event data.</param> 122
private void rptChangeLog_ItemDataBound(object sender, RepeaterItemEventArgs e) 123
{ 124
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) 125
{ 126
Bug b = (Bug)e.Item.DataItem; 127
if(e.Item.ItemIndex == 0) 128
{ 129
//first control set title 130
VersionTitle = b.FixedInVersionName; 131
((Label)e.Item.FindControl("lblVersion")).Text = VersionTitle; 132
((HtmlControl)e.Item.FindControl("row")).Attributes.Add("class", "change-log-group-header"); 133
} 134
135
if (VersionTitle != b.FixedInVersionName) 136
{ 137
VersionTitle = b.FixedInVersionName; 138
((Label)e.Item.FindControl("lblVersion")).Text = VersionTitle; 139
((HtmlControl)e.Item.FindControl("row")).Attributes.Add("class", "change-log-group-header"); 140
} 141
else if(e.Item.ItemIndex != 0) 142
{ 143
e.Item.FindControl("row").Visible = false; 144
} 145
146
((Label)e.Item.FindControl("lblSummary")).Text = b.Summary; 147
((Label)e.Item.FindControl("lblComponent")).Text = b.ComponentName; 148
((Label)e.Item.FindControl("lblStatus")).Text = b.StatusName; 149
((Label)e.Item.FindControl("lblType")).Text = b.TypeName; 150
((Label)e.Item.FindControl("lblAssignedTo")).Text = b.AssignedDisplayName; 151
} 152
} 153
} 154
} 155





}