示例#1
0
        /// <summary>
        /// Gets the component lineup view component.
        /// </summary>
        /// <param name="parentComponentId">The parent component identifier.</param>
        /// <param name="componentBeingEditedId">The component being edited identifier.</param>
        /// <returns></returns>
        public IActionResult GetComponentLineupViewComponent(int parentComponentId, int componentBeingEditedId = 0)
        {
            // the Ajax request will sent the ComponentId of the desired Parent Component when a component is being created
            List <ComponentPositionLineupItem> components = unitOfWork.Components.GetComponentLineupItemsForComponent(parentComponentId);

            if (componentBeingEditedId == 0)
            {
                ComponentLineupViewComponentViewModel vm = new ComponentLineupViewComponentViewModel(components);
                return(ViewComponent("ComponentLineup", vm));
            }
            else
            {
                Component componentToEdit = unitOfWork.Components.Get(componentBeingEditedId);
                ComponentLineupViewComponentViewModel vm = new ComponentLineupViewComponentViewModel(components, componentToEdit);
                return(ViewComponent("ComponentLineup", vm));
            }
        }
 public IViewComponentResult Invoke(ComponentLineupViewComponentViewModel vm)
 {
     return(View(vm));
 }