Exemplo n.º 1
0
    public string NodeLoad(string nodeID)
    {
        Coolite.Ext.Web.TreeNodeCollection nodes = new Coolite.Ext.Web.TreeNodeCollection();
        switch (nodeID.Substring(0, 1))
        {
        case "z":
            AddGZRW(nodes, nodeID.Substring(1));
            break;
        }

        string a = nodes.ToJson();

        return(nodes.ToJson());
    }
Exemplo n.º 2
0
        void IHttpHandler.ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/json";
            string nodeId = context.Request["node"];

            if (!string.IsNullOrEmpty(nodeId))
            {
                Coolite.Ext.Web.TreeNodeCollection nodes = new Coolite.Ext.Web.TreeNodeCollection(false);

                DataTable dt = logic.category.getByParent(Convert.ToInt32(nodeId));

                foreach (DataRow dr in dt.Rows)
                {

                    Coolite.Ext.Web.TreeNode node = new Coolite.Ext.Web.TreeNode();
                    node.Text = dr["name"].ToString();
                    node.NodeID = dr["categoryId"].ToString();

                    if (dr["treelevel"].ToString() == "1")
                    {
                        node.Leaf = true;
                        node.Href = "javascript:getList(" + dr["categoryId"].ToString() + ");";
                    }
                    nodes.Add(node);
                }

                context.Response.Write(nodes.ToJson());
                context.Response.End();
            }
        }
Exemplo n.º 3
0
        public void RaiseAjaxPostBackEvent(string eventArgument, ParameterCollection extraParams)
        {
            bool               success = true;
            string             msg     = null;
            TreeNodeCollection nodes   = null;

            try
            {
                if (string.IsNullOrEmpty(eventArgument))
                {
                    throw new ArgumentNullException("eventArgument");
                }

                switch (eventArgument)
                {
                case "nodeload":
                    NodeLoadEventArgs e      = new NodeLoadEventArgs(extraParams);
                    PageTreeLoader    loader = (PageTreeLoader)this.Loader.Primary;
                    loader.OnNodeLoad(e);
                    nodes   = e.Nodes;
                    success = e.Success;
                    msg     = e.ErrorMessage;
                    break;
                }
            }
            catch (Exception ex)
            {
                success = false;
                msg     = this.IsDebugging ? ex.ToString() : ex.Message;
                if (this.ScriptManager.RethrowAjaxExceptions)
                {
                    throw;
                }
            }

            AfterAjaxEventArgs eAjaxPostBackResult = new AfterAjaxEventArgs(new Response(success, msg));

            eAjaxPostBackResult.Response.Data = nodes != null?nodes.ToJson() : null;

            ScriptManager.ServiceResponse = eAjaxPostBackResult.Response;
        }
Exemplo n.º 4
0
    public string NodeLoad(string nodeID)
    {
        Coolite.Ext.Web.TreeNodeCollection nodes = new Coolite.Ext.Web.TreeNodeCollection();
        var dm = dc.SqsDomain.Where(p => p.Fid == decimal.Parse(nodeID));

        foreach (var r in dm)
        {
            //Coolite.Ext.Web.TreeNode asyncNode = new Coolite.Ext.Web.TreeNode();
            AsyncTreeNode asyncNode = new AsyncTreeNode();
            asyncNode.Text   = r.Dname;
            asyncNode.NodeID = r.Did.ToString();
            asyncNode.Qtip   = "满分分值:" + r.Fullscore.ToString() + ",系数:" + r.Rate.ToString();
            if (dc.SqsDomain.Count(p => p.Fid == r.Did) == 0)
            {
                asyncNode.Listeners.Click.Handler = string.Format("Coolite.AjaxMethods.GVLoad({0});", r.Did.ToString());
                asyncNode.Leaf = true;
            }
            nodes.Add(asyncNode);
        }
        return(nodes.ToJson());
    }
Exemplo n.º 5
0
 public string RefreshMenu()
 {
     Coolite.Ext.Web.TreeNodeCollection nodes = LoadTree(tpkind.Root);
     return(nodes.ToJson());
 }
Exemplo n.º 6
0
 public string NodeLoad(string nodeID)
 {
     Coolite.Ext.Web.TreeNodeCollection nodes = new Coolite.Ext.Web.TreeNodeCollection();
     AddDeptandPerson(nodes, nodeID);
     return(nodes.ToJson());
 }
Exemplo n.º 7
0
 public string NodeLoadYh(string nodeID, string TypeId)
 {
     Coolite.Ext.Web.TreeNodeCollection nodes = new Coolite.Ext.Web.TreeNodeCollection();
     AddYh(nodes, decimal.Parse(nodeID), decimal.Parse(TypeId));
     return(nodes.ToJson());
 }