예제 #1
0
        //
        // GET: /VA005/Tree/
        public ActionResult GetTreeAsString(bool editable)
        {
            Ctx ctx         = Session["ctx"] as Ctx;
            int AD_Table_ID = MTable.Get_Table_ID("M_Product");
            var sql         = "SELECT AD_Tree_ID FROM AD_Tree "
                              + "WHERE AD_Client_ID=" + ctx.GetAD_Client_ID() + " AND AD_Table_ID=" + AD_Table_ID + " AND IsActive='Y' AND IsAllNodes='Y' "
                              + "ORDER BY IsDefault DESC, AD_Tree_ID";

            int AD_Tree_ID = Util.GetValueOfInt(DB.ExecuteScalar(sql, null, null));

            List <SetTree> html = new List <SetTree>();

            if (Session["ctx"] != null)
            {
                var            m           = new VA005_ProductHelper(Session["ctx"] as Ctx);
                var            tree        = m.GetMenuTree(AD_Tree_ID, editable, true, 0);
                List <SetTree> setttreeobj = new List <SetTree>();
                SetTree        trees       = new SetTree();
                trees.AD_Tree_ID = AD_Tree_ID;
                setttreeobj.Add(trees);
                html = m.GetMenuTreeUI(trees, tree.GetRootNode(), tree.GetNodeTableName());
                //  html = m.GetMenuTreeUI(tree.GetRootNode(), @Url.Content("~/"), windowNo.ToString(), tree.GetNodeTableName());
                //m.dispose();
            }
            return(Json(JsonConvert.SerializeObject(html), JsonRequestBehavior.AllowGet));
        }
예제 #2
0
 public void Reload(string path)
 {
     if (SetTree != null)
     {
         bool is_cash = SetTree.IsCashSet;
         SetTree.IsCashSet = false;
         SetTree.Load();
         SetTree.IsCashSet = is_cash;
     }
     TreeV.Nodes.Clear();
     TreeV.Fill(SetTree, null);
     TreeNode[] nodes = _TreeV.Nodes.Find(path, true);
     if (nodes.Length > 0)
     {
         _TreeV.SelectedNode = nodes[0];
     }
 }