예제 #1
0
        public ResourceStructureAttributeModel(ResourceStructureAttribute attribute)
        {
            AttributeId          = attribute.Id;
            AttributeName        = attribute.Name;
            AttributeDescription = attribute.Description;


            foreach (Constraint constraint in attribute.Constraints)
            {
                if (constraint is DomainConstraint)
                {
                    DomainConstraint dc = (DomainConstraint)constraint;
                    dc.Materialize();
                    DomainConstraint = new DomainConstraintModel(dc);
                }
            }
        }
예제 #2
0
        public TextValueModel(TextValue value)
        {
            Id         = value.Id;
            Value      = value.Value;
            ResourceId = value.Resource.Id;
            ResourceAttributeUsageId = value.ResourceAttributeUsage.Id;
            ResourceAttributeUsage   = new ResourceAttributeUsageModel(value.ResourceAttributeUsage);
            AttributeName            = value.ResourceAttributeUsage.ResourceStructureAttribute.Name;

            foreach (Constraint constraint in value.ResourceAttributeUsage.ResourceStructureAttribute.Constraints)
            {
                if (constraint is DomainConstraint)
                {
                    DomainConstraint dc = (DomainConstraint)constraint;
                    dc.Materialize();
                    DomainConstraint = new DomainConstraintModel(dc);
                }
            }
        }
예제 #3
0
        public ResourceStructureAttributeModel()
        {
            AttributeId          = 0;
            AttributeName        = "";
            AttributeDescription = "";
            rsID         = 0;
            InUse        = false;
            EditAccess   = false;
            DeleteAccess = false;

            //Constraints = new List<Constraint>();

            //
            DomainConstraint = new DomainConstraintModel();
            //DomainItem i = new DomainItem();
            //i.Key = "";
            //i.Value = "";
            //DomainConstraint.Items.Add(new DomainItemModel(i));
        }
        public ResourceStructureAttributeUsageModel(long usageId, long resourceAttributeId, string parentName)
        {
            UsageId             = usageId;
            ResourceAttributeId = resourceAttributeId;

            //set Parent if exsits
            if (parentName != null)
            {
                ParentAttributeName = parentName;
            }
            else
            {
                ParentAttributeName = "";
            }

            using (ResourceStructureAttributeManager rsaManager = new ResourceStructureAttributeManager())
            {
                ResourceAttributeUsage usage = rsaManager.GetResourceAttributeUsageById(usageId);

                IsValueOptional = usage.IsValueOptional;
                IsFileDataType  = usage.IsFileDataType;

                RS.ResourceStructureAttribute attr = rsaManager.GetResourceStructureAttributesById(resourceAttributeId);

                foreach (Constraint constraint in attr.Constraints)
                {
                    if (constraint is DomainConstraint)
                    {
                        DomainConstraint dc = (DomainConstraint)constraint;
                        dc.Materialize();
                        DomainConstraint = new DomainConstraintModel(dc);
                    }
                }

                ResourceAttributeName        = attr.Name;
                ResourceAttributeDescription = attr.Description;
            }
        }
예제 #5
0
 public TextValueModel()
 {
     DomainConstraint = new DomainConstraintModel();
 }