private MozaicBootstrapComponent convertAjaxComponentToDbFormat(MozaicBootstrapAjaxComponent c, MozaicBootstrapPage page, MozaicBootstrapComponent parentComponent, int numOrder) { var newComponent = new MozaicBootstrapComponent { ElmId = c.ElmId, Content = c.Content, Tag = c.Tag, UIC = c.UIC, Properties = c.Properties, Attributes = c.Attributes, MozaicBootstrapPage = page, NumOrder = numOrder }; if (c.ChildComponents != null && c.ChildComponents.Count > 0) { int childNumOrder = 0; newComponent.ChildComponents = new List <MozaicBootstrapComponent>(); foreach (var ajaxChildComponent in c.ChildComponents) { newComponent.ChildComponents.Add(convertAjaxComponentToDbFormat(ajaxChildComponent, page, newComponent, ++childNumOrder)); } } return(newComponent); }
private MozaicBootstrapAjaxComponent convertComponentToAjaxFormat(MozaicBootstrapComponent c) { var ajaxComponent = new MozaicBootstrapAjaxComponent { Id = c.Id, ElmId = c.ElmId ?? "", Tag = c.Tag, UIC = c.UIC, Attributes = c.Attributes ?? "", Content = c.Content, Properties = c.Properties ?? "", ChildComponents = new List <MozaicBootstrapAjaxComponent>() }; if (c.ChildComponents.Count > 0) { foreach (var childComponent in c.ChildComponents) { ajaxComponent.ChildComponents.Add(convertComponentToAjaxFormat(childComponent)); } } return(ajaxComponent); }