Exemplo n.º 1
0
        public JsonResult DeleteNodes(string Ids)
        {
            Action action = () =>
            {
                var nodeIDs = Ids.Split(',');
                foreach (var id in nodeIDs)
                {
                    var node = this.GetDataDicByID(this.TableName, id);
                    if (node == null)
                    {
                        continue;
                    }
                    var subjectNode = new S_EP_DefineSubject(node);
                    subjectNode.Delete();
                }
            };

            this.ExecuteAction(action);
            return(Json(""));
        }
Exemplo n.º 2
0
        public JsonResult AddNode(string NodeID, string AddMode)
        {
            var    result = new Dictionary <string, object>();
            Action action = () =>
            {
                var node = this.GetDataDicByID(this.TableName, NodeID);
                if (node == null)
                {
                    throw new Formula.Exceptions.BusinessValidationException("没有找到ID为【" + NodeID + "】的科目信息,无法新增科目");
                }
                var subjectNode = new S_EP_DefineSubject(node);
                if (AddMode.ToLower() == "after")
                {
                    result = subjectNode.AddBrotherNode().ModelDic;
                }
                else
                {
                    result = subjectNode.AddChildNode().ModelDic;
                }
            };

            this.ExecuteAction(action);
            return(Json(result));
        }