using System;
using System.IO;
using System.Collections.Generic;
using System.Xml;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace MYAPP.Manage.Project.Area
{
    [AjaxPro.AjaxNamespace("AjaxDemo")]
    public partial class view_area : MyApp.Web.UI.UserPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            ComponentArt.Web.UI.TreeViewNode newNode = CreateNode("全部区域", "area_-1", true, "root.gif", "");
            TV_Tree.Nodes.Add(newNode);
        }

        protected override void pl_register_script()
        {
            AjaxPro.Utility.RegisterTypeForAjax(typeof(index));
            base.pl_register_script();
        }

        [AjaxPro.AjaxMethod]
        public MyApp.Components.areanode[] Get_AreaTree()
        {
            return MyApp.Components.Area.Get_AreaTree();
        }

        private ComponentArt.Web.UI.TreeViewNode CreateNode(string name, string id, bool expanded, string imageurl, string navurl)
        {
            ComponentArt.Web.UI.TreeViewNode node = new ComponentArt.Web.UI.TreeViewNode();
            node.Text = name;
            node.NavigateUrl = navurl;
            node.Target = "mainBEFrame";
            node.Value = id.ToString();
            node.ImageUrl = imageurl;
            node.Expanded = expanded;
            return node;
        }
    }
}