Ejemplo n.º 1
0
        public ActionResult Edit(string Id)
        {
            var group = _sectionGroupService.Get(Id);

            group.ActionType = ActionType.Update;
            return(View("Form", group));
        }
 public ActionResult Create(string sectionWidgetId)
 {
     return(View("Form", new SectionGroup
     {
         SectionWidgetId = sectionWidgetId,
         ActionType = ActionType.Create,
         Order = _sectionGroupService.Get("SectionWidgetId", OperatorType.Equal, sectionWidgetId).Count() + 1
     }));
 }
        public ActionResult Create(string sectionWidgetId)
        {
            var order = _sectionGroupService.Get("SectionWidgetId", OperatorType.Equal, sectionWidgetId).Count() + 1;

            return(View("Form", new SectionGroup
            {
                SectionWidgetId = sectionWidgetId,
                ActionType = ActionType.Create,
                Order = order,
                PartialView = "SectionTemplate.Default",
                GroupName = "组 " + order
            }));
        }
Ejemplo n.º 4
0
        private Models.SectionWidget InitSectionWidget(Models.SectionWidget widget)
        {
            if (widget == null)
            {
                return(null);
            }

            widget.Groups = _sectionGroupService.Get(m => m.SectionWidgetId == widget.ID).OrderBy(m => m.Order).ToList();
            var contents = _sectionContentProviderService.Get(m => m.SectionWidgetId == widget.ID);
            List <SectionContent> filled = new List <SectionContent>();

            contents.AsParallel().Each(content =>
            {
                var contentFull = _sectionContentProviderService.FillContent(content);
                if (contentFull != null)
                {
                    filled.Add(contentFull);
                }
            });

            widget.Groups.Each(m =>
            {
                m.SectionContents = filled.Where(n => n.SectionGroupId == m.ID).OrderBy(c => c.Order).ToList();
            });
            return(widget);
        }
Ejemplo n.º 5
0
        private SectionWidget InitSectionWidget(SectionWidget widget)
        {
            widget.Groups = _sectionGroupService.Get("SectionWidgetId", OperatorType.Equal, widget.ID);
            var contents = _sectionContentProviderService.Get("SectionWidgetId", OperatorType.Equal, widget.ID).ToList();

            for (int i = 0; i < contents.Count; i++)
            {
                contents[i] = _sectionContentProviderService.FillContent(contents[i]);
            }
            widget.Groups.Each(m =>
            {
                m.SectionContents = contents.Where(n => n.SectionGroupId == m.ID);
            });
            return(widget);
        }
        private SectionWidget InitSectionWidget(SectionWidget widget)
        {
            widget.Groups = _sectionGroupService.Get("SectionWidgetId", OperatorType.Equal, widget.ID);
            var contents = _sectionContentProviderService.Get("SectionWidgetId", OperatorType.Equal, widget.ID);
            List <SectionContent> filled = new List <SectionContent>();

            contents.AsParallel().Each(content =>
            {
                filled.Add(_sectionContentProviderService.FillContent(content));
            });

            widget.Groups.Each(m =>
            {
                m.SectionContents = filled.Where(n => n.SectionGroupId == m.ID).ToList();
            });
            return(widget);
        }