Пример #1
0
        public string CreateNode()
        {
            var     json       = HttpContext.Current.Request.Form[0];
            dynamic tmp        = JsonConvert.DeserializeObject(json);
            string  parentid   = tmp.parentid;
            string  nodename   = tmp.nodename;
            string  templateid = tmp.templateid;
            var     fields     = _fieldops.GetInclusiveFieldsOfTemplate(templateid); //templateid should be passed instead of nodeid
            var     node       = _structops.CreateNode(nodename, parentid, templateid, fields);

            return(JsonConvert.SerializeObject(node, Formatting.Indented,
                                               new JsonSerializerSettings
            {
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore
            }));
        }
Пример #2
0
        public ActionResult NodeBrowser(string nodeid)
        {
            var           node     = _nodeop.GetNode(nodeid);
            var           list     = _fieldOperations.GetInclusiveFieldsOfTemplate(node.Id.ToString());
            List <string> htmllist = new List <string>();
            IEnumerable <NodeFieldMap> nodefieldmap = ((IStructureOperations)_nodeop).GetNodeFieldMapData(node.Id.ToString());

            //   foreach (var field in list)
            foreach (var nodefield in nodefieldmap)
            {
                //         htmllist.Add(_fieldOperations.GetRenderedField(field.Id.ToString()));
                htmllist.Add(_fieldOperations.GetRenderedField(nodeid, nodefield.FieldId.ToString(), nodefield.Id.ToString()));
            }
            //.Select(x => x.Id).Cast<string>()
            return(View(model: new NodeBrowserModel()
            {
                fields = htmllist, nodeid = nodeid, templateid = node.TemplateId.ToString()
            }));
        }