Skip to content

Commit 53e0ac8

Browse files
changes
1 parent 8dcc6f0 commit 53e0ac8

File tree

2 files changed

+61
-54
lines changed

2 files changed

+61
-54
lines changed

Javascript url adaptor/RemoteSave/Controllers/HomeController.cs

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.Linq;
44
using System.Web;
55
using System.Web.Mvc;
6-
using url.Models;
76
using RemoteSave.Models;
87
using Syncfusion.EJ2.Base;
98
using System.Collections;
@@ -112,56 +111,4 @@ public class ICRUDModel
112111
public string action;
113112
}
114113
}
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+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Web;
5+
6+
namespace RemoteSave.Models
7+
{
8+
public class TreeData
9+
{
10+
public static List<TreeData> tree = new List<TreeData>();
11+
[System.ComponentModel.DataAnnotations.Key]
12+
public int TaskID { get; set; }
13+
public string TaskName { get; set; }
14+
public DateTime StartDate { get; set; }
15+
public DateTime EndDate { get; set; }
16+
public String Progress { get; set; }
17+
public String Priority { get; set; }
18+
public int Duration { get; set; }
19+
public int? ParentItem { get; set; }
20+
public bool? isParent { get; set; }
21+
public TreeData() { }
22+
public static List<TreeData> GetTree()
23+
{
24+
if (tree.Count == 0)
25+
{
26+
int root = -1;
27+
for (var t = 1; t <= 5; t++)
28+
{
29+
Random ran = new Random();
30+
string math = (ran.Next() % 3) == 0 ? "High" : (ran.Next() % 2) == 0 ? "Release Breaker" : "Critical";
31+
string progr = (ran.Next() % 3) == 0 ? "Started" : (ran.Next() % 2) == 0 ? "Open" : "In Progress";
32+
root++;
33+
int rootItem = tree.Count + root + 1;
34+
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) });
35+
int parent = tree.Count;
36+
for (var c = 0; c < 3; c++)
37+
{
38+
root++;
39+
string val = ((parent + c + 1) % 3 == 0) ? "Low" : "Critical";
40+
int parn = parent + c + 1;
41+
progr = (ran.Next() % 3) == 0 ? "In Progress" : (ran.Next() % 2) == 0 ? "Open" : "Validated";
42+
int iD = tree.Count + root + 1;
43+
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) });
44+
if ((((parent + c + 1) % 2) == 0))
45+
{
46+
int immParent = tree.Count;
47+
for (var s = 0; s < 2; s++)
48+
{
49+
root++;
50+
string Prior = (immParent % 2 == 0) ? "Validated" : "Normal";
51+
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) });
52+
}
53+
}
54+
}
55+
}
56+
}
57+
return tree;
58+
}
59+
}
60+
}

0 commit comments

Comments
 (0)