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