Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            KM_KNMA objVal1  = new KM_KNMA();
            KM_KNMA objCond2 = new KM_KNMA();
            objCond2.P_KNMA_ID = "0";
            objVal1.OrderBy(KM_KNMA.Attribute.SORT_NO, Order.Asc);
            List <KM_KNMA> lstChnl = BLLTable <KM_KNMA> .Factory(conn).Select(objVal1, objCond2);

            StringBuilder sb = new StringBuilder();
            if (lstChnl.Count > 0)
            {
                sb.Append("<li data=\"{id:'0',pid:'0',sc:0,name:'知识管理',ntype:'root'}\"><div><b><em></em></b><a>知识管理</a></div>");
                sb.Append("<ul>");
                for (int i = 0; i < lstChnl.Count; i++)
                {
                    StringBuilder sbData = new StringBuilder();
                    string        licls  = "";
                    if (i == lstChnl.Count - 1)
                    {
                        licls = "last";
                    }
                    decimal subcount = 1;// lstChnl[i].SUB_NUM;
                    if (subcount == 0)
                    {
                        if (licls != "")
                        {
                            licls += " ";
                        }
                        licls += "leaf";
                    }
                    if (licls != "")
                    {
                        licls = " class='" + licls + "'";
                    }

                    sbData.Append("{id:'").Append(lstChnl[i].KNMA_ID.ToString());
                    sbData.Append("',pid:'").Append(lstChnl[i].P_KNMA_ID).Append("',no:").Append(lstChnl[i].SORT_NO.ToString());
                    sbData.Append(",sc:").Append(subcount.ToString());
                    sbData.Append(",name:'").Append(lstChnl[i].KNMA_NAME).Append("',ntype:'knode'}");

                    sb.Append("<li data=\"" + sbData.ToString() + "\"><div><b><em></em></b><a href='#'>" + lstChnl[i].KNMA_NAME + "</a></div></li>");
                }
                sb.Append("</ul></li>");
            }
            else
            {
                sb.Append("<li data=\"{id:'0',pid:'0',sc:0,name:'知识管理',ntype:'root'}\"><div><b><em></em></b><a>知识管理</a></div></li>");
            }
            litChnl.Text = sb.ToString();
        }
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            KM_KNMA objVal1 = new KM_KNMA();
            KM_KNMA objCond2 = new KM_KNMA();
            objCond2.P_KNMA_ID = "0";
            objVal1.OrderBy(KM_KNMA.Attribute.SORT_NO, Order.Asc);
            List<KM_KNMA> lstChnl = BLLTable<KM_KNMA>.Factory(conn).Select(objVal1, objCond2);
            StringBuilder sb = new StringBuilder();
            if (lstChnl.Count > 0)
            {
                sb.Append("<li id=\"root_0\" data=\"{id:'0',pid:'0',sc:0,name:'֪ʶ����',ntype:''}\" class=\"root\" exp='2'><div class=\"opened root\"><b></b><em></em><a href=\"#\">֪ʶ����</a><a href='DeptManage.aspx'>ˢ��</a></div>");
                sb.Append("<ul>");
                for (int i = 0; i < lstChnl.Count; i++)
                {
                    StringBuilder sbData = new StringBuilder();
                    string licls = "";
                    if (i == lstChnl.Count - 1)
                    {
                        licls = "last";
                    }
                    decimal subcount = 1;// lstChnl[i].SUB_NUM;
                    if (subcount == 0)
                    {
                        if (licls != "") { licls += " "; }
                        licls += "leaf";
                    }
                    if (licls != "") { licls = " class='" + licls + "'"; }

                    sbData.Append("{id:'").Append(lstChnl[i].KNMA_ID.ToString());
                    sbData.Append("',pid:'").Append(lstChnl[i].P_KNMA_ID).Append("',no:").Append(lstChnl[i].SORT_NO.ToString());
                    sbData.Append(",sc:").Append(subcount.ToString());
                    sbData.Append(",name:'").Append(lstChnl[i].KNMA_ID).Append("',ntype:'org'}");

                    sb.Append("<li " + licls + " id='node_" + lstChnl[i].KNMA_ID + "' data=\"" + sbData.ToString() + "\"><div><b></b><em class='node_org'></em><a href='#'>" + lstChnl[i].KNMA_NAME + "</a></div></li>");
                }
                sb.Append("</ul></li>");
            }
            else
            {
                sb.Append("<li id=\"root_0\" data=\"{id:'0',pid:'0',sc:0,name:'֪ʶ����',ntype:''}\" class=\"root\"><div class='root'><b></b><em></em><a href=\"#\">֪ʶ����</a><a href='DeptManage.aspx'>ˢ��</a></div></li>");

            }
            litChnl.Text = sb.ToString();

        }
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            UserBaseExd userExd = new UserBaseExd(userBase);

            //显示子节点
            if (Request["getSubNodes"] != null)
            {
                string        nodetype = Request["ntype"];
                StringBuilder sb       = new StringBuilder("[");
                string        pid      = Request["id"];//orgid/deptid/taskid
                //if (nodetype == "root" || nodetype == "")
                //{
                #region
                KM_KNMA obj = new KM_KNMA();
                KM_KNMA val = new KM_KNMA();
                obj.P_KNMA_ID = pid;
                val.OrderBy(KM_KNMA.Attribute.SORT_NO, Order.Asc);
                List <KM_KNMA> lst = BLLTable <KM_KNMA> .Factory(conn).Select(val, obj);

                if (lst.Count != null)
                {
                    for (int i = 0; i < lst.Count; i++)
                    {
                        if (sb.Length > 2)
                        {
                            sb.Append(",");
                        }
                        decimal subcount = 1;
                        sb.Append("{id:'").Append(lst[i].KNMA_ID);
                        sb.Append("',pid:'").Append(lst[i].P_KNMA_ID.ToString()).Append("',no:").Append(lst[i].SORT_NO);
                        sb.Append(",sc:").Append(subcount.ToString());
                        sb.Append(",name:'").Append(lst[i].KNMA_NAME).Append("',ntype:'knode'}");
                    }
                }
                #endregion
                //}
                sb.Append("]");
                Response.Write(sb.ToString());
            }
            Response.End();
        }
    }
Ejemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            UserBaseExd userExd = new UserBaseExd(userBase);

            //显示子节点
            if (Request["getSubNodes"] != null)
            {
                string nodetype = Request["ntype"];
                StringBuilder sb = new StringBuilder("[");
                string pid = Request["id"];//orgid/deptid/taskid
                //if (nodetype == "root" || nodetype == "")
                //{
                    #region
                    KM_KNMA obj = new KM_KNMA();
                    KM_KNMA val = new KM_KNMA();
                    obj.P_KNMA_ID = pid;
                    val.OrderBy(KM_KNMA.Attribute.SORT_NO, Order.Asc);
                    List<KM_KNMA> lst = BLLTable<KM_KNMA>.Factory(conn).Select(val, obj);
                    if (lst.Count != null)
                    {
                        for (int i = 0; i < lst.Count; i++)
                        {
                            if (sb.Length > 2)
                            {
                                sb.Append(",");
                            }
                            decimal subcount = 1;
                            sb.Append("{id:'").Append(lst[i].KNMA_ID);
                            sb.Append("',pid:'").Append(lst[i].P_KNMA_ID.ToString()).Append("',no:").Append(lst[i].SORT_NO);
                            sb.Append(",sc:").Append(subcount.ToString());
                            sb.Append(",name:'").Append(lst[i].KNMA_NAME).Append("',ntype:'knode'}");
                        }
                    }
                    #endregion
                //}
                sb.Append("]");
                Response.Write(sb.ToString());
            }
            Response.End();
        }
    }