Esempio n. 1
0
        public ActionResult CreateOneToMany(string id)
        {
            if (!Services.Authorizer.Authorize(Permissions.PublishContent, T("Not allowed to edit a content.")))
            {
                return(new HttpUnauthorizedResult());
            }

            if (!_contentMetadataService.CheckEntityPublished(id))
            {
                return(Content(T("The \"{0}\" hasn't been published!", id).Text));
            }

            return(View(new OneToManyRelationshipModel {
                EntityList = _relationshipService.GetEntityNames(id),
                PrimaryEntity = id,
                IsCreate = true,
                DeleteOption = OneToManyDeleteOption.CascadingDelete,
                Fields = new List <SelectListItem>()
            }));
        }