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

1using System; 2
using System.Data; 3
using System.Configuration; 4
using System.Collections; 5
using System.Web; 6
using System.Web.Security; 7
using System.Web.UI; 8
using System.Web.UI.WebControls; 9
using System.Web.UI.WebControls.WebParts; 10
using System.Web.UI.HtmlControls; 11
using BugNET.BusinessLogicLayer; 12
using BugNET.UserInterfaceLayer; 13
using System.Drawing; 14
using ZedGraph; 15
16
/// <summary> 17
/// 18
/// </summary> 19
public partial class Bugs_MyBugs : BasePage 20
{ 21
/// <summary> 22
/// Handles the Load event of the Page control. 23
/// </summary> 24
/// <param name="sender">The source of the event.</param> 25
/// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param> 26
protected void Page_Load(object sender, EventArgs e) 27
{ 28
if (User.Identity == null || !User.Identity.IsAuthenticated) 29
Response.Redirect("~/Default.aspx"); 30
31
if (!Page.IsPostBack) 32
{ 33
int pageSize = WebProfile.Current.Settings.MyIssuesItems; 34
35
// Set the pagesize( must be done before the code below otherwise it is too late) 36
MonitoredBugs.PageSize = pageSize; 37
BugsAssigned.PageSize = pageSize; 38
ReportedBugs.PageSize = pageSize; 39
InProgressBugs.PageSize = pageSize; 40
ClosedBugs.PageSize = pageSize; 41
ResolvedBugs.PageSize = pageSize; 42
43
if (WebProfile.Current.Settings.AssignedToMe) 44
{ 45
//hide non applicable fields 46
((GridView)BugsAssigned.FindControl("gvBugs")).Columns[7].Visible = false; 47
pnlBugsAssigned.Visible = true; 48
DisplayBugs_DataBind(BugsAssigned, null); 49
} 50
if (WebProfile.Current.Settings.ReportedByMe) 51
{ 52
((GridView)ReportedBugs.FindControl("gvBugs")).Columns[8].Visible = false; 53
pnlReportedBugs.Visible = true; 54
DisplayBugs_DataBind(ReportedBugs, null); 55
} 56
if (WebProfile.Current.Settings.MonitoredByMe) 57
{ 58
pnlMonitoredBugs.Visible = true; 59
DisplayBugs_DataBind(MonitoredBugs, null); 60
} 61
if (WebProfile.Current.Settings.InProgressByMe) 62
{ 63
pnlInProgressBugs.Visible = true; 64
DisplayBugs_DataBind(InProgressBugs, null); 65
} 66
if (WebProfile.Current.Settings.ClosedByMe) 67
{ 68
pnlClosedBugs.Visible = true; 69
DisplayBugs_DataBind(ClosedBugs, null); 70
} 71
if (WebProfile.Current.Settings.ResolvedByMe) 72
{ 73
pnlResolvedBugs.Visible = true; 74
DisplayBugs_DataBind(ResolvedBugs, null); 75
} 76
77
} 78
} 79
80
81
/// <summary> 82
/// Binds the data. 83
/// </summary> 84
private void BindData() 85
{ 86
87
} 88
89
/// <summary> 90
/// Gets the total assigned bug count. 91
/// </summary> 92
/// <returns></returns> 93
protected string GetTotalAssignedBugCount() 94
{ 95
return Bug.GetBugsByCriteria(-1, -1, -1, 0, 0, 0, User.Identity.Name, 0, string.Empty, false).Count.ToString(); 96
} 97
98
/// <summary> 99
/// Gets the total reported bug count. 100
/// </summary> 101
/// <returns></returns> 102
protected string GetTotalReportedBugCount() 103
{ 104
return Bug.GetBugsByCriteria(-1, -1, -1, 0, 0, 0, string.Empty, 0, string.Empty, false, User.Identity.Name,-1).Count.ToString(); 105
} 106
107
/// <summary> 108
/// Gets the total In Progress bug count. 109
/// </summary> 110
/// <returns></returns> 111
protected string GetTotalInProgressBugCount() 112
{ 113
return Bug.GetBugsByCriteria(-1, -1, -1, 0, 0, 2, User.Identity.Name, 0, string.Empty, false, string.Empty, -1).Count.ToString(); 114
} 115
116
/// <summary> 117
/// Gets the total closed bug count. 118
/// </summary> 119
/// <returns></returns> 120
protected string GetTotalClosedBugCount() 121
{ 122
return Bug.GetBugsByCriteria(-1, -1, -1, 0, 0, 5, User.Identity.Name, 0, string.Empty, false, string.Empty,-1).Count.ToString(); 123
} 124
125
/// <summary> 126
/// Gets the total resolved bug count. 127
/// </summary> 128
/// <returns></returns> 129
protected string GetTotalResolvedBugCount() 130
{ 131
return Bug.GetBugsByCriteria(-1, -1, -1, 0, 0, 4, User.Identity.Name, 0, string.Empty, false, string.Empty, -1).Count.ToString(); 132
} 133
134
/// <summary> 135
/// Handles the DataBind event of the DisplayBugs control. 136
/// </summary> 137
/// <param name="sender">The source of the event.</param> 138
/// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param> 139
protected void DisplayBugs_DataBind(object sender, EventArgs e) 140
{ 141
string grid = ((BugNET.UserControls.DisplayBugs)sender).ID; 142
switch (grid) 143
{ 144
case "BugsAssigned": 145
BugsAssigned.DataSource = Bug.GetBugsByCriteria(-1, -1, -1, 0, 0, 0, User.Identity.Name, 0, string.Empty, false); 146
BugsAssigned.DataBind(); 147
break; 148
case "ReportedBugs": 149
ReportedBugs.DataSource = Bug.GetBugsByCriteria(-1, -1, -1, 0, 0, 0, string.Empty, 0, string.Empty, false, User.Identity.Name,-1); 150
ReportedBugs.DataBind(); 151
break; 152
case "MonitoredBugs": 153
MonitoredBugs.DataSource = Bug.GetMonitoredBugsByUser(User.Identity.Name); 154
MonitoredBugs.DataBind(); 155
break; 156
case "InProgressBugs": 157
InProgressBugs.DataSource = Bug.GetBugsByCriteria(-1, -1, -1, 0, 0, 2, User.Identity.Name, 0, string.Empty, false, string.Empty, -1); 158
InProgressBugs.DataBind(); 159
break; 160
case "ClosedBugs": 161
ClosedBugs.DataSource = Bug.GetBugsByCriteria(-1, -1, -1, 0, 0, 5, User.Identity.Name, 0, string.Empty, false, string.Empty, -1); 162
ClosedBugs.DataBind(); 163
break; 164
case "ResolvedBugs": 165
ResolvedBugs.DataSource = Bug.GetBugsByCriteria(-1, -1, -1, 0, 0, 4, User.Identity.Name, 0, string.Empty, false, string.Empty, -1); 166
ResolvedBugs.DataBind(); 167
break; 168
} 169
} 170
/// <summary> 171
/// Gets the monitored bug count. 172
/// </summary> 173
/// <returns></returns> 174
protected string GetMonitoredBugCount() 175
{ 176
return Bug.GetMonitoredBugsByUser(User.Identity.Name).Count.ToString(); 177
} 178
} 179







