public UI.ViewDefinition CreateView(UI.ViewDefinition view) { var dalView = DbEditorService.CreateView(Mapper.Map <DAL.Models.View>(view), CurrentUser.Login); if (view.Controls != null) { foreach (var control in view.Controls) { var dalControl = DbEditorService.CreateControl(Mapper.Map <DAL.Models.Control>(control)); dalView.Controls.Add(dalControl); } } var newView = Mapper.Map <UI.ViewDefinition>(dalView); if (view.ChildViews != null) { for (var i = 0; i < view.ChildViews.Count; i++) { var subView = CreateView(view.ChildViews[i]); newView.ChildViews.Add(subView); } } return(newView); }
public UI.ControlDefinition CreateControl(UI.ControlDefinition control) { var dalControl = DbEditorService.CreateControl(Mapper.Map <DAL.Models.Control>(control)); return(Mapper.Map <UI.ControlDefinition>(dalControl)); }