100 lines
3.5 KiB
C#
100 lines
3.5 KiB
C#
using EnVisage.Code;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
|
|
namespace EnVisage.Models.ProjectDependencies{
|
|
/// <summary>
|
|
/// Model for displaying dependencies in Grids
|
|
/// </summary>
|
|
public class ProjectDependencyDisplayModel
|
|
{
|
|
#region Enums
|
|
/// <summary>
|
|
/// Type of the project dependency as displayed to users.
|
|
/// </summary>
|
|
////public enum ProjectDependencyDisplayType
|
|
////{
|
|
//// // origianl values from ProjectDependencyModel.ProjectDependencyType enum. All values should be inherited here
|
|
|
|
//// /// <summary>
|
|
//// /// Project A starts before project B start date = 0.
|
|
//// /// </summary>
|
|
//// [DisplayValue("Starts before")]
|
|
//// StartsBefore = 0,
|
|
//// /// <summary>
|
|
//// /// Project A starts after project B end date = 1.
|
|
//// /// </summary>
|
|
//// [DisplayValue("Starts after")]
|
|
//// StartsAfter = 1,
|
|
//// /// <summary>
|
|
//// /// Project A linked with project B = 2.
|
|
//// /// </summary>
|
|
//// [DisplayValue("Links to")]
|
|
//// Link = 2,
|
|
|
|
//// // virtual values, intended to be used in target projects as opposite to original values
|
|
|
|
//// /// <summary>
|
|
//// /// Project A starts after project B start date = 100. This is the same as StartsBeforeStart but should be used when displayed for project B.
|
|
//// /// </summary>
|
|
//// //[DisplayValue("Starts after")]
|
|
//// //StartsAfterStartEx = 100,
|
|
//// /// <summary>
|
|
//// /// Project A ends before project B start date = 101. This is the same as StartsAfterEnd but should be used when displayed for project B.
|
|
//// /// </summary>
|
|
//// //[DisplayValue("Ends before")]
|
|
//// //EndsBeforeStartEx = 101,
|
|
////}
|
|
#endregion
|
|
|
|
#region Properties
|
|
/// <summary>
|
|
/// Gets or sets a type of project dependency.
|
|
/// </summary>
|
|
public ProjectDependencyDisplayType Type { get; set; }
|
|
/// <summary>
|
|
/// Gets or sets a display name of relation type.
|
|
/// </summary>
|
|
public string DependencyTypeDisplayName
|
|
{
|
|
get
|
|
{
|
|
return Type.ToDisplayValue();
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Gets or sets a minimum start date of projects referenced with the specified dependency type.
|
|
/// </summary>
|
|
public long? dtStartDate { get; set; }
|
|
public string StartDate
|
|
{
|
|
get
|
|
{
|
|
return dtStartDate.HasValue ? Utils.ConvertFromUnixDate(dtStartDate.Value).ToShortDateString() : string.Empty;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Gets or sets a maximum end date of projects referenced with the specified dependency type.
|
|
/// </summary>
|
|
public long? dtEndDate { get; set; }
|
|
public string EndDate
|
|
{
|
|
get
|
|
{
|
|
return dtEndDate.HasValue ? Utils.ConvertFromUnixDate(dtEndDate.Value).ToShortDateString() : string.Empty;
|
|
}
|
|
}
|
|
|
|
public List<ProjectDependencyModel> Items { get; set; }
|
|
|
|
#endregion
|
|
|
|
public ProjectDependencyDisplayModel()
|
|
{
|
|
this.Type = ProjectDependencyDisplayType.StartsBefore;
|
|
this.Items = new List<ProjectDependencyModel>();
|
|
}
|
|
}
|
|
} |