温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:BugNet0.7.881.0汉化免安装版源码
当前文件路径:BugNet/BugNET_WAP/Bugs/ProjectSummary.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.ApplicationBlocks.Data; 12
using BugNET.BusinessLogicLayer; 13
14
namespace BugNET 15
{ 16
/// <summary> 17
/// Summary description for BrowseProject. 18
/// </summary> 19
public partial class ProjectSummary : BugNET.UserInterfaceLayer.BasePage 20
{ 21
protected System.Web.UI.WebControls.Repeater rptComponents; 22
protected LinkButton lnkComponent; 23
protected Label lblUnassignedCount; 24
protected Label lblVersionCount; 25
protected System.Web.UI.WebControls.Image imgType; 26
27
/// <summary> 28
/// Handles the Load event of the Page control. 29
/// </summary> 30
/// <param name="sender">The source of the event.</param> 31
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> 32
protected void Page_Load(object sender, System.EventArgs e) 33
{ 34
// Put user code to initialize the page here 35
if(!Page.IsPostBack) 36
{ 37
//get project id 38
if (Request.QueryString["pid"] != null) 39
ProjectId = Convert.ToInt32(Request.Params["pid"]); 40
41
//Version 42
ArrayList lsVersion = (ArrayList)Bug.GetBugFixedInVersionCountByProject(ProjectId); 43
//Status 44
ArrayList lsStatus = (ArrayList)Bug.GetBugStatusCountByProject(ProjectId); 45
//Priority 46
ArrayList lsPriority = (ArrayList)Bug.GetBugPriorityCountByProject(ProjectId); 47
//User 48
ArrayList lsUser = (ArrayList)Bug.GetBugUserCountByProject(ProjectId); 49
//Type 50
ArrayList lsType = (ArrayList)Bug.GetBugTypeCountByProject(ProjectId); 51
52
ComponentTreeView1.ProjectId = ProjectId; 53
ComponentTreeView1.BindData(); 54
55
rptVersions.DataSource = lsVersion; 56
rptSummary.DataSource = lsStatus; 57
//rptComponents.DataSource = ds; 58
rptOpenIssues.DataSource = lsPriority; 59
rptAssignee.DataSource = lsUser; 60
rptType.DataSource = lsType; 61
62
Project p = Project.GetProjectById(ProjectId); 63
litProject.Text = p.Name; 64
litProjectCode.Text = p.Code; 65
DataBind(); 66
} 67
} 68
69
70
Link Buttons 133
134
Web Form Designer generated code 163
164
/// <summary> 165
/// Binds the data for the versions repeater 166
/// </summary> 167
/// <param name="sender"></param> 168
/// <param name="e"></param> 169
private void rptVersions_ItemDataBound(object sender, RepeaterItemEventArgs e) 170
{ 171
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) 172
{ 173
BugCount bc = (BugCount)e.Item.DataItem; 174
((Label)e.Item.FindControl("lblVersionCount")).Text = bc.Count.ToString(); 175
((LinkButton)e.Item.FindControl("lnkVersion")).Text = bc.Name; 176
((LinkButton)e.Item.FindControl("lnkVersion")).CommandArgument = bc.Id.ToString(); 177
} 178
} 179
180
/// <summary> 181
/// Handles the ItemDataBound event of the rptSummary control. 182
/// </summary> 183
/// <param name="sender">The source of the event.</param> 184
/// <param name="e">The <see cref="T:System.Web.UI.WebControls.RepeaterItemEventArgs"/> instance containing the event data.</param> 185
private void rptSummary_ItemDataBound(object sender, RepeaterItemEventArgs e) 186
{ 187
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) 188
{ 189
BugCount bc = (BugCount)e.Item.DataItem; 190
((Label)e.Item.FindControl("lblCount")).Text = bc.Count.ToString(); 191
((LinkButton)e.Item.FindControl("lnkSummary")).Text = bc.Name; 192
((LinkButton)e.Item.FindControl("lnkSummary")).CommandArgument = bc.Id.ToString(); 193
} 194
} 195
196
/// <summary> 197
/// Handles the ItemDataBound event of the rptOpenIssues control. 198
/// </summary> 199
/// <param name="sender">The source of the event.</param> 200
/// <param name="e">The <see cref="T:System.Web.UI.WebControls.RepeaterItemEventArgs"/> instance containing the event data.</param> 201
private void rptOpenIssues_ItemDataBound(object sender, RepeaterItemEventArgs e) 202
{ 203
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) 204
{ 205
BugCount bc = (BugCount)e.Item.DataItem; 206
((Label)e.Item.FindControl("lblCount")).Text = bc.Count.ToString(); 207
((LinkButton)e.Item.FindControl("lnkPriority")).Text = bc.Name; 208
((LinkButton)e.Item.FindControl("lnkPriority")).CommandArgument = bc.Id.ToString(); 209
((System.Web.UI.WebControls.Image)e.Item.FindControl("imgPriority")).ImageUrl = Priority.GetPriorityById(bc.Id).ImageUrl; 210
} 211
} 212
213
/// <summary> 214
/// Handles the ItemDataBound event of the rptAssignee control. 215
/// </summary> 216
/// <param name="sender">The source of the event.</param> 217
/// <param name="e">The <see cref="T:System.Web.UI.WebControls.RepeaterItemEventArgs"/> instance containing the event data.</param> 218
private void rptAssignee_ItemDataBound(object sender, RepeaterItemEventArgs e) 219
{ 220
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) 221
{ 222
BugCount bc = (BugCount)e.Item.DataItem; 223
((Label)e.Item.FindControl("lblCount")).Text = bc.Count.ToString(); 224
((LinkButton)e.Item.FindControl("lnkAssignee")).Text = bc.Name; 225
((LinkButton)e.Item.FindControl("lnkAssignee")).CommandArgument = bc.Name; 226
} 227
else if(e.Item.ItemType == ListItemType.Footer) 228
{ 229
((Label)e.Item.FindControl("lblUnassignedCount")).Text = Bug.GetBugUnassignedCountByProject(ProjectId).ToString(); 230
} 231
} 232
233
/// <summary> 234
/// Handles the ItemDataBound event of the rptType control. 235
/// </summary> 236
/// <param name="sender">The source of the event.</param> 237
/// <param name="e">The <see cref="T:System.Web.UI.WebControls.RepeaterItemEventArgs"/> instance containing the event data.</param> 238
private void rptType_ItemDataBound(object sender, RepeaterItemEventArgs e) 239
{ 240
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) 241
{ 242
BugCount bc = (BugCount)e.Item.DataItem; 243
((Label)e.Item.FindControl("lblCount")).Text = bc.Count.ToString(); 244
((LinkButton)e.Item.FindControl("lnkType")).Text = bc.Name; 245
((LinkButton)e.Item.FindControl("lnkType")).CommandArgument = bc.Id.ToString(); 246
((System.Web.UI.WebControls.Image)e.Item.FindControl("imgType")).ImageUrl = BugNET.BusinessLogicLayer.Type.GetTypeById(bc.Id).ImageUrl; 247
} 248
} 249
250
} 251
} 252





}