|
3 | 3 | using System.Linq; |
4 | 4 | using System.Web; |
5 | 5 | using System.Web.Mvc; |
6 | | -using url.Models; |
7 | 6 | using RemoteSave.Models; |
8 | 7 | using Syncfusion.EJ2.Base; |
9 | 8 | using System.Collections; |
@@ -112,56 +111,4 @@ public class ICRUDModel |
112 | 111 | public string action; |
113 | 112 | } |
114 | 113 | } |
115 | | - public class TreeData |
116 | | - { |
117 | | - public static List<TreeData> tree = new List<TreeData>(); |
118 | | - [System.ComponentModel.DataAnnotations.Key] |
119 | | - public int TaskID { get; set; } |
120 | | - public string TaskName { get; set; } |
121 | | - public DateTime StartDate { get; set; } |
122 | | - public DateTime EndDate { get; set; } |
123 | | - public String Progress { get; set; } |
124 | | - public String Priority { get; set; } |
125 | | - public int Duration { get; set; } |
126 | | - public int? ParentItem { get; set; } |
127 | | - public bool? isParent { get; set; } |
128 | | - public TreeData() { } |
129 | | - public static List<TreeData> GetTree() |
130 | | - { |
131 | | - if (tree.Count == 0) |
132 | | - { |
133 | | - int root = -1; |
134 | | - for (var t = 1; t <= 5; t++) |
135 | | - { |
136 | | - Random ran = new Random(); |
137 | | - string math = (ran.Next() % 3) == 0 ? "High" : (ran.Next() % 2) == 0 ? "Release Breaker" : "Critical"; |
138 | | - string progr = (ran.Next() % 3) == 0 ? "Started" : (ran.Next() % 2) == 0 ? "Open" : "In Progress"; |
139 | | - root++; |
140 | | - int rootItem = tree.Count + root + 1; |
141 | | - tree.Add(new TreeData() { TaskID = rootItem, TaskName = "Parent Task " + rootItem.ToString(), StartDate = new DateTime(1992, 06, 07), EndDate = new DateTime(1994, 08, 25), isParent = true, ParentItem = null, Progress = progr, Priority = math, Duration = (ran.Next(1, 50) * 5) }); |
142 | | - int parent = tree.Count; |
143 | | - for (var c = 0; c < 3; c++) |
144 | | - { |
145 | | - root++; |
146 | | - string val = ((parent + c + 1) % 3 == 0) ? "Low" : "Critical"; |
147 | | - int parn = parent + c + 1; |
148 | | - progr = (ran.Next() % 3) == 0 ? "In Progress" : (ran.Next() % 2) == 0 ? "Open" : "Validated"; |
149 | | - int iD = tree.Count + root + 1; |
150 | | - tree.Add(new TreeData() { TaskID = iD, TaskName = "Child Task " + iD.ToString(), StartDate = new DateTime(1992, 06, 07), EndDate = new DateTime(1994, 08, 25), isParent = false, ParentItem = rootItem, Progress = progr, Priority = val, Duration = ran.Next(1, 50) }); |
151 | | - if ((((parent + c + 1) % 2) == 0)) |
152 | | - { |
153 | | - int immParent = tree.Count; |
154 | | - for (var s = 0; s < 2; s++) |
155 | | - { |
156 | | - root++; |
157 | | - string Prior = (immParent % 2 == 0) ? "Validated" : "Normal"; |
158 | | - tree.Add(new TreeData() { TaskID = tree.Count + root + 1, TaskName = "Sub Task " + (tree.Count + root + 1).ToString(), StartDate = new DateTime(1992, 06, 07), EndDate = new DateTime(1994, 08, 25), isParent = false, ParentItem = iD, Progress = (immParent % 2 == 0) ? "On Progress" : "Closed", Priority = Prior, Duration = ran.Next(1, 50) }); |
159 | | - } |
160 | | - } |
161 | | - } |
162 | | - } |
163 | | - } |
164 | | - return tree; |
165 | | - } |
166 | | - } |
167 | | -} |
| 114 | + } |
0 commit comments