private void LoadChild(Modules.Control control) { foreach (MControl item in (MControl.parentID == control.ID).List<MControl>(MControl.level.Asc)) { Modules.Control c = new Modules.Control(); item.MemberCopyTo(c); control.Controls.Add(c); LoadChild(c); } }
public Modules.Control Load(string id) { Modules.Control result = null; MControl control = DBContext.Load<MControl>(id); if (control != null) { result = new Modules.Control(); control.MemberCopyTo(result); LoadChild(result); } return result; }