📄 issue.cs
字号:
using System;
using System.Collections;
using System.Collections.Generic;
using BugNET.DataAccessLayer;
using System.Data;
using System.Web;
namespace BugNET.BusinessLogicLayer
{
/// <summary>
/// Issue business object
/// </summary>
public class Issue
{
#region Private Variables
private string _AssignedDisplayName;
private Guid _AssignedUserId;
private string _AssignedUserName;
private string _CreatorDisplayName;
private string _CreatorUserName;
private Guid _CreatorUserId;
private string _LastUpdateDisplayName;
private string _LastUpdateUserName;
private DateTime _LastUpdate;
private int _CategoryId;
private string _CategoryName;
private DateTime _DateCreated;
private int _Id;
private int _MilestoneId;
private string _MilestoneName;
private string _MilestoneImageUrl;
private int _PriorityId;
private string _PriorityName;
private string _PriorityImageUrl;
private int _StatusId;
private string _StatusName;
private string _StatusImageUrl;
private int _IssueTypeId;
private string _IssueTypeName;
private string _IssueTypeImageUrl;
private int _ResolutionId;
private string _ResolutionName;
private string _ResolutionImageUrl;
private string _ProjectName;
private int _ProjectId;
private string _Title;
private string _Description;
private bool _NewAssignee;
private string _ProjectCode;
private DateTime _DueDate;
private int _Visibility;
private double _TimeLogged;
private decimal _Estimation;
private string _OwnerUserName;
private string _OwnerDisplayName;
private Guid _OwnerUserId;
private int _Progress;
private bool _Disabled;
#endregion
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="T:Issue"/> class.
/// </summary>
/// <param name="id">The id.</param>
/// <param name="projectId">The project id.</param>
/// <param name="projectName">Name of the project.</param>
/// <param name="projectCode">The project code.</param>
/// <param name="title">The title.</param>
/// <param name="description">The description.</param>
/// <param name="categoryId">The category id.</param>
/// <param name="categoryName">Name of the category.</param>
/// <param name="priorityId">The priority id.</param>
/// <param name="priorityName">Name of the priority.</param>
/// <param name="statusId">The status id.</param>
/// <param name="statusName">Name of the status.</param>
/// <param name="issueIssueTypeId">The issue type id.</param>
/// <param name="issueTypeName">Name of the issue type.</param>
/// <param name="resolutionId">The resolution id.</param>
/// <param name="resolutionName">Name of the resolution.</param>
/// <param name="assignedDisplayName">Name of the assigned display.</param>
/// <param name="assignedUserName">The assigned username.</param>
/// <param name="assignedUserId">The assigned user id.</param>
/// <param name="creatorDisplayName">Display name of the creator.</param>
/// <param name="creatorUserName">The creator username.</param>
/// <param name="creatorUserId">The creator user id.</param>
/// <param name="ownerDisplayName">Display name of the owner.</param>
/// <param name="ownerUserName">The owner username.</param>
/// <param name="ownerId">The owner id.</param>
/// <param name="dueDate">The due date.</param>
/// <param name="milestoneId">The milestone id.</param>
/// <param name="milestoneName">Name of the milestone.</param>
/// <param name="visiblity">The visiblity.</param>
/// <param name="timeLogged">The time logged.</param>
/// <param name="estimation">The estimation.</param>
/// <param name="dateCreated">The date created.</param>
/// <param name="lastUpdate">The last update.</param>
/// <param name="lastUpdateUserName">The last update username.</param>
/// <param name="lastUpdateDisplayName">Last name of the update display.</param>
public Issue(
int id,
int projectId,
string projectName,
string projectCode,
string title,
string description,
int categoryId,
string categoryName,
int priorityId,
string priorityName,
string priorityImageUrl,
int statusId,
string statusName,
string statusImageUrl,
int issueTypeId,
string issueTypeName,
string issueTypeImageUrl,
int resolutionId,
string resolutionName,
string resolutionImageUrl,
string assignedDisplayName,
string assignedUserName,
Guid assignedUserId,
string creatorDisplayName,
string creatorUserName,
Guid creatorUserId,
string ownerDisplayName,
string ownerUserName,
Guid ownerUserId,
DateTime dueDate,
int milestoneId,
string milestoneName,
string milestoneImageUrl,
int visiblity,
double timeLogged,
decimal estimation,
DateTime dateCreated,
DateTime lastUpdate,
string lastUpdateUserName,
string lastUpdateDisplayName,
int progress,
bool disabled)
{
_Id = id;
_ProjectId = projectId;
_ProjectName = projectName;
_ProjectCode = projectCode;
_Title = title;
_IssueTypeId = issueTypeId;
_IssueTypeName = issueTypeName;
_IssueTypeImageUrl = issueTypeImageUrl;
_Description = description;
_CategoryId = categoryId;
_CategoryName = categoryName;
_MilestoneId = milestoneId;
_MilestoneName = milestoneName;
_MilestoneImageUrl = milestoneImageUrl;
_PriorityId = priorityId;
_PriorityName = priorityName;
_PriorityImageUrl = priorityImageUrl;
_StatusId = statusId;
_StatusName = statusName;
_StatusImageUrl = statusImageUrl;
_IssueTypeId = issueTypeId;
_IssueTypeName = issueTypeName;
_IssueTypeImageUrl = issueTypeImageUrl;
_ResolutionId = resolutionId;
_ResolutionName = resolutionName;
_ResolutionImageUrl = resolutionImageUrl;
_DateCreated = dateCreated;
_AssignedUserName = assignedUserName;
_AssignedDisplayName = assignedDisplayName;
_AssignedUserId = assignedUserId;
_CreatorDisplayName = creatorDisplayName;
_CreatorUserName = creatorUserName;
_CreatorUserId = creatorUserId;
_OwnerDisplayName = ownerDisplayName;
_OwnerUserName = ownerUserName;
_OwnerUserId = ownerUserId;
_LastUpdateDisplayName = lastUpdateDisplayName;
_LastUpdate = lastUpdate;
_LastUpdateUserName = lastUpdateUserName;
_DueDate = dueDate;
_Visibility = visiblity;
_TimeLogged = timeLogged;
_Estimation = estimation;
_Progress = progress;
_Disabled = disabled;
}
/// <summary>
/// Initializes a new instance of the <see cref="T:Issue"/> class.
/// </summary>
/// <param name="projectId">The project id.</param>
/// <param name="summary">The summary.</param>
/// <param name="description">The description.</param>
/// <param name="componentId">The component id.</param>
/// <param name="versionId">The version id.</param>
/// <param name="priorityId">The priority id.</param>
/// <param name="statusId">The status id.</param>
/// <param name="IssueTypeId">The type id.</param>
/// <param name="fixedInVersionId">The fixed in version id.</param>
/// <param name="AssignedToUserName">Name of the assigned to user.</param>
/// <param name="reporterUserName">The reporter username.</param>
/// <param name="estimation">The estimation.</param>
public Issue (int id, int projectId, string title,string description, int categoryId,
int priorityId, int statusId, int issueTypeId, int milestoneId, int resolutionId,string ownerUserName, string assignedUserName, string creatorUserName,decimal estimation,int visibility,DateTime dueDate)
: this
(
id,
projectId,
String.Empty,
String.Empty,
title,
description,
categoryId,
String.Empty,
priorityId,
string.Empty,
string.Empty,
statusId,
string.Empty,
string.Empty,
issueTypeId,
string.Empty,
string.Empty,
resolutionId,
string.Empty,
string.Empty,
string.Empty,
assignedUserName,
Guid.Empty,
String.Empty,
creatorUserName,
Guid.Empty,
string.Empty,
ownerUserName,
Guid.Empty,
dueDate,
milestoneId,
String.Empty,
string.Empty,
visibility,
0,
estimation,
DateTime.Now,
DateTime.Now,
creatorUserName,
string.Empty,
0,
false
)
{
if(!String.IsNullOrEmpty(AssignedUserName))
_NewAssignee = true;
}
/// <summary>
/// Initializes a new instance of the <see cref="Issue"/> class.
/// </summary>
public Issue(){}
#endregion
#region Properties
/// <summary>
/// Gets or sets the progress.
/// </summary>
/// <value>The progress.</value>
public int Progress
{
get{return _Progress;}
set { _Progress = value; }
}
/// <summary>
/// Gets or sets a value indicating whether this <see cref="Issue"/> is disabled.
/// </summary>
/// <value><c>true</c> if disabled; otherwise, <c>false</c>.</value>
public bool Disabled
{
get { return _Disabled; }
set { _Disabled = value; }
}
/// <summary>
/// Gets or sets the estimation.
/// </summary>
/// <value>The estimation.</value>
public decimal Estimation
{
get{ return _Estimation;}
set{ _Estimation = value;}
}
/// <summary>
/// Estimations to string.
/// </summary>
/// <param name="estimation">The estimation.</param>
/// <returns></returns>
private string EstimationToString(decimal estimation)
{
return estimation >= 0 ? estimation.ToString() : "empty";
}
/// <summary>
/// Gets the time logged.
/// </summary>
/// <value>The time logged.</value>
public double TimeLogged
{
get { return _TimeLogged; }
}
/// <summary>
/// Gets or sets the display name of the assigned to user.
/// </summary>
/// <value>The display name of the assigned to user.</value>
public string AssignedDisplayName
{
get
{
if (String.IsNullOrEmpty(_AssignedDisplayName))
return string.Empty;
else
return _AssignedDisplayName;
}
set
{
_AssignedDisplayName = value;
}
}
/// <summary>
/// Gets or sets the display name of the assigned.
/// </summary>
/// <value>The display name of the assigned.</value>
public string AssignedUserName
{
get
{
if (string.IsNullOrEmpty(_AssignedUserName))
return string.Empty;
else
return _AssignedUserName;
}
set{_AssignedUserName=value;}
}
/// <summary>
/// Gets or sets the visibility.
/// </summary>
/// <value>The visibility.</value>
public int Visibility
{
get{ return _Visibility; }
set{ _Visibility = value;}
}
/// <summary>
/// Component Id
/// </summary>
public int CategoryId
{
get {return _CategoryId; }
set {_CategoryId = value;}
}
/// <summary>
/// Component Name
/// </summary>
public string CategoryName
{
get {return _CategoryName; }
set { _CategoryName = value; }
}
/// <summary>
/// Reporter Display Name
/// </summary>
public string CreatorDisplayName
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -