예제 #1
0
        public virtual ResponseTree <TNode> GetChildNodes(DynamicDictionary data_param, int?parent_id = null, string sort_by = null)
        {
            IEnumerable <TNode>  items = null;
            ResponseTree <TNode> resp  = new ResponseTree <TNode>(false, string.Empty);

            using (DbConnect con = new DbConnect())
            {
                items = HierarchyRepo.GetChildNodes(con, data_param, parent_id, sort_by);
            }
            if (Errors.Count > 0)
            {
                resp.message = "Child nodes data load failed.";
                resp.PushErrors(Errors);
            }
            else
            {
                if (items != null && items.Count() > 0)
                {
                    resp.message = "Child nodes loaded successfully.";
                }
                else
                {
                    resp.message = "Child nodes not found as per search condition";
                }
                resp.children = items;
                resp.success  = true;
            }
            return(resp);
        }
예제 #2
0
 public ConversationPoint(string response, ResponseTree optionTree, UnityEvent onPresentText, UnityEvent onClosedText)
 {
     this.spokenText    = response;
     this.optionTree    = optionTree;
     this.onPresentText = onPresentText;
     this.onClosedText  = onClosedText;
 }
예제 #3
0
        public virtual ResponseTree <TNode> GetTreeNodes(DynamicDictionary data_param, int?start_node_id = null, string sort_by = null)
        {
            IEnumerable <TNode>  items = null;
            ResponseTree <TNode> resp  = new ResponseTree <TNode>(false, string.Empty);

            using (DbConnect con = new DbConnect())
            {
                items = HierarchyRepo.GetTreeNodes(con, data_param, start_node_id, sort_by);
            }
            if (Errors.Count > 0)
            {
                resp.message = "Tree nodes data load failed.";
                resp.PushErrors(Errors);
            }
            else
            {
                List <TNode> tree = new List <TNode>();
                if (items != null && items.Count() > 0)
                {
                    //now prepare the tree data
                    PrepareTreeNodes(items, tree, 0);
                    resp.message = "Tree nodes loaded successfully.";
                }
                else
                {
                    resp.message = "tree nodes not found as per search condition";
                }
                resp.children = tree;
                resp.success  = true;
            }
            return(resp);
        }
예제 #4
0
 public ConversationPoint(string response, ResponseTree optionTree) : this(response, optionTree, new UnityEvent(), new UnityEvent())
 {
 }