Ejemplo n.º 1
0
        public void LoadViewComponents(IComponentView view)
        {
            List <string> comp = new List <string>();

            comp.Add(view.CoreComponent);
            foreach (ComponentRelation vc in view.ComponentRelations)
            {
                if (view.CoreComponent != vc.ComponentID)
                {
                    comp.Add(vc.ComponentID);
                }
                if (view.CoreComponent != vc.ChildComponentID)
                {
                    comp.Add(vc.ChildComponentID);
                }
            }
            var ViewAttributes = CompExtention.ComponentManager.GetComponentAttributes(string.Join(",", comp.ToArray()), ClientID, new CompExtention.DataAccess.ComponentDataHandler(Connection));

            view.Components = CompExtention.DataAccess.ComponentDataHandler.GetComponents(string.Join(",", comp.ToArray()), Connection);

            foreach (Component c in view.Components)
            {
                var att = ViewAttributes.Where(x => x.ComponentID == c.ID).ToList();
                c.Attributes = att;
            }
        }
 protected ComponModel(
     List <string> valueNames,
     List <Type> valueTypes,
     IComponentView view
     )
 {
     ValueNames = valueNames;
     ValueTypes = valueTypes;
     View       = view;
     ViewModel  = View.ViewModel;
 }
Ejemplo n.º 3
0
 public bool UpdateView(IComponentView view)
 {
     Builder.Data.ComponentViewBuilder cv = new Builder.Data.ComponentViewBuilder(this.Connection);
     cv.RemoveViewSchema(view.ID);
     if (cv.UpdateView(view.ID, view.Name, view.CoreComponent, view.Category) == true)
     {
         foreach (ComponentRelation vc in view.ComponentRelations)
         {
             cv.SaveViewSchema(view.ID, vc.ComponentID, vc.ChildComponentID);
             foreach (ViewRelation vr in vc.Relationship)
             {
                 cv.SaveViewSchemaRelation(view.ID, vr.Left, vr.LeftField, vr.Right, vr.RightField);
             }
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
 public ComponTransformModel(List <string> valueNames, List <Type> valueTypes, IComponentView view) : base(
         valueNames, valueTypes, view)
 {
 }