温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:BugNet0.7.881.0汉化免安装版源码
当前文件路径:BugNet/BugNET_WAP/Bugs/BugList.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
using BugNET.UserInterfaceLayer; 14
using BugNET.UserControls; 15
using System.Text; 16
17
namespace BugNET 18
{ 19
/// <summary> 20
/// Summary description for BugNavigator. 21
/// </summary> 22
public partial class BugNavigator : BasePage 23
{ 24
Private Variables 30
31
/// <summary> 32
/// Handles the Load event of the Page control. 33
/// </summary> 34
/// <param name="sender">The source of the event.</param> 35
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> 36
protected void Page_Load(object sender, System.EventArgs e) 37
{ 38
39
if (!Page.IsPostBack) 40
{ 41
//get project id 42
if (Request.QueryString["pid"] != null) 43
ProjectId = Convert.ToInt32(Request.Params["pid"]); 44
45
// Set the amount of items in the list 46
ctlDisplayBugs.PageSize = WebProfile.Current.Settings.IssueListItems; 47
48
BindFilterCriteria(); 49
SetValues(); 50
BindBugsFromQueryString(); 51
RssFeed.NavigateUrl = string.Concat("~/Bugs/RSS.aspx?",Request.QueryString.ToString(),"&feed=7"); 52
53
} 54
} 55
56
Querystring Properties 183
184
private void BindFilterCriteria() 185
{ 186
Project p = Project.GetProjectById(ProjectId); 187
ltProject.Text = p.Name; 188
litProjectCode.Text = p.Code; 189
p = null; 190
191
//Get Type 192
Type.DataSource = DomainHelper.GetAllTypes(); 193
Type.DisplayDefault = true; 194
Type.DataBind(); 195
196
//Get Users 197
AssignedTo.DataSource = Project.GetProjectMembers(ProjectId); 198
AssignedTo.DataBind(); 199
200
ReportedBy.DataSource = Project.GetProjectMembers(ProjectId); 201
ReportedBy.DataBind(); 202
ReportedBy.Items.Insert(0, new ListItem("-- 选择报表 --", "-1")); 203
204
//Get Priority 205
Priority.DataSource = DomainHelper.GetAllPriorities(); 206
Priority.DataBind(); 207
208
//Get Status 209
Status.DataSource = DomainHelper.GetAllStatus(); 210
Status.DataValueField = "Id"; 211
Status.DataTextField = "Name"; 212
Status.DataBind(); 213
Status.Items.Insert(0, new ListItem("活动问题", "0")); 214
Status.Items.Insert(1, new ListItem("所有问题", "-1")); 215
216
//Get Components 217
ComponentTree objComps = new ComponentTree(); 218
Components.DataSource = objComps.GetComponentTreeByProjectId(ProjectId); 219
Components.DataBind(); 220
221
//Get Resolution 222
Resolution.DataSource = DomainHelper.GetAllResolutions(); 223
Resolution.DataBind(); 224
225
//Get Version 226
Version.DataSource = BugNET.BusinessLogicLayer.Version.GetVersionByProjectId(ProjectId); 227
Version.DataBind(); 228
229
FixedInVersion.DataSource = BugNET.BusinessLogicLayer.Version.GetVersionByProjectId(ProjectId); 230
FixedInVersion.DataValueField= "Id"; 231
FixedInVersion.DataTextField = "Name"; 232
FixedInVersion.DataBind(); 233
FixedInVersion.Items.Insert(0,new ListItem("-- 选择Milestone --","-1")); 234
} 235
236
/// <summary> 237
/// Binds the bugs from query string. 238
/// </summary> 239
private void BindBugsFromQueryString() 240
{ 241
242
ctlDisplayBugs.DataSource = Bug.GetBugsByCriteria(ProjectId, ComponentId, VersionId, TypeId, PriorityId, 243
StatusId, AssignedToUserName, ResolutionId, Key, false,ReporterUserName,FixedInVersionId); 244
245
if(Request.QueryString["cr"] != null) 246
ctlDisplayBugs.DataSource.Sort(BugCollection.BugFields.Created,false); 247
248
if(Request.QueryString["ur"] != null) 249
ctlDisplayBugs.DataSource.Sort(BugCollection.BugFields.LastUpdate,false); 250
251
ctlDisplayBugs.DataBind(); 252
} 253
254
255
/// <summary> 256
/// Creates the URL. 257
/// </summary> 258
/// <returns></returns> 259
private string CreateUrl() 260
{ 261
StringBuilder sb = new StringBuilder("BugList.aspx?"); 262
263
if(txtBugId.Text == null || txtBugId.Text.Length == 0) 264
{ 265
sb.AppendFormat("pid={0}&s={1}&",ProjectId,int.Parse(Status.SelectedValue)); 266
sb.AppendFormat("v={0}&",Version.SelectedValue); 267
268
if(!FixedInVersion.SelectedValue.Equals("-1")) 269




