public class DefaultData
{
public string StartDate { get; set; }
public string EndDate { get; set; }
public int TaskID { get; set; }
public string TaskName { get; set; }
public int Duration { get; set; }
public int Progress { get; set; }
public List<DefaultData> SubTasks { get; set; }
public string Predecessors { get; set; }
public List<int> ResourceID { get; set; }
}
public class GanttDefaultData
{
public static List<DefaultData> GetData()
{
List<DefaultData> tasks = new List<DefaultData>();
tasks.Add(new DefaultData()
{
TaskID = 1,
TaskName = "Design",
StartDate = "02/10/2014",
EndDate = "02/14/2014",
Duration = 6,
});
tasks[0].SubTasks = new List<DefaultData>();
tasks[0].SubTasks.Add(new DefaultData()
{
TaskID = 2,
TaskName = "Software Specification",
StartDate = "02/10/2014",
EndDate = "02/12/2014",
Duration = 3,
Progress = 60,
ResourceID = new List<int>() { 2 }
});
tasks[0].SubTasks.Add(new DefaultData()
{
TaskID = 3,
TaskName = "Develop prototype",
StartDate = "02/10/2014",
EndDate = "02/12/2014",
Duration = 3,
Progress = 100,
Predecessors = "2FS",
ResourceID = new List<int>() { 3 }
});
tasks[0].SubTasks.Add(new DefaultData()
{
TaskID = 4,
TaskName = "Get approval from customer",
StartDate = "02/13/2014",
EndDate = "02/14/2014",
Duration = 2,
Progress = 100,
Predecessors = "3FS",
ResourceID = new List<int>() { 1 }
});
tasks[0].SubTasks.Add(new DefaultData()
{
TaskID = 5,
TaskName = "Design complete",
StartDate = "02/14/2014",
EndDate = "02/14/2014",
Duration = 0,
Predecessors = "4FS"
});
return tasks;
}
}
public ActionResult Gannt()
{
#region keep Loging
Keeplog("Gannt View");
#endregion
var DataSource = GanttDefaultData.GetData();
ViewBag.datasource = DataSource;
return View();
}
------------------------------------