public ActionResult Save(SectionGroup group) { if (!ModelState.IsValid) { return(View("Form", group)); } if (group.ActionType == ActionType.Create) { _sectionGroupService.Add(group); } else { _sectionGroupService.Update(group); } ViewBag.Close = true; return(View("Form", group)); }
public override void Add(Models.SectionWidget item) { base.Add(item); if (item.Groups != null && item.Groups.Any()) { item.Groups.Each(m => { m.SectionWidgetId = item.ID; _sectionGroupService.Add(m); }); } }
public override ServiceResult <Models.SectionWidget> Add(Models.SectionWidget item) { var result = base.Add(item); if (result.HasViolation) { return(result); } if (item.Groups != null && item.Groups.Any()) { item.Groups.Each(m => { m.SectionWidgetId = item.ID; _sectionGroupService.Add(m); }); } return(result); }