Пример #1
0
    private void AddDeptandPerson(Coolite.Ext.Web.TreeNodeCollection nodes, string deptid)
    {
        var father = dc.Department.First(p => p.Deptnumber == deptid);

        var per = (from p in dc.Person
                   from v in dc.Vgetpl
                   where p.Personnumber == v.Personnumber && p.Areadeptid == deptid && v.Operatortag == "YH_fcfk" && v.Moduletag == "HiddenDanage_HDprocess"
                   select new
        {
            p.Personnumber,
            p.Name,
            Deptname = father.Deptname
        }).Distinct();

        foreach (var r in per)
        {
            Coolite.Ext.Web.TreeNode asyncNode = new Coolite.Ext.Web.TreeNode();
            asyncNode.Text   = r.Name;
            asyncNode.NodeID = r.Personnumber;
            asyncNode.Icon   = Icon.User;
            asyncNode.CustomAttributes.Add(new ConfigItem("data", r.Deptname, ParameterMode.Value));
            asyncNode.Listeners.DblClick.Handler = string.Format("PersonSelector.add({0},{1});", "GridPanel3", "[new Ext.data.Record({Personnumber:'" + r.Personnumber + "',Name:'" + r.Name + "',Deptname:'" + r.Deptname + "'})]");
            asyncNode.Leaf = true;
            nodes.Add(asyncNode);
        }
    }
Пример #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();
            }
        }
Пример #3
0
    private void AddYh(Coolite.Ext.Web.TreeNodeCollection nodes, decimal LevelId, decimal TypeId)
    {
        var data = from yh in dc.Yhbase
                   where  yh.Levelid == LevelId && yh.Typeid == TypeId
                   select new
        {
            yh.Yhid,
            yh.Yhnumber,
            yh.Yhcontent
        };

        foreach (var r in data)
        {
            Coolite.Ext.Web.TreeNode asyncNode = new Coolite.Ext.Web.TreeNode();
            asyncNode.Text   = r.Yhcontent;//"["+r.Yhnumber+"]"
            asyncNode.Qtip   = r.Yhcontent;
            asyncNode.NodeID = r.Yhid.ToString();
            //asyncNode.Icon = Icon.User;
            //asyncNode.CustomAttributes.Add(new ConfigItem("Type", r.Typename, ParameterMode.Value));
            //asyncNode.CustomAttributes.Add(new ConfigItem("Level", r.Levelname, ParameterMode.Value));
            asyncNode.Listeners.Click.Handler = "Coolite.AjaxMethods.LoadYh2Haz(" + r.Yhid.ToString() + ",1)";
            //asyncNode.Listeners.DblClick.Handler = string.Format("PersonSelector.add({0},{1});", "GridPanel3", "[new Ext.data.Record({Personnumber:'" + r.Personnumber + "',Name:'" + r.Name + "',Deptname:'" + r.Deptname + "'})]");
            asyncNode.Leaf = true;
            nodes.Add(asyncNode);
        }
    }
Пример #4
0
    private void AddPlace(Coolite.Ext.Web.TreeNodeCollection nodes, string deptid)
    {
        var father = dc.Placeareas.First(p => p.Pareasid == decimal.Parse(deptid));

        var per = from p in dc.Place
                  where p.Pareasid == decimal.Parse(deptid) && p.Maindeptid == father.Maindeptid && p.Placestatus == 1//所有有效地点
                  select new
        {
            p.Placeid,
            p.Placename,
            father.Pareasname
        };

        foreach (var r in per)
        {
            Coolite.Ext.Web.TreeNode asyncNode = new Coolite.Ext.Web.TreeNode();
            asyncNode.Text   = r.Placename;
            asyncNode.NodeID = r.Placeid.ToString();
            asyncNode.Icon   = Icon.House;
            asyncNode.CustomAttributes.Add(new ConfigItem("data", r.Pareasname, ParameterMode.Value));
            asyncNode.Listeners.DblClick.Handler = string.Format("PersonSelector.add({0},{1});", "GridPanel2", "[new Ext.data.Record({Placeid:'" + r.Placeid + "',Placename:'" + r.Placename + "',Pareasname:'" + r.Pareasname + "',Zdcs:1})]");
            asyncNode.Leaf = true;
            nodes.Add(asyncNode);
        }
    }
Пример #5
0
    private void AddGZRW(Coolite.Ext.Web.TreeNodeCollection nodes, string pid)
    {
        var gzrw = dc.Worktasks.Where(p => p.Professionalid == decimal.Parse(pid));

        foreach (var r in gzrw)
        {
            AsyncTreeNode asyncNode = new AsyncTreeNode();
            asyncNode.Text   = r.Worktask;
            asyncNode.NodeID = "w" + r.Worktaskid.ToString();
            nodes.Add(asyncNode);
        }
    }
Пример #6
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());
    }
Пример #7
0
    private void AddGX(Coolite.Ext.Web.TreeNodeCollection nodes, string pid)
    {
        var gx = dc.Process.Where(p => p.Worktaskid == decimal.Parse(pid)).OrderBy(p => p.Serialnumber);

        foreach (var r in gx)
        {
            Coolite.Ext.Web.TreeNode asyncNode = new Coolite.Ext.Web.TreeNode();
            asyncNode.Text   = r.Name;
            asyncNode.NodeID = "p" + r.Processid.ToString();
            //asyncNode.Listeners.Click.Handler = string.Format("Coolite.AjaxMethods.GVLoad('{0}','F');", r["PROCESSID"].ToString().Trim());
            //asyncNode.Leaf = true;
            nodes.Add(asyncNode);
        }
    }
Пример #8
0
    private Coolite.Ext.Web.TreeNodeCollection LoadTree(Coolite.Ext.Web.TreeNodeCollection nodes)
    {
        if (nodes == null)
        {
            nodes = new Coolite.Ext.Web.TreeNodeCollection();
        }//根节点为null时

        tpkind.Root.Clear();
        Coolite.Ext.Web.TreeNode root = new Coolite.Ext.Web.TreeNode();
        root.Text   = "-1";
        root.NodeID = "走动部门";
        tpkind.Root.Add(root);
        TreeBuild(root.Nodes, -1);
        return(nodes);
    }
Пример #9
0
    private void AddGZRW(Coolite.Ext.Web.TreeNodeCollection nodes, string p)
    {
        StringBuilder strSql = new StringBuilder();

        strSql.Append(string.Format("select * from worktasks where professionalid={0}", p));

        DataTable dt = OracleHelper.Query(strSql.ToString()).Tables[0];

        foreach (DataRow r in dt.Rows)
        {
            AsyncTreeNode asyncNode = new AsyncTreeNode();
            asyncNode.Text   = r["WORKTASK"].ToString();
            asyncNode.NodeID = "w" + r["WORKTASKID"].ToString();
            nodes.Add(asyncNode);
        }
    }
Пример #10
0
    private void AddHaz(Coolite.Ext.Web.TreeNodeCollection nodes, string pid)
    {
        var gx = dc.Hazards.Where(p => p.Processid == decimal.Parse(pid));

        foreach (var r in gx)
        {
            Coolite.Ext.Web.TreeNode asyncNode = new Coolite.Ext.Web.TreeNode();
            asyncNode.Text   = r.HContent;
            asyncNode.Qtip   = r.HContent;
            asyncNode.NodeID = r.Hazardsid.ToString();
            asyncNode.Listeners.Click.Handler = "Coolite.AjaxMethods.LoadYh2Haz(" + r.Hazardsid.ToString() + ",1)";
            //asyncNode.Listeners.Click.Handler = string.Format("Coolite.AjaxMethods.GVLoad('{0}','F');", r["PROCESSID"].ToString().Trim());
            asyncNode.Leaf = true;
            nodes.Add(asyncNode);
        }
    }
Пример #11
0
    private void AddGX(Coolite.Ext.Web.TreeNodeCollection nodes, string p)
    {
        StringBuilder strSql = new StringBuilder();

        strSql.Append(string.Format("select * from process where WORKTASKID={0} order by SERIALNUMBER", p));

        DataTable dt = OracleHelper.Query(strSql.ToString()).Tables[0];

        foreach (DataRow r in dt.Rows)
        {
            Coolite.Ext.Web.TreeNode asyncNode = new Coolite.Ext.Web.TreeNode();
            asyncNode.Text   = r["NAME"].ToString();
            asyncNode.NodeID = "p" + r["PROCESSID"].ToString();
            asyncNode.Listeners.Click.Handler = string.Format("Coolite.AjaxMethods.GVLoad('{0}','F');", r["PROCESSID"].ToString().Trim());
            asyncNode.Leaf = true;
            nodes.Add(asyncNode);
        }
    }
Пример #12
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());
    }
Пример #13
0
    private void TreeBuild(Coolite.Ext.Web.TreeNodeCollection nodes, decimal pid)
    {
        var dept = from c in dc.Department
                   where c.Visualfield == 3  //视野为3 全局
                   select new
        {
            c.Deptnumber,
            c.Deptname
        };

        foreach (var r in dept)
        {
            Coolite.Ext.Web.TreeNode asyncNode = new Coolite.Ext.Web.TreeNode();
            asyncNode.Text   = r.Deptname;
            asyncNode.NodeID = r.Deptnumber.ToString();

            nodes.Add(asyncNode);
            asyncNode.Listeners.Click.Handler = string.Format("Coolite.AjaxMethods.GVLoad('{0}');", r.Deptnumber.ToString());
            asyncNode.Leaf = true;
        }
    }
Пример #14
0
    private void TreeBuild(Coolite.Ext.Web.TreeNodeCollection nodes, decimal pid)
    {
        var lavel = from c in dc.CsBaseinfoset
                    where c.Fid == int.Parse(PublicMethod.ReadXmlReturnNode("SWJB", this))
                    select new
        {
            c.Infoid,
            c.Infoname
        };

        foreach (var r in lavel)
        {
            Coolite.Ext.Web.TreeNode asyncNode = new Coolite.Ext.Web.TreeNode();
            asyncNode.Text   = r.Infoname;
            asyncNode.NodeID = r.Infoid.ToString();

            nodes.Add(asyncNode);
            asyncNode.Listeners.Click.Handler = string.Format("Coolite.AjaxMethods.GVLoad({0});", r.Infoid.ToString());
            asyncNode.Leaf = true;
        }
    }
Пример #15
0
    private void AddGZRW(Coolite.Ext.Web.TreeNodeCollection nodes, string p)
    {
        StringBuilder strSql = new StringBuilder();

        strSql.Append(string.Format("select * from worktasks where professionalid={0}", p));

        DataTable dt = OracleHelper.Query(strSql.ToString()).Tables[0];

        foreach (DataRow r in dt.Rows)
        {
            //AsyncTreeNode asyncNode = new AsyncTreeNode();
            //asyncNode.Text = r["WORKTASK"].ToString();
            //asyncNode.NodeID = "w" + r["WORKTASKID"].ToString();
            //nodes.Add(asyncNode);
            Coolite.Ext.Web.TreeNode asyncNode = new Coolite.Ext.Web.TreeNode();
            asyncNode.Text   = r["WORKTASK"].ToString();
            asyncNode.NodeID = "w" + r["WORKTASKID"].ToString();
            asyncNode.Listeners.Click.Handler = string.Format("Coolite.AjaxMethods.GVLoad({0});", r["WORKTASKID"].ToString().Trim());
            asyncNode.Leaf = true;
            nodes.Add(asyncNode);
        }
    }
Пример #16
0
    private void TreeBuild(Coolite.Ext.Web.TreeNodeCollection nodes, decimal pid)
    {
        var kind = dc.SqsDomain.Where(p => p.Fid == pid && p.Usingdept == SessionBox.GetUserSession().DeptNumber);

        foreach (var r in kind)
        {
            Coolite.Ext.Web.TreeNode asyncNode = new Coolite.Ext.Web.TreeNode();
            asyncNode.Text   = r.Dname + "(" + r.Fullscore.ToString() + ")";
            asyncNode.NodeID = r.Did.ToString();
            asyncNode.Qtip   = "满分分值:" + r.Fullscore.ToString() + ",系数:" + r.Rate.ToString();

            nodes.Add(asyncNode);
            if (dc.SqsDomain.Where(p => p.Fid == r.Did).Count() > 0)
            {
                TreeBuild(asyncNode.Nodes, r.Did);
            }
            else
            {
                asyncNode.Listeners.Click.Handler = string.Format("Coolite.AjaxMethods.GVLoad({0});", r.Did.ToString());
                asyncNode.Leaf = true;
            }
        }
    }
Пример #17
0
 public string RefreshMenu()
 {
     Coolite.Ext.Web.TreeNodeCollection nodes = LoadTree(tpkind.Root);
     return(nodes.ToJson());
 }
Пример #18
0
    private Coolite.Ext.Web.TreeNodeCollection LoadTree(Coolite.Ext.Web.TreeNodeCollection nodes)
    {
        if (nodes == null)
        {
            nodes = new Coolite.Ext.Web.TreeNodeCollection();
        }//根节点为null时

        tpPerson.Root.Clear();
        Coolite.Ext.Web.TreeNode root = new Coolite.Ext.Web.TreeNode();
        if (cbbJctype.SelectedItem.Value == "2")
        {
            var dept = dc.Department.First(p => p.Deptnumber == "000000000");
            root = new Coolite.Ext.Web.TreeNode(dept.Deptnumber, dept.Deptname, Icon.UserHome);
            tpPerson.Root.Add(root);
            var per = (from d in dc.Department
                       where //d.Deptnumber.Substring(0, 4) == "1303"
                             //&& (d.Deptnumber.Substring(7) == "00" || d.Deptlevel == "正科级")
                             //&&
                       d.Visualfield == 3
                       select new
            {
                d.Deptnumber,
                d.Deptname
            }).OrderBy(p => p.Deptname);
            foreach (var r in per)
            {
                AsyncTreeNode asyncNode = new AsyncTreeNode(r.Deptnumber, r.Deptname);
                asyncNode.Icon = Icon.UserEarth;
                root.Nodes.Add(asyncNode);
            }

            //局端排查人
            var person = from p in dc.Person
                         from d in dc.Department
                         where p.Areadeptid == d.Deptnumber && p.Visualfield == 100//返回空结构
                         select new
            {
                p.Personnumber,
                p.Name,
                d.Deptname
            };
            SelectedStore.DataSource = person;
            SelectedStore.DataBind();
        }
        else
        {
            var dept = dc.Department.First(p => p.Deptnumber == SessionBox.GetUserSession().DeptNumber);
            root = new Coolite.Ext.Web.TreeNode(dept.Deptnumber, dept.Deptname, Icon.UserHome);
            tpPerson.Root.Add(root);
            var per = (from v in dc.Vgetpl
                       where v.Operatortag == "YH_fcfk" && v.Moduletag == "HiddenDanage_HDprocess" && v.Unitid == SessionBox.GetUserSession().DeptNumber
                       select new
            {
                v.Deptnumber,
                v.Deptname
            }).Distinct().OrderBy(p => p.Deptname);
            foreach (var r in per)
            {
                AsyncTreeNode asyncNode = new AsyncTreeNode(r.Deptnumber, r.Deptname);
                asyncNode.Icon = Icon.UserEarth;
                root.Nodes.Add(asyncNode);
            }

            //排查人初始绑定
            var person = (from pl in dc.Vgetpl
                          where pl.Moduletag == "YSNewProcess_YHProcess" && pl.Operatortag == "YH_fcfk" && pl.Unitid == SessionBox.GetUserSession().DeptNumber &&
                          pl.Personnumber == SessionBox.GetUserSession().PersonNumber
                          select new
            {
                pl.Personnumber,
                pl.Name,
                pl.Deptname
            }).Distinct();
            if (person.Where(p => p.Personnumber == SessionBox.GetUserSession().PersonNumber).Count() > 0)
            {
                cbbPerson.SelectedItem.Value = SessionBox.GetUserSession().PersonNumber;
                var person1 = person.Where(p => p.Personnumber == SessionBox.GetUserSession().PersonNumber);
                SelectedStore.DataSource = person1;
                SelectedStore.DataBind();
            }
        }

        return(nodes);
    }
Пример #19
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());
 }
Пример #20
0
 public string NodeLoad(string nodeID)
 {
     Coolite.Ext.Web.TreeNodeCollection nodes = new Coolite.Ext.Web.TreeNodeCollection();
     AddDeptandPerson(nodes, nodeID);
     return(nodes.ToJson());
 }