Ejemplo n.º 1
0
 public Field DeleteField(Field field)
 {
     if (field == null)
     {
         return(null);
     }
     _fieldrepo.RemoveFieldTemplateRelation(field);
     return(_fieldrepo.DeleteField(field));
 }
Ejemplo n.º 2
0
        public bool DeleteNode(string nodeid)
        {
            bool flag = false;

            switch (DetermineNodeType(new Node {
                Id = new Guid(nodeid)
            }))
            {
            case NodeType.CONTENT_TYPE:
                flag = _currentrepository.DeleteNode(new Node()
                {
                    Id = new Guid(nodeid)
                });
                break;

            case NodeType.TEMPLATE_TYPE:
            {
                var template = new Template()
                {
                    Id = Guid.Parse(nodeid)
                };
                template = _templaterepository.GetTemplate(template);
                foreach (var tmp in template.TemplateFieldMaps)
                {
                    _fieldrepository.RemoveFieldTemplateRelation(tmp);
                    _fieldrepository.DeleteField(new Field()
                        {
                            Id = tmp.FieldId
                        });
                }
                flag = _currentrepository.DeleteNode(new Node()
                    {
                        Id = new Guid(nodeid)
                    });
                _templaterepository.DeleteTemplate(template);
            }
            break;

            case NodeType.MEDIA_TYPE:
                break;

            case NodeType.SYSTEM_TYPE:
                break;

            case NodeType.FIELD_TYPE:
                break;
            }
            return(flag);
        }
Ejemplo n.º 3
0
 public Field RemoveField(int fieldId)
 {
     return(_fieldRepository.DeleteField(fieldId));
 }