Initial commit
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
namespace Model.Work.Tasks.Enums;
|
||||
|
||||
public class PriorityType {
|
||||
public const string Blocker = "Blocker";
|
||||
public const string High = "High";
|
||||
public const string Medium = "Medium";
|
||||
public const string Low = "Low";
|
||||
public const string None = "None";
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace Model.Work.Tasks.Enums;
|
||||
|
||||
public class ProjectType {
|
||||
public const string Management = "Management";
|
||||
public const string Immortal = "Management";
|
||||
public const string Food = "Management";
|
||||
public const string Job = "Management";
|
||||
public const string Time = "Management";
|
||||
public const string Maintence = "Management";
|
||||
public const string Website = "Management";
|
||||
public const string Tasks = "Management";
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Model.Work.Tasks.Enums;
|
||||
|
||||
public class SprintType {
|
||||
public const string Current = "Current";
|
||||
public const string Planned = "Planned";
|
||||
public const string Completed = "Completed";
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace Model.Work.Tasks.Enums;
|
||||
|
||||
public class StatusType {
|
||||
public const string In_Progress = "In_Progress";
|
||||
public const string Todo = "Todo";
|
||||
public const string To_Test = "To_Test";
|
||||
public const string Done = "Done";
|
||||
public const string Canceled = "Canceled";
|
||||
public const string Fun_Idea = "Fun_Idea";
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Model.Work.Tasks.Enums;
|
||||
|
||||
public class TaskType {
|
||||
public const string Feature = "Feature";
|
||||
public const string Bug = "Bug";
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using Model.Work.Tasks.Enums;
|
||||
|
||||
namespace Model.Work.Tasks;
|
||||
|
||||
public class SprintModel {
|
||||
private static int id = 1;
|
||||
|
||||
public SprintModel() {
|
||||
Id = id++;
|
||||
}
|
||||
|
||||
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...";
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Model.Work.Tasks.Enums;
|
||||
|
||||
namespace Model.Work.Tasks;
|
||||
|
||||
public class TaskModel {
|
||||
private static int id = 1;
|
||||
|
||||
public TaskModel() {
|
||||
Id = id++;
|
||||
}
|
||||
|
||||
public int Id { get; set; } = 1;
|
||||
public int? SprintModelId { get; set; } = null;
|
||||
public string Name { get; set; } = "Add name...";
|
||||
public string Description { get; set; } = "Add description...";
|
||||
public string Notes { get; set; } = "Add notes...";
|
||||
public string Status { get; set; } = StatusType.Fun_Idea;
|
||||
public string Priority { get; set; } = PriorityType.Medium;
|
||||
public string Task { get; set; } = TaskType.Feature;
|
||||
|
||||
public string Project { get; set; }
|
||||
|
||||
public DateTime? Created { get; set; } = null;
|
||||
public DateTime? Finished { get; set; } = null;
|
||||
|
||||
public string StatusColor() {
|
||||
return Status == StatusType.Fun_Idea ? "gray"
|
||||
: Status == StatusType.In_Progress ? "#3be330"
|
||||
: Status == StatusType.To_Test ? "cyan"
|
||||
: Status == StatusType.Todo ? "yellow"
|
||||
: Status == StatusType.Done ? "orange"
|
||||
: "white";
|
||||
}
|
||||
|
||||
public static List<string> Statuses(List<TaskModel> Data) {
|
||||
return (from task in Data
|
||||
select task.Status).Distinct().ToList();
|
||||
}
|
||||
|
||||
public static List<string> Projects(List<TaskModel> Data) {
|
||||
return (from task in Data
|
||||
select task.Project).Distinct().ToList();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user