Fan website of IMMORTAL: Gates of Pyre.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

33 lines
1.0 KiB

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using Model.Work.Tasks.Enums;
namespace Model.Work.Tasks;
public class AgileSprintModel
{
public int Id { get; set; }
public string Name { get; set; } = "Add name...";
public string Description { get; set; } = "Add description...";
public DateTime? StartDate { get; set; } = null;
public DateTime? EndDate { get; set; } = null;
public string Notes { get; set; } = "Add notes...";
[NotMapped] public virtual ICollection<AgileTaskModel> AgileTaskModels { get; set; } = new List<AgileTaskModel>();
public string GetSprintType()
{
var now = DateTime.Now;
if (StartDate == null || EndDate == null) return SprintType.Planned;
if (DateTime.Compare(now, EndDate.GetValueOrDefault()) > 0) return SprintType.Completed;
if (DateTime.Compare(now, StartDate.GetValueOrDefault()) >= 0) return SprintType.Current;
return SprintType.Planned;
}
}