Beispiel #1
0
        /// <summary>
        /// 取cateto类别树
        /// </summary>
        /// <returns>json</returns>
        private string getCateTo()
        {
            string treeStr  = "";
            string catelang = IRequest.GetQueryString("catelang");
            int    catefrom = IRequest.GetQueryInt("catefrom", 0);

            if (catelang == string.Empty)
            {
                catelang = "cn";
            }
            using (ISession session = dbContext.Current().GetContext("SqlDb").GetSession())
            {
                string    fromSql = "select  Cate_Module from [dcms_cate] where cate_id=" + catefrom;
                DataTable fromDt  = session.GetTable(fromSql);
                string    Sql     = "";
                if (fromDt.Rows.Count > 0)
                {
                    Sql = "select Cate_Id,Cate_Title,Cate_Module,Cate_ManageUrl,Cate_ParentID,Cate_HasChild from [Dcms_Cate] where Cate_Lang='" + catelang + "' and cate_module='" + fromDt.Rows[0]["Cate_Module"].ToString() + "' order by [Cate_Order] asc";
                }
                else
                {
                    Sql = "select Cate_Id,Cate_Title,Cate_Module,Cate_ManageUrl,Cate_ParentID,Cate_HasChild from [Dcms_Cate] where Cate_Lang='" + catelang + "' order by [Cate_Order] asc";
                }
                DataTable cateDt = session.GetTable(Sql);
                if (cateDt.Rows.Count > 0)
                {
                    parentSelectTree pTree = new parentSelectTree();
                    treeStr = pTree.CreateTree(cateDt);
                }
            }
            return(treeStr);
        }
Beispiel #2
0
        /// <summary>
        /// 取左栏类别树
        /// </summary>
        /// <returns>json</returns>
        private string doSelect()
        {
            string treeStr  = "";
            string langFlag = Convert.ToString(Utils.GetCookie("LangFlag"));

            using (ISession session = dbContext.Current().GetContext("SqlDb").GetSession())
            {
                string    Sql    = "select Cate_Id,Cate_Title,Cate_Module,Cate_ManageUrl,Cate_ParentID,Cate_HasChild from [Dcms_Cate] where Cate_Lang='" + langFlag + "' order by [Cate_Order] asc";
                DataTable cateDt = session.GetTable(Sql);
                //if (cateDt.Rows.Count > 0)
                //{
                cateMangeTree jTree = new cateMangeTree();
                treeStr = jTree.CreateTree(cateDt);
                parentSelectTree pTree = new parentSelectTree();
                treeStr = treeStr + "$|&|$" + pTree.CreateTree(cateDt);
                //}
            }
            return(treeStr);
        }
Beispiel #3
0
        /// <summary>
        /// 取catefrom类别树
        /// </summary>
        /// <returns>json</returns>
        private string getCateFrom()
        {
            string treeStr  = "";
            string catelang = IRequest.GetQueryString("catelang");

            if (catelang == string.Empty)
            {
                catelang = "cn";
            }
            using (ISession session = dbContext.Current().GetContext("SqlDb").GetSession())
            {
                string    Sql    = "select Cate_Id,Cate_Title,Cate_Module,Cate_ManageUrl,Cate_ParentID,Cate_HasChild from [Dcms_Cate] where Cate_Lang='" + catelang + "' order by [Cate_Order] asc";
                DataTable cateDt = session.GetTable(Sql);
                if (cateDt.Rows.Count > 0)
                {
                    parentSelectTree pTree = new parentSelectTree();
                    treeStr = pTree.CreateTree(cateDt);
                }
            }
            return(treeStr);
        }
Beispiel #4
0
 /// <summary>
 /// 取左栏类别树
 /// </summary>
 /// <returns>json</returns>
 private string doSelect()
 {
     string treeStr = "";
     string langFlag = Convert.ToString(Utils.GetCookie("LangFlag"));
     using (ISession session = dbContext.Current().GetContext("SqlDb").GetSession())
     {
         string Sql = "select Cate_Id,Cate_Title,Cate_Module,Cate_ManageUrl,Cate_ParentID,Cate_HasChild from [Dcms_Cate] where Cate_Lang='" + langFlag + "' order by [Cate_Order] asc";
         DataTable cateDt = session.GetTable(Sql);
         //if (cateDt.Rows.Count > 0)
         //{
         cateMangeTree jTree = new cateMangeTree();
         treeStr = jTree.CreateTree(cateDt);
         parentSelectTree pTree = new parentSelectTree();
         treeStr = treeStr + "$|&|$" + pTree.CreateTree(cateDt);
         //}
     }
     return treeStr;
 }
Beispiel #5
0
        /// <summary>
        /// 取cateto类别树
        /// </summary>
        /// <returns>json</returns>
        private string getCateTo()
        {
            string treeStr = "";
            string catelang = IRequest.GetQueryString("catelang");
            int catefrom = IRequest.GetQueryInt("catefrom", 0);

            if (catelang == string.Empty)
            {
                catelang = "cn";
            }
            using (ISession session = dbContext.Current().GetContext("SqlDb").GetSession())
            {
                string fromSql = "select  Cate_Module from [dcms_cate] where cate_id=" + catefrom;
                DataTable fromDt = session.GetTable(fromSql);
                string Sql = "";
                if (fromDt.Rows.Count > 0)
                {
                    Sql = "select Cate_Id,Cate_Title,Cate_Module,Cate_ManageUrl,Cate_ParentID,Cate_HasChild from [Dcms_Cate] where Cate_Lang='" + catelang + "' and cate_module='" + fromDt.Rows[0]["Cate_Module"].ToString() + "' order by [Cate_Order] asc";

                }
                else
                {
                    Sql = "select Cate_Id,Cate_Title,Cate_Module,Cate_ManageUrl,Cate_ParentID,Cate_HasChild from [Dcms_Cate] where Cate_Lang='" + catelang + "' order by [Cate_Order] asc";
                }
                DataTable cateDt = session.GetTable(Sql);
                if (cateDt.Rows.Count > 0)
                {
                    parentSelectTree pTree = new parentSelectTree();
                    treeStr = pTree.CreateTree(cateDt);
                }
            }
            return treeStr;
        }
Beispiel #6
0
        /// <summary>
        /// 取catefrom类别树
        /// </summary>
        /// <returns>json</returns>
        private string getCateFrom()
        {
            string treeStr = "";
            string catelang = IRequest.GetQueryString("catelang");
            if (catelang == string.Empty)
            {
                catelang = "cn";
            }
            using (ISession session = dbContext.Current().GetContext("SqlDb").GetSession())
            {

                string Sql = "select Cate_Id,Cate_Title,Cate_Module,Cate_ManageUrl,Cate_ParentID,Cate_HasChild from [Dcms_Cate] where Cate_Lang='"+catelang+"' order by [Cate_Order] asc";
                DataTable cateDt = session.GetTable(Sql);
                if (cateDt.Rows.Count > 0)
                {
                    parentSelectTree pTree = new parentSelectTree();
                    treeStr =pTree.CreateTree(cateDt);
                }
            }
            return treeStr;
        }