From 15ebc954299cb888ae08a54e7ed806345f3b0caa Mon Sep 17 00:00:00 2001 From: Nithya Date: Thu, 7 Aug 2025 15:18:11 +0530 Subject: [PATCH] 974081: Getting Started correction in asp.net core platform --- .../cellEditing/cellEditing.cs | 42 +++- .../getting-started/cellEditing/tagHelper | 13 +- .../definingColumns/definingColumns.cs | 118 +++------ .../getting-started/definingColumns/tagHelper | 86 +------ .../dependencyEditing/dependencyEditing.cs | 123 +++------- .../dependencyEditing/tagHelper | 83 +------ .../dialogEditing/dialogEditing.cs | 40 +++ .../enableDependency/enableDependency.cs | 45 +++- .../enableDependency/tagHelper | 10 +- .../exception-handling/definingColumns.cs | 115 +++------ .../exception-handling/tagHelper | 17 +- .../getting-started/filtering/filtering.cs | 45 +++- .../gantt/getting-started/filtering/tagHelper | 11 +- .../gantt/getting-started/gantt/gantt.cs | 118 +++------ .../gantt/getting-started/gantt/tagHelper | 77 +----- .../mappingFields/mappingFields.cs | 118 +++------ .../getting-started/mappingFields/tagHelper | 77 +----- .../gantt/getting-started/sorting/sorting.cs | 45 +++- .../gantt/getting-started/sorting/tagHelper | 11 +- .../getting-started/taskbarEditing/tagHelper | 13 +- .../taskbarEditing/taskbarEditing.cs | 44 +++- .../assignResource/assignResource.cs | 217 ++++------------ .../gantt/resources/assignResource/tagHelper | 168 +------------ .../gantt/EJ2_ASP.NETCORE/getting-started.md | 232 ++++++++---------- .../gantt/images/error-handling.png | Bin 12826 -> 61471 bytes .../gantt/images/gantt-cell-editing.png | Bin 25436 -> 44768 bytes .../gantt/images/gantt-column.png | Bin 19554 -> 74233 bytes .../gantt/images/gantt-control.png | Bin 19414 -> 74165 bytes .../gantt/images/gantt-dependency-editing.png | Bin 0 -> 74742 bytes .../gantt/images/gantt-filter.png | Bin 24726 -> 102013 bytes .../gantt/images/gantt-resources.png | Bin 23200 -> 89618 bytes ej2-asp-core-mvc/gantt/images/gantt-sort.png | Bin 18497 -> 75457 bytes .../gantt/images/gantt-taskbar-editing.png | Bin 19441 -> 52199 bytes 33 files changed, 638 insertions(+), 1230 deletions(-) create mode 100644 ej2-asp-core-mvc/gantt/images/gantt-dependency-editing.png diff --git a/ej2-asp-core-mvc/code-snippet/gantt/getting-started/cellEditing/cellEditing.cs b/ej2-asp-core-mvc/code-snippet/gantt/getting-started/cellEditing/cellEditing.cs index eec9005cde..04ff81a912 100644 --- a/ej2-asp-core-mvc/code-snippet/gantt/getting-started/cellEditing/cellEditing.cs +++ b/ej2-asp-core-mvc/code-snippet/gantt/getting-started/cellEditing/cellEditing.cs @@ -1,5 +1,41 @@ -public IActionResult Index() +using Microsoft.AspNetCore.Mvc; + +namespace WebApplication.Controllers { - ViewBag.DataSource = GanttData.ProjectNewData(); - return View(); + public class HomeController : Controller + { + public IActionResult Index() + { + ViewBag.DataSource = ganttData(); + return View(); + } + + public static List ganttData() + { + List data = new List + { + new GanttDataSource { TaskID = 1, TaskName = "Project Initiation", StartDate = new DateTime(2019, 4, 2), EndDate = new DateTime(2019, 4, 21) }, + new GanttDataSource { TaskID = 2, TaskName = "Identify Site location", StartDate = new DateTime(2019, 4, 2), Duration = 4, Progress = 50, ParentId = 1 }, + new GanttDataSource { TaskID = 3, TaskName = "Perform Soil test", StartDate = new DateTime(2019, 4, 2), Duration = 4, Progress = 50, ParentId = 1 }, + new GanttDataSource { TaskID = 4, TaskName = "Soil test approval", StartDate = new DateTime(2019, 4, 2), Duration = 4, Progress = 50, ParentId = 1 }, + new GanttDataSource { TaskID = 5, TaskName = "Project Estimation", StartDate = new DateTime(2019, 4, 2), EndDate = new DateTime(2019, 4, 21) }, + new GanttDataSource { TaskID = 6, TaskName = "Develop floor plan for estimation", StartDate = new DateTime(2019, 4, 4), Duration = 3, Progress = 50, ParentId = 5 }, + new GanttDataSource { TaskID = 7, TaskName = "List materials", StartDate = new DateTime(2019, 4, 4), Duration = 3, Progress = 50, ParentId = 5 }, + new GanttDataSource { TaskID = 8, TaskName = "Estimation approval", StartDate = new DateTime(2019, 4, 4), Duration = 3, Progress = 50, ParentId = 5 } + }; + + return data; + } + } + + public class GanttDataSource + { + public int TaskID { get; set; } + public string? TaskName { get; set; } + public DateTime StartDate { get; set; } + public DateTime? EndDate { get; set; } + public int? Duration { get; set; } + public int? Progress { get; set; } + public int? ParentId { get; set; } + } } \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/gantt/getting-started/cellEditing/tagHelper b/ej2-asp-core-mvc/code-snippet/gantt/getting-started/cellEditing/tagHelper index 4eeef1f25f..202263be7c 100644 --- a/ej2-asp-core-mvc/code-snippet/gantt/getting-started/cellEditing/tagHelper +++ b/ej2-asp-core-mvc/code-snippet/gantt/getting-started/cellEditing/tagHelper @@ -1,6 +1,9 @@ - - - - - +@{ + var dataSource = ViewBag.DataSource; +} + + + + + \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/gantt/getting-started/definingColumns/definingColumns.cs b/ej2-asp-core-mvc/code-snippet/gantt/getting-started/definingColumns/definingColumns.cs index 2d23aff639..04ff81a912 100644 --- a/ej2-asp-core-mvc/code-snippet/gantt/getting-started/definingColumns/definingColumns.cs +++ b/ej2-asp-core-mvc/code-snippet/gantt/getting-started/definingColumns/definingColumns.cs @@ -1,91 +1,41 @@ -public IActionResult Index() -{ - ViewBag.DataSource = ganttData(); - return View(); -} +using Microsoft.AspNetCore.Mvc; - public static List ganttData() +namespace WebApplication.Controllers +{ + public class HomeController : Controller + { + public IActionResult Index() { - List GanttDataSourceCollection = new List(); - - GanttDataSource Record1 = new GanttDataSource() - { - TaskId = 1, - TaskName = "Project initiation", - StartDate = new DateTime(2019, 04, 02), - EndDate = new DateTime(2019, 04, 21), - SubTasks = new List(), - }; - GanttDataSource Child1 = new GanttDataSource() - { - TaskId = 2, - TaskName = "Identify site location", - StartDate = new DateTime(2019, 04, 02), - Duration = 4, - Progress = 70, - - }; - GanttDataSource Child2 = new GanttDataSource() - { - TaskId = 3, - TaskName = "Perform soil test", - StartDate = new DateTime(2019, 04, 02), - Duration = 4, - Progress = 50 - - }; - GanttDataSource Child3 = new GanttDataSource() - { - TaskId = 4, - TaskName = "Soil test approval", - StartDate = new DateTime(2019, 04, 02), - Duration = 4, - Progress = 50 - }; - Record1.SubTasks.Add(Child1); - Record1.SubTasks.Add(Child2); - Record1.SubTasks.Add(Child3); + ViewBag.DataSource = ganttData(); + return View(); + } - GanttDataSource Record2 = new GanttDataSource() - { - TaskId = 5, - TaskName = "Project estimation", - StartDate = new DateTime(2019, 04, 02), - EndDate = new DateTime(2019, 04, 21), - SubTasks = new List() - }; - GanttDataSource Child4 = new GanttDataSource() - { - TaskId = 6, - TaskName = "Develop floor plan for estimation", - StartDate = new DateTime(2019, 04, 04), - Duration = 3, - Progress = 70 - }; - GanttDataSource Child5 = new GanttDataSource() + public static List ganttData() + { + List data = new List { - TaskId = 7, - TaskName = "List materials", - StartDate = new DateTime(2019, 04, 04), - Duration = 3, - Progress = 50 + new GanttDataSource { TaskID = 1, TaskName = "Project Initiation", StartDate = new DateTime(2019, 4, 2), EndDate = new DateTime(2019, 4, 21) }, + new GanttDataSource { TaskID = 2, TaskName = "Identify Site location", StartDate = new DateTime(2019, 4, 2), Duration = 4, Progress = 50, ParentId = 1 }, + new GanttDataSource { TaskID = 3, TaskName = "Perform Soil test", StartDate = new DateTime(2019, 4, 2), Duration = 4, Progress = 50, ParentId = 1 }, + new GanttDataSource { TaskID = 4, TaskName = "Soil test approval", StartDate = new DateTime(2019, 4, 2), Duration = 4, Progress = 50, ParentId = 1 }, + new GanttDataSource { TaskID = 5, TaskName = "Project Estimation", StartDate = new DateTime(2019, 4, 2), EndDate = new DateTime(2019, 4, 21) }, + new GanttDataSource { TaskID = 6, TaskName = "Develop floor plan for estimation", StartDate = new DateTime(2019, 4, 4), Duration = 3, Progress = 50, ParentId = 5 }, + new GanttDataSource { TaskID = 7, TaskName = "List materials", StartDate = new DateTime(2019, 4, 4), Duration = 3, Progress = 50, ParentId = 5 }, + new GanttDataSource { TaskID = 8, TaskName = "Estimation approval", StartDate = new DateTime(2019, 4, 4), Duration = 3, Progress = 50, ParentId = 5 } }; - Record2.SubTasks.Add(Child4); - Record2.SubTasks.Add(Child5); - - GanttDataSourceCollection.Add(Record1); - GanttDataSourceCollection.Add(Record2); - return GanttDataSourceCollection; + return data; } - - public class GanttDataSource - { - public int TaskId { get; set; } - public string TaskName { get; set; } - public DateTime StartDate { get; set; } - public DateTime EndDate { get; set; } - public int? Duration { get; set; } - public int Progress { get; set; } - public List SubTasks { get; set; } - } \ No newline at end of file + } + + public class GanttDataSource + { + public int TaskID { get; set; } + public string? TaskName { get; set; } + public DateTime StartDate { get; set; } + public DateTime? EndDate { get; set; } + public int? Duration { get; set; } + public int? Progress { get; set; } + public int? ParentId { get; set; } + } +} \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/gantt/getting-started/definingColumns/tagHelper b/ej2-asp-core-mvc/code-snippet/gantt/getting-started/definingColumns/tagHelper index 047f5a0a27..829a37df59 100644 --- a/ej2-asp-core-mvc/code-snippet/gantt/getting-started/definingColumns/tagHelper +++ b/ej2-asp-core-mvc/code-snippet/gantt/getting-started/definingColumns/tagHelper @@ -1,84 +1,14 @@ @{ - ..... - List GanttDataSourceCollection = new List(); - - GanttDataSource Record1 = new GanttDataSource() - { - TaskId = 1, - TaskName = "Project initiation", - StartDate = new DateTime(2019, 04, 02), - EndDate = new DateTime(2019, 04, 21), - SubTasks = new List(), - }; - GanttDataSource Child1 = new GanttDataSource() - { - TaskId = 2, - TaskName = "Identify site location", - StartDate = new DateTime(2019, 04, 02), - Duration = 4, - Progress = 70, - - }; - GanttDataSource Child2 = new GanttDataSource() - { - TaskId = 3, - TaskName = "Perform soil test", - StartDate = new DateTime(2019, 04, 02), - Duration = 4, - Progress = 50 - - }; - GanttDataSource Child3 = new GanttDataSource() - { - TaskId = 4, - TaskName = "Soil test approval", - StartDate = new DateTime(2019, 04, 02), - Duration = 4, - Progress = 50 - }; - Record1.SubTasks.Add(Child1); - Record1.SubTasks.Add(Child2); - Record1.SubTasks.Add(Child3); - - GanttDataSource Record2 = new GanttDataSource() - { - TaskId = 5, - TaskName = "Project estimation", - StartDate = new DateTime(2019, 04, 02), - EndDate = new DateTime(2019, 04, 21), - SubTasks = new List() - }; - GanttDataSource Child4 = new GanttDataSource() - { - TaskId = 6, - TaskName = "Develop floor plan for estimation", - StartDate = new DateTime(2019, 04, 04), - Duration = 3, - Progress = 70 - }; - GanttDataSource Child5 = new GanttDataSource() - { - TaskId = 7, - TaskName = "List materials", - StartDate = new DateTime(2019, 04, 04), - Duration = 3, - Progress = 50 - }; - Record2.SubTasks.Add(Child4); - Record2.SubTasks.Add(Child5); - - GanttDataSourceCollection.Add(Record1); - GanttDataSourceCollection.Add(Record2); + var dataSource = ViewBag.DataSource; } - - - + + + - - - - - + + + + \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/gantt/getting-started/dependencyEditing/dependencyEditing.cs b/ej2-asp-core-mvc/code-snippet/gantt/getting-started/dependencyEditing/dependencyEditing.cs index 5341c8896b..68fd67fca5 100644 --- a/ej2-asp-core-mvc/code-snippet/gantt/getting-started/dependencyEditing/dependencyEditing.cs +++ b/ej2-asp-core-mvc/code-snippet/gantt/getting-started/dependencyEditing/dependencyEditing.cs @@ -1,95 +1,42 @@ -public IActionResult Index() -{ - ViewBag.DataSource = ganttData(); - return View(); -} +using Microsoft.AspNetCore.Mvc; -public static List ganttData() +namespace WebApplication.Controllers +{ + public class HomeController : Controller + { + public IActionResult Index() { - List GanttDataSourceCollection = new List(); - - GanttDataSource Record1 = new GanttDataSource() - { - TaskId = 1, - TaskName = "Project initiation", - StartDate = new DateTime(2019, 04, 02), - EndDate = new DateTime(2019, 04, 21), - SubTasks = new List(), - }; - GanttDataSource Child1 = new GanttDataSource() - { - TaskId = 2, - TaskName = "Identify site location", - StartDate = new DateTime(2019, 04, 02), - Duration = 4, - Progress = 70, - - }; - GanttDataSource Child2 = new GanttDataSource() - { - TaskId = 3, - TaskName = "Perform soil test", - StartDate = new DateTime(2019, 04, 02), - Duration = 4, - Progress = 50, - Predecessor = "2FS" - - }; - GanttDataSource Child3 = new GanttDataSource() - { - TaskId = 4, - TaskName = "Soil test approval", - StartDate = new DateTime(2019, 04, 02), - Duration = 4, - Progress = 50, - Predecessor="3FS" - }; - Record1.SubTasks.Add(Child1); - Record1.SubTasks.Add(Child2); - Record1.SubTasks.Add(Child3); + ViewBag.DataSource = ganttData(); + return View(); + } - GanttDataSource Record2 = new GanttDataSource() - { - TaskId = 5, - TaskName = "Project estimation", - StartDate = new DateTime(2019, 04, 02), - EndDate = new DateTime(2019, 04, 21), - SubTasks = new List() - }; - GanttDataSource Child4 = new GanttDataSource() - { - TaskId = 6, - TaskName = "Develop floor plan for estimation", - StartDate = new DateTime(2019, 04, 04), - Duration = 3, - Progress = 70 - }; - GanttDataSource Child5 = new GanttDataSource() + public static List ganttData() + { + List data = new List { - TaskId = 7, - TaskName = "List materials", - StartDate = new DateTime(2019, 04, 04), - Duration = 3, - Progress = 50, - Predecessor = "6SS" + new GanttDataSource { TaskID = 1, TaskName = "Project Initiation", StartDate = new DateTime(2019, 4, 2), EndDate = new DateTime(2019, 4, 21) }, + new GanttDataSource { TaskID = 2, TaskName = "Identify Site location", StartDate = new DateTime(2019, 4, 2), Duration = 4, Progress = 50, ParentId = 1 }, + new GanttDataSource { TaskID = 3, TaskName = "Perform Soil test", StartDate = new DateTime(2019, 4, 2), Duration = 4, Progress = 50, ParentId = 1, Predecessor= "2FS" }, + new GanttDataSource { TaskID = 4, TaskName = "Soil test approval", StartDate = new DateTime(2019, 4, 2), Duration = 4, Progress = 50, ParentId = 1 }, + new GanttDataSource { TaskID = 5, TaskName = "Project Estimation", StartDate = new DateTime(2019, 4, 2), EndDate = new DateTime(2019, 4, 21) }, + new GanttDataSource { TaskID = 6, TaskName = "Develop floor plan for estimation", StartDate = new DateTime(2019, 4, 4), Duration = 3, Progress = 50, ParentId = 5 }, + new GanttDataSource { TaskID = 7, TaskName = "List materials", StartDate = new DateTime(2019, 4, 4), Duration = 3, Progress = 50, ParentId = 5 }, + new GanttDataSource { TaskID = 8, TaskName = "Estimation approval", StartDate = new DateTime(2019, 4, 4), Duration = 3, Progress = 50, ParentId = 5, Predecessor= "7SS" } }; - Record2.SubTasks.Add(Child4); - Record2.SubTasks.Add(Child5); - - GanttDataSourceCollection.Add(Record1); - GanttDataSourceCollection.Add(Record2); - return GanttDataSourceCollection; + return data; } - - public class GanttDataSource - { - public int TaskId { get; set; } - public string TaskName { get; set; } - public string Predecessor { get; set; } - public DateTime StartDate { get; set; } - public DateTime EndDate { get; set; } - public int? Duration { get; set; } - public int Progress { get; set; } - public List SubTasks { get; set; } - } \ No newline at end of file + } + + public class GanttDataSource + { + public int TaskID { get; set; } + public string? TaskName { get; set; } + public DateTime StartDate { get; set; } + public DateTime? EndDate { get; set; } + public int? Duration { get; set; } + public int? Progress { get; set; } + public int? ParentId { get; set; } + public string? Predecessor { get; set; } + } +} diff --git a/ej2-asp-core-mvc/code-snippet/gantt/getting-started/dependencyEditing/tagHelper b/ej2-asp-core-mvc/code-snippet/gantt/getting-started/dependencyEditing/tagHelper index 142b93df7f..73e3b619d5 100644 --- a/ej2-asp-core-mvc/code-snippet/gantt/getting-started/dependencyEditing/tagHelper +++ b/ej2-asp-core-mvc/code-snippet/gantt/getting-started/dependencyEditing/tagHelper @@ -1,81 +1,10 @@ @{ - ..... - List GanttDataSourceCollection = new List(); - - GanttDataSource Record1 = new GanttDataSource() - { - TaskId = 1, - TaskName = "Project initiation", - StartDate = new DateTime(2019, 04, 02), - EndDate = new DateTime(2019, 04, 21), - SubTasks = new List(), - }; - GanttDataSource Child1 = new GanttDataSource() - { - TaskId = 2, - TaskName = "Identify site location", - StartDate = new DateTime(2019, 04, 02), - Duration = 4, - Progress = 70, - - }; - GanttDataSource Child2 = new GanttDataSource() - { - TaskId = 3, - TaskName = "Perform soil test", - StartDate = new DateTime(2019, 04, 02), - Duration = 4, - Progress = 50, - Predecessor = "2FS" - - }; - GanttDataSource Child3 = new GanttDataSource() - { - TaskId = 4, - TaskName = "Soil test approval", - StartDate = new DateTime(2019, 04, 02), - Duration = 4, - Progress = 50, - Predecessor="3FS" - }; - Record1.SubTasks.Add(Child1); - Record1.SubTasks.Add(Child2); - Record1.SubTasks.Add(Child3); - - GanttDataSource Record2 = new GanttDataSource() - { - TaskId = 5, - TaskName = "Project estimation", - StartDate = new DateTime(2019, 04, 02), - EndDate = new DateTime(2019, 04, 21), - SubTasks = new List() - }; - GanttDataSource Child4 = new GanttDataSource() - { - TaskId = 6, - TaskName = "Develop floor plan for estimation", - StartDate = new DateTime(2019, 04, 04), - Duration = 3, - Progress = 70 - }; - GanttDataSource Child5 = new GanttDataSource() - { - TaskId = 7, - TaskName = "List materials", - StartDate = new DateTime(2019, 04, 04), - Duration = 3, - Progress = 50, - Predecessor = "6SS" - }; - Record2.SubTasks.Add(Child4); - Record2.SubTasks.Add(Child5); - - GanttDataSourceCollection.Add(Record1); - GanttDataSourceCollection.Add(Record2); + var dataSource = ViewBag.DataSource; } - - - - + + + + + \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/gantt/getting-started/dialogEditing/dialogEditing.cs b/ej2-asp-core-mvc/code-snippet/gantt/getting-started/dialogEditing/dialogEditing.cs index eec9005cde..cdc268c87b 100644 --- a/ej2-asp-core-mvc/code-snippet/gantt/getting-started/dialogEditing/dialogEditing.cs +++ b/ej2-asp-core-mvc/code-snippet/gantt/getting-started/dialogEditing/dialogEditing.cs @@ -2,4 +2,44 @@ public IActionResult Index() { ViewBag.DataSource = GanttData.ProjectNewData(); return View(); +}using Microsoft.AspNetCore.Mvc; + +namespace WebApplication.Controllers +{ + public class HomeController : Controller + { + public IActionResult Index() + { + ViewBag.DataSource = ganttData(); + return View(); + } + + public static List ganttData() + { + List data = new List + { + new GanttDataSource { TaskID = 1, TaskName = "Project Initiation", StartDate = new DateTime(2019, 4, 2), EndDate = new DateTime(2019, 4, 21) }, + new GanttDataSource { TaskID = 2, TaskName = "Identify Site location", StartDate = new DateTime(2019, 4, 2), Duration = 4, Progress = 50, ParentId = 1 }, + new GanttDataSource { TaskID = 3, TaskName = "Perform Soil test", StartDate = new DateTime(2019, 4, 2), Duration = 4, Progress = 50, ParentId = 1 }, + new GanttDataSource { TaskID = 4, TaskName = "Soil test approval", StartDate = new DateTime(2019, 4, 2), Duration = 4, Progress = 50, ParentId = 1 }, + new GanttDataSource { TaskID = 5, TaskName = "Project Estimation", StartDate = new DateTime(2019, 4, 2), EndDate = new DateTime(2019, 4, 21) }, + new GanttDataSource { TaskID = 6, TaskName = "Develop floor plan for estimation", StartDate = new DateTime(2019, 4, 4), Duration = 3, Progress = 50, ParentId = 5 }, + new GanttDataSource { TaskID = 7, TaskName = "List materials", StartDate = new DateTime(2019, 4, 4), Duration = 3, Progress = 50, ParentId = 5 }, + new GanttDataSource { TaskID = 8, TaskName = "Estimation approval", StartDate = new DateTime(2019, 4, 4), Duration = 3, Progress = 50, ParentId = 5 } + }; + + return data; + } + } + + public class GanttDataSource + { + public int TaskID { get; set; } + public string? TaskName { get; set; } + public DateTime StartDate { get; set; } + public DateTime? EndDate { get; set; } + public int? Duration { get; set; } + public int? Progress { get; set; } + public int? ParentId { get; set; } + } } \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/gantt/getting-started/enableDependency/enableDependency.cs b/ej2-asp-core-mvc/code-snippet/gantt/getting-started/enableDependency/enableDependency.cs index eec9005cde..b373fca58d 100644 --- a/ej2-asp-core-mvc/code-snippet/gantt/getting-started/enableDependency/enableDependency.cs +++ b/ej2-asp-core-mvc/code-snippet/gantt/getting-started/enableDependency/enableDependency.cs @@ -1,5 +1,42 @@ -public IActionResult Index() +using Microsoft.AspNetCore.Mvc; + +namespace WebApplication.Controllers { - ViewBag.DataSource = GanttData.ProjectNewData(); - return View(); -} \ No newline at end of file + public class HomeController : Controller + { + public IActionResult Index() + { + ViewBag.DataSource = ganttData(); + return View(); + } + + public static List ganttData() + { + List data = new List + { + new GanttDataSource { TaskID = 1, TaskName = "Project Initiation", StartDate = new DateTime(2019, 4, 2), EndDate = new DateTime(2019, 4, 21) }, + new GanttDataSource { TaskID = 2, TaskName = "Identify Site location", StartDate = new DateTime(2019, 4, 2), Duration = 4, Progress = 50, ParentId = 1 }, + new GanttDataSource { TaskID = 3, TaskName = "Perform Soil test", StartDate = new DateTime(2019, 4, 2), Duration = 4, Progress = 50, ParentId = 1, Predecessor= "2FS" }, + new GanttDataSource { TaskID = 4, TaskName = "Soil test approval", StartDate = new DateTime(2019, 4, 2), Duration = 4, Progress = 50, ParentId = 1 }, + new GanttDataSource { TaskID = 5, TaskName = "Project Estimation", StartDate = new DateTime(2019, 4, 2), EndDate = new DateTime(2019, 4, 21) }, + new GanttDataSource { TaskID = 6, TaskName = "Develop floor plan for estimation", StartDate = new DateTime(2019, 4, 4), Duration = 3, Progress = 50, ParentId = 5 }, + new GanttDataSource { TaskID = 7, TaskName = "List materials", StartDate = new DateTime(2019, 4, 4), Duration = 3, Progress = 50, ParentId = 5 }, + new GanttDataSource { TaskID = 8, TaskName = "Estimation approval", StartDate = new DateTime(2019, 4, 4), Duration = 3, Progress = 50, ParentId = 5, Predecessor= "7SS" } + }; + + return data; + } + } + public class GanttDataSource + { + public int TaskID { get; set; } + public string? TaskName { get; set; } + public DateTime StartDate { get; set; } + public DateTime? EndDate { get; set; } + public int? Duration { get; set; } + public int? Progress { get; set; } + public int? ParentId { get; set; } + public string? Predecessor { get; set; } + } + +} diff --git a/ej2-asp-core-mvc/code-snippet/gantt/getting-started/enableDependency/tagHelper b/ej2-asp-core-mvc/code-snippet/gantt/getting-started/enableDependency/tagHelper index 324c781760..b12ae4e173 100644 --- a/ej2-asp-core-mvc/code-snippet/gantt/getting-started/enableDependency/tagHelper +++ b/ej2-asp-core-mvc/code-snippet/gantt/getting-started/enableDependency/tagHelper @@ -1,4 +1,8 @@ - - - +@{ + var dataSource = ViewBag.DataSource; +} + + + + \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/gantt/getting-started/exception-handling/definingColumns.cs b/ej2-asp-core-mvc/code-snippet/gantt/getting-started/exception-handling/definingColumns.cs index bc4b7d90c5..b373fca58d 100644 --- a/ej2-asp-core-mvc/code-snippet/gantt/getting-started/exception-handling/definingColumns.cs +++ b/ej2-asp-core-mvc/code-snippet/gantt/getting-started/exception-handling/definingColumns.cs @@ -1,89 +1,42 @@ -public IActionResult Index() -{ - ViewBag.DataSource = ganttData(); - return View(); -} +using Microsoft.AspNetCore.Mvc; -public static List ganttData() +namespace WebApplication.Controllers +{ + public class HomeController : Controller + { + public IActionResult Index() { - List GanttDataSourceCollection = new List(); - - GanttDataSource Record1 = new GanttDataSource() - { - TaskId = 1, - TaskName = "Project initiation", - StartDate = new DateTime(2019, 04, 02), - EndDate = new DateTime(2019, 04, 21), - SubTasks = new List() - }; - GanttDataSource Child1 = new GanttDataSource() - { - TaskId = 2, - TaskName = "Identify site location", - StartDate = new DateTime(2019, 04, 02), - Duration = 4, - Progress = 50 - }; - GanttDataSource Child2 = new GanttDataSource() - { - TaskId = 3, - TaskName = "Perform soil test", - StartDate = new DateTime(2019, 04, 02), - Duration = 4, - Progress = 50 - }; - GanttDataSource Child3 = new GanttDataSource() - { - TaskId = 4, - TaskName = "Soil test approval", - StartDate = new DateTime(2019, 04, 02), - Duration = 4, - Progress = 50 - }; - Record1.SubTasks.Add(Child1); - Record1.SubTasks.Add(Child2); - Record1.SubTasks.Add(Child3); + ViewBag.DataSource = ganttData(); + return View(); + } - GanttDataSource Record2 = new GanttDataSource() - { - TaskId = 5, - TaskName = "Project estimation", - StartDate = new DateTime(2019, 04, 02), - EndDate = new DateTime(2019, 04, 21), - SubTasks = new List() - }; - GanttDataSource Child4 = new GanttDataSource() - { - TaskId = 6, - TaskName = "Develop floor plan for estimation", - StartDate = new DateTime(2019, 04, 04), - Duration = 3, - Progress = 50 - }; - GanttDataSource Child5 = new GanttDataSource() + public static List ganttData() + { + List data = new List { - TaskId = 7, - TaskName = "List materials", - StartDate = new DateTime(2019, 04, 04), - Duration = 3, - Progress = 50 + new GanttDataSource { TaskID = 1, TaskName = "Project Initiation", StartDate = new DateTime(2019, 4, 2), EndDate = new DateTime(2019, 4, 21) }, + new GanttDataSource { TaskID = 2, TaskName = "Identify Site location", StartDate = new DateTime(2019, 4, 2), Duration = 4, Progress = 50, ParentId = 1 }, + new GanttDataSource { TaskID = 3, TaskName = "Perform Soil test", StartDate = new DateTime(2019, 4, 2), Duration = 4, Progress = 50, ParentId = 1, Predecessor= "2FS" }, + new GanttDataSource { TaskID = 4, TaskName = "Soil test approval", StartDate = new DateTime(2019, 4, 2), Duration = 4, Progress = 50, ParentId = 1 }, + new GanttDataSource { TaskID = 5, TaskName = "Project Estimation", StartDate = new DateTime(2019, 4, 2), EndDate = new DateTime(2019, 4, 21) }, + new GanttDataSource { TaskID = 6, TaskName = "Develop floor plan for estimation", StartDate = new DateTime(2019, 4, 4), Duration = 3, Progress = 50, ParentId = 5 }, + new GanttDataSource { TaskID = 7, TaskName = "List materials", StartDate = new DateTime(2019, 4, 4), Duration = 3, Progress = 50, ParentId = 5 }, + new GanttDataSource { TaskID = 8, TaskName = "Estimation approval", StartDate = new DateTime(2019, 4, 4), Duration = 3, Progress = 50, ParentId = 5, Predecessor= "7SS" } }; - Record2.SubTasks.Add(Child4); - Record2.SubTasks.Add(Child5); - - GanttDataSourceCollection.Add(Record1); - GanttDataSourceCollection.Add(Record2); - return GanttDataSourceCollection; + return data; } + } + public class GanttDataSource + { + public int TaskID { get; set; } + public string? TaskName { get; set; } + public DateTime StartDate { get; set; } + public DateTime? EndDate { get; set; } + public int? Duration { get; set; } + public int? Progress { get; set; } + public int? ParentId { get; set; } + public string? Predecessor { get; set; } + } - public class GanttDataSource - { - public int TaskId { get; set; } - public string TaskName { get; set; } - public DateTime StartDate { get; set; } - public DateTime EndDate { get; set; } - public int? Duration { get; set; } - public int Progress { get; set; } - public List SubTasks { get; set; } - } \ No newline at end of file +} diff --git a/ej2-asp-core-mvc/code-snippet/gantt/getting-started/exception-handling/tagHelper b/ej2-asp-core-mvc/code-snippet/gantt/getting-started/exception-handling/tagHelper index ea87efd38c..1adc4f249e 100644 --- a/ej2-asp-core-mvc/code-snippet/gantt/getting-started/exception-handling/tagHelper +++ b/ej2-asp-core-mvc/code-snippet/gantt/getting-started/exception-handling/tagHelper @@ -1,14 +1,17 @@ - - +@{ + var dataSource = ViewBag.DataSource; +} + + + - + - - + + +