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

        if (cbbJctype.SelectedItem.Value == "2")
        {
            var per = from p in dc.Person
                      where p.Visualfield == 3 && (p.Areadeptid == deptid || p.Maindeptid == deptid)
                      select new
            {
                p.Personnumber,
                p.Name,
                Deptname = father.Deptname
            };
            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);
            }
        }
        else
        {
            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 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);
        }
    }
예제 #4
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);
        }
    }
예제 #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
    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);
        }
    }
예제 #7
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);
        }
    }
예제 #8
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);
        }
    }
예제 #9
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);
        }
    }
예제 #10
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;
        }
    }
예제 #11
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());
    }
예제 #12
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;
        }
    }
예제 #13
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);
        }
    }
예제 #14
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;
            }
        }
    }