Ejemplo n.º 1
0
        public ActionResult ListTask(int Id)
        {
            var list = Services.New.List();


            list.AddRange(_taskService.GetTask(VersionOptions.Latest).Where(ta => ta.ParentTaskId == Id)//.Where(ta => ta.ParentTaskId == Id)
                          .Select(t =>
            {
                var task = Services.ContentManager.BuildDisplay(t, "SummaryAdmin");
                return(task);
            }));
            dynamic viewModel = Services.New.ViewModel()
                                .ContentItems(list)
                                .parentId(Id);

            // Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation.
            return(View((object)viewModel));
        }
Ejemplo n.º 2
0
        protected override DriverResult Display(ProjectPart part, string displayType, dynamic shapeHelper)
        {
            IEnumerable <TaskMgmtPart> projTasks = _projTasks.Get(VersionOptions.Latest).Where(x => x.Id == part.Id);
            IEnumerable <TaskMgmtPart> task      = _projTasks.GetTask(VersionOptions.Latest).Where(x => x.ProjectId == part.Id).OrderBy(x => x.Task_Level);
            var tasks     = projTasks.Concat((task));
            var jsonTasks = ProjectManagementTaskJson(tasks);

            // var json = new JavaScriptSerializer().Serialize(_taskPartVM);
            return(Combined(
                       ContentShape("Parts_ProjectPart",
                                    () => shapeHelper.Parts_TaskPart(jsonData: jsonTasks)),
                       ContentShape("Parts_ProjectPart_ProjectPart_SummaryAdmin",
                                    () => shapeHelper.Parts_TaskPart_TaskPart_SummaryAdmin())
                       ));
        }
Ejemplo n.º 3
0
 protected override DriverResult Editor(TaskPart part, dynamic shapeHelper)
 {
     part.Tasks = _projTasks.GetTask(VersionOptions.Latest).Where(t => t.ProjectId == part.ProjectId && t.Level == part.Level && t.Id != part.Id);
     return(ContentShape("Parts_TaskPart_Edit",
                         () => shapeHelper.EditorTemplate(TemplateName: "Parts/TaskPart", Model: part, Prefix: Prefix)));
 }