Exemplo n.º 1
0
 public CreateTemplateCode CreatePropertyTemplate(Guid uid, string name, string description, string key,
                                                  PropertyTemplateType propertyType, Guid nodeTemplate, string groupd, bool isVisible, bool isReadonly, string meta,
                                                  object defaultValue, int groupOrder, int order, PropertyConstraint constraint,
                                                  PropertyConstraintLevel constraintLevel, string constraintMeta = "")
 {
     throw new NotImplementedException();
 }
 public CreateTemplateCode CreatePropertyConstraint(Guid constraintId, string name, string descrption,
                                                    PropertyConstraint constraintType, PropertyConstraintLevel level, Guid propertyTemplate)
 {
     return(CreateTemplateCode.Updated);
 }
        public CreateTemplateCode CreatePropertyConstraint(Guid constraintId, string name, string descrption,
                                                           PropertyConstraint constraintType, PropertyConstraintLevel level, Guid propertyTemplate)
        {
            var retValue   = CreateTemplateCode.Updated;
            var constraint = Db.PropertyTemplateConstraints.SingleOrDefault(p => p.ObjId == constraintId);

            bool isNewObject = false;

            if (constraint == null)
            {
                isNewObject      = true;
                constraint       = new PropertyTemplateConstraint();
                constraint.ObjId = constraintId;
                retValue         = CreateTemplateCode.Created;
            }

            constraint.Name                  = name;
            constraint.Description           = descrption;
            constraint.ConstraintType        = (long)constraintType;
            constraint.This2PropertyTemplate = propertyTemplate;
            constraint.ConstraintLevel       = (long)level;

            if (isNewObject)
            {
                Db.PropertyTemplateConstraints.Add(constraint);
            }
            else
            {
                Db.PropertyTemplateConstraints.Update(constraint);
            }
            return(retValue);
        }
Exemplo n.º 4
0
 public CreateTemplateCode CreatePropertyConstraint(Guid constraintId, string name, string descrption,
                                                    PropertyConstraint constraintType, PropertyConstraintLevel level, Guid propertyTemplate)
 {
     throw new NotImplementedException();
 }
        public CreateTemplateCode CreatePropertyConstraint(Guid constraintId, string name, string descrption, PropertyConstraint constraintType, PropertyConstraintLevel level, Guid propertyTemplate)
        {
            var constraint = new PropertyTemplateConstraint
            {
                ObjId                 = constraintId,
                Name                  = name,
                Description           = descrption,
                ConstraintType        = (long)constraintType,
                This2PropertyTemplate = propertyTemplate,
                ConstraintLevel       = (long)level
            };



            _propertyConstraintTemplates.Add(constraintId, constraint);

            return(CreateTemplateCode.Created);
        }