Exemplo n.º 1
0
        protected void BindClassList(int ClassID)
        {
            string strWhere="";
            Maticsoft.BLL.NewsManage.NewsClass bll = new Maticsoft.BLL.NewsManage.NewsClass();
            Maticsoft.Model.NewsManage.NewsClass model = new Maticsoft.Model.NewsManage.NewsClass();
            model = bll.GetModel(ClassID);
            int parentid = model.ParentId;
            if (parentid != 0)
            {
                model= bll.GetModelByCache(parentid);
                parentid = model.ParentId;
            }
    
            strWhere = "parentid="+model.ClassId;
            DataSet ds = new DataSet();
            ds = bll.GetList(strWhere);
            DataTable dt = ds.Tables[0];
            this.ClassName.InnerHtml = model.ClassDesc;


            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string classname="nav_2";
                   // Ñ¡ÖÐ״̬Ñùʽ
                    if (ClassID.ToString() == dt.Rows[i][0].ToString())
                        classname = "nav_2_on";
                    this.ClassList.InnerHtml += "<li class='" + classname + "'><img src='images/picto_feuilles.gif' align='absmiddle' /><a href='main.aspx?classid=" + dt.Rows[i][0].ToString() + "' >" + dt.Rows[i][1].ToString() + "</a></li>";
                    
                }
            }
        }
Exemplo n.º 2
0
        private void BiudTree()
        {

            Maticsoft.BLL.NewsManage.NewsClass bll = new Maticsoft.BLL.NewsManage.NewsClass();
            DataTable dt;
            dt = bll.GetList("").Tables[0];
            this.dropParent.Items.Clear();
            //加载树
            this.dropParent.Items.Add(new ListItem("顶级目录", "0"));
            DataRow[] drs = dt.Select("ParentId= 0");


            foreach (DataRow r in drs)
            {
                string nodeid = r["ClassId"].ToString();
                string text = r["ClassDesc"].ToString();
                string parentid = r["ParentId"].ToString();
                //				string permissionid=r["PermissionID"].ToString();
                text = "╋" + text;
                this.dropParent.Items.Add(new ListItem(text, nodeid));
                int sonparentid = int.Parse(nodeid);
                string blank = "├";

                BindNode(sonparentid, dt, blank);

            }
            this.dropParent.DataBind();

        }
Exemplo n.º 3
0
        private void BiudTree()
        {
            if (Session["UserInfo"] == null)
            {
                return;
            }

            Maticsoft.BLL.NewsManage.NewsClass bll = new Maticsoft.BLL.NewsManage.NewsClass();
            DataTable dt;

            dt = bll.GetList("").Tables[0];
            this.dropNewsClass.Items.Clear();

            //加载树
            DataRow[] drs = dt.Select("ParentId= 0");

            foreach (DataRow r in drs)
            {
                string nodeid   = r["ClassId"].ToString();
                string text     = r["ClassDesc"].ToString();
                string parentid = r["ParentId"].ToString();
                text = "╋" + text;
                this.dropNewsClass.Items.Add(new ListItem(text, nodeid));
                int    sonparentid = int.Parse(nodeid);
                string blank       = "├";

                BindNode(sonparentid, dt, blank);
            }
            this.dropNewsClass.DataBind();
        }
Exemplo n.º 4
0
        private void BiudTree()
        {
            if (Session["UserInfo"] == null)
            {
                return;
            }

            Maticsoft.BLL.NewsManage.NewsClass bll = new Maticsoft.BLL.NewsManage.NewsClass();
            DataTable dt;
            dt = bll.GetList("").Tables[0];
            this.dropNewsClass.Items.Clear();

            //加载树
            DataRow[] drs = dt.Select("ParentId= 0");

            foreach (DataRow r in drs)
            {
                string nodeid = r["ClassId"].ToString();
                string text = r["ClassDesc"].ToString();
                string parentid = r["ParentId"].ToString();
                text = "╋" + text;
                this.dropNewsClass.Items.Add(new ListItem(text, nodeid));
                int sonparentid = int.Parse(nodeid);
                string blank = "├";

                BindNode(sonparentid, dt, blank);

            }
            this.dropNewsClass.DataBind();

        }
Exemplo n.º 5
0
        private void BiudTree()
        {
            Maticsoft.BLL.NewsManage.NewsClass bll = new Maticsoft.BLL.NewsManage.NewsClass();
            DataTable dt;

            dt = bll.GetList("").Tables[0];
            this.dropParent.Items.Clear();
            //加载树
            this.dropParent.Items.Add(new ListItem("顶级目录", "0"));
            DataRow[] drs = dt.Select("ParentId= 0");


            foreach (DataRow r in drs)
            {
                string nodeid   = r["ClassId"].ToString();
                string text     = r["ClassDesc"].ToString();
                string parentid = r["ParentId"].ToString();
                //				string permissionid=r["PermissionID"].ToString();
                text = "╋" + text;
                this.dropParent.Items.Add(new ListItem(text, nodeid));
                int    sonparentid = int.Parse(nodeid);
                string blank       = "├";

                BindNode(sonparentid, dt, blank);
            }
            this.dropParent.DataBind();
        }
Exemplo n.º 6
0
        private void dataBind(int pageIndex)
        {
            //AccountsPrincipal user = new AccountsPrincipal(Context.User.Identity.Name);
            //if (!user.HasPermissionID(PermId_Add))
            //{
            //    this.Page011.Page_Add = "";
            //}
            //if (!user.HasPermissionID(PermId_Search))
            //{
            //    this.Page011.Page_Search = "";
            //}
            //if (user.HasPermissionID(PermId_Modify))
            //{
            //    grid.Columns[6].Visible = true;
            //}
            //if (user.HasPermissionID(PermId_Delete))
            //{
            //    grid.Columns[7].Visible = true;
            //}

            pageIndex--;
            Maticsoft.BLL.NewsManage.NewsClass bll = new Maticsoft.BLL.NewsManage.NewsClass();
            string strWhere = "";
            if (Session["strWhereNewsClass"] != null && Session["strWhereNewsClass"].ToString() != "")
            {
                strWhere = Session["strWhereNewsClass"].ToString();
            }
            DataSet ds = new DataSet();
            ds = bll.GetList(strWhere);
            grid.DataSource = ds.Tables[0].DefaultView;
            int record_Count = ds.Tables[0].Rows.Count;
            int page_Size = grid.PageSize;
            int totalPages = int.Parse(Math.Ceiling((double)record_Count / page_Size).ToString());
            if (totalPages > 0)
            {
                if ((pageIndex + 1) > totalPages)
                    pageIndex = totalPages - 1;
            }
            else
            {
                pageIndex = 0;
            }
            grid.PageIndex = pageIndex;
            grid.DataBind();
            int page_Count = grid.PageCount;
            int page_Current = pageIndex + 1;

            Page011.Record_Count = record_Count;
            Page011.Page_Count = page_Count;
            Page021.Page_Count = page_Count;

            Page011.Page_Size = page_Size;
            Page021.Page_Size = page_Size;
            Page011.Page_Current = page_Current;
            Page021.Page_Current = page_Current;
        }
Exemplo n.º 7
0
        private void BiudTree()
        {
            //			if(Session["UserInfo"]==null)
            //			{
            //				return ;
            //			}
            //			MoviePrincipal user=new MoviePrincipal(Context.User.Identity.Name);
            //			PowerWeb.Web.Accounts.CS.Bus.User currentUser=(PowerWeb.Web.Accounts.CS.Bus.User)Session["UserInfo"];00
            Maticsoft.BLL.NewsManage.NewsClass bll = new Maticsoft.BLL.NewsManage.NewsClass();
            DataTable dt;
            //			if(user.HasPermissionID(newsmanageid))
            //			{
            //				dt=nc.GetNewsClassList("").Tables[0];
            //			}
            //			else
            //			{
            //				dt=nc.GetNewsClassList(int.Parse(currentUser.DepartmentID)).Tables[0];
            dt = bll.GetList("").Tables[0];
            //			}

            this.dropParent.Items.Clear();
            //¼ÓÔØÊ÷
            this.dropParent.Items.Add(new ListItem("¶¥¼¶Ä¿Â¼", "0"));
            DataRow[] drs = dt.Select("ParentId= 0");


            foreach (DataRow r in drs)
            {
                string nodeid = r["ClassId"].ToString();
                string text = r["ClassDesc"].ToString();
                string parentid = r["ParentId"].ToString();
                //				string permissionid=r["PermissionID"].ToString();
                text = "©ï" + text;
                this.dropParent.Items.Add(new ListItem(text, nodeid));
                int sonparentid = int.Parse(nodeid);
                string blank = "©À";

                BindNode(sonparentid, dt, blank);

            }
            this.dropParent.DataBind();

        }
Exemplo n.º 8
0
        //private void BiudPermTree()
        //{
        //    DataTable tabcategory = PowerWeb.Web.Accounts.CS.Bus.AccountsTool.GetAllCategories().Tables[0];
        //    int rc = tabcategory.Rows.Count;
        //    for (int n = 0; n < rc; n++)
        //    {
        //        string CategoryID = tabcategory.Rows[n]["CategoryID"].ToString();
        //        string CategoryName = tabcategory.Rows[n]["Description"].ToString();
        //        CategoryName = "╋" + CategoryName;
        //        this.listPermission.Items.Add(new ListItem(CategoryName, CategoryID));

        //        DataTable tabforums = PowerWeb.Web.Accounts.CS.Bus.AccountsTool.GetPermissionsByCategory(int.Parse(CategoryID)).Tables[0];
        //        int fc = tabforums.Rows.Count;
        //        for (int m = 0; m < fc; m++)
        //        {
        //            string ForumID = tabforums.Rows[m]["PermissionID"].ToString();
        //            string ForumName = tabforums.Rows[m]["Description"].ToString();
        //            ForumName = "  ├『" + ForumName + "』";
        //            this.listPermission.Items.Add(new ListItem(ForumName, ForumID));
        //        }
        //    }
        //    this.listPermission.DataBind();
        //    this.listPermission.Items.Insert(0, new ListItem("--请选择--", "-1"));
        //}

        #endregion

        #region BiudTree
        private void BiudTree()
        {
            //			if(Session["UserInfo"]==null)
            //			{
            //				return ;
            //			}
            //			MoviePrincipal user=new MoviePrincipal(Context.User.Identity.Name);
            //			PowerWeb.Web.Accounts.CS.Bus.User currentUser=(PowerWeb.Web.Accounts.CS.Bus.User)Session["UserInfo"];00
            Maticsoft.BLL.NewsManage.NewsClass bll = new Maticsoft.BLL.NewsManage.NewsClass();
            DataTable dt;

            //			if(user.HasPermissionID(newsmanageid))
            //			{
            //				dt=nc.GetNewsClassList("").Tables[0];
            //			}
            //			else
            //			{
            //				dt=nc.GetNewsClassList(int.Parse(currentUser.DepartmentID)).Tables[0];
            dt = bll.GetList("").Tables[0];
            //			}

            this.dropParent.Items.Clear();
            //加载树
            this.dropParent.Items.Add(new ListItem("顶级目录", "0"));
            DataRow[] drs = dt.Select("ParentId= 0");


            foreach (DataRow r in drs)
            {
                string nodeid   = r["ClassId"].ToString();
                string text     = r["ClassDesc"].ToString();
                string parentid = r["ParentId"].ToString();
                //				string permissionid=r["PermissionID"].ToString();
                text = "╋" + text;
                this.dropParent.Items.Add(new ListItem(text, nodeid));
                int    sonparentid = int.Parse(nodeid);
                string blank       = "├";

                BindNode(sonparentid, dt, blank);
            }
            this.dropParent.DataBind();
        }
Exemplo n.º 9
0
        protected void BindClassList(int ClassID)
        {
            string strWhere = "";
            Maticsoft.BLL.NewsManage.NewsClass bll = new Maticsoft.BLL.NewsManage.NewsClass();
            Maticsoft.Model.NewsManage.NewsClass model = new Maticsoft.Model.NewsManage.NewsClass();
            model = bll.GetModel(ClassID);
            int parentid = model.ParentId;
            if (parentid != 0)
            {
                model = bll.GetModelByCache(parentid);
                parentid = model.ParentId;
            }

            strWhere = "parentid=" + model.ClassId;
            DataSet ds = new DataSet();
            ds = bll.GetList(strWhere);
            DataTable dt = ds.Tables[0];


        }
Exemplo n.º 10
0
        protected void BindClassList(int ClassID)
        {
            string strWhere = "";

            Maticsoft.BLL.NewsManage.NewsClass   bll   = new Maticsoft.BLL.NewsManage.NewsClass();
            Maticsoft.Model.NewsManage.NewsClass model = new Maticsoft.Model.NewsManage.NewsClass();
            model = bll.GetModel(ClassID);
            int parentid = model.ParentId;

            if (parentid != 0)
            {
                model    = bll.GetModelByCache(parentid);
                parentid = model.ParentId;
            }

            strWhere = "parentid=" + model.ClassId;
            DataSet ds = new DataSet();

            ds = bll.GetList(strWhere);
            DataTable dt = ds.Tables[0];
        }
Exemplo n.º 11
0
        public string GenNavigate(int ClassId)
        {
            Maticsoft.BLL.NewsManage.NewsClass bll = new Maticsoft.BLL.NewsManage.NewsClass();
            string  strWhere = "";
            DataSet ds       = new DataSet();

            ds = bll.GetList(strWhere);
            DataTable dt = ds.Tables[0];

            StringBuilder strNav = new StringBuilder();

            strNav.Append("当前位置:<a href='index.aspx'>首页</a>");
            ArrayList MyArray = new ArrayList();

            //取父级栏目
            string strparentNave = "";

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (dt.Rows[i][0].ToString() == ClassId.ToString())
                {
                    string strParentId = dt.Rows[i][0].ToString();
                    while (strParentId != "0")
                    {
                        strParentId = GenNavigateGetParent(dt, ref strparentNave, strParentId);
                        MyArray.Add(strparentNave);
                    }
                }
            }
            ;
            //生成导航条
            for (int i = MyArray.Count - 1; i >= 0; i--)
            {
                strNav.Append(MyArray[i].ToString());
            }

            return(strNav.ToString());
        }
Exemplo n.º 12
0
        protected void BindClassList(int ClassID)
        {
            string strWhere = "";

            Maticsoft.BLL.NewsManage.NewsClass   bll   = new Maticsoft.BLL.NewsManage.NewsClass();
            Maticsoft.Model.NewsManage.NewsClass model = new Maticsoft.Model.NewsManage.NewsClass();
            model = bll.GetModel(ClassID);
            int parentid = model.ParentId;

            if (parentid != 0)
            {
                model    = bll.GetModelByCache(parentid);
                parentid = model.ParentId;
            }

            strWhere = "parentid=" + model.ClassId;
            DataSet ds = new DataSet();

            ds = bll.GetList(strWhere);
            DataTable dt = ds.Tables[0];

            this.ClassName.InnerHtml = model.ClassDesc;


            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string classname = "nav_2";
                    // Ñ¡ÖÐ״̬Ñùʽ
                    if (ClassID.ToString() == dt.Rows[i][0].ToString())
                    {
                        classname = "nav_2_on";
                    }
                    this.ClassList.InnerHtml += "<li class='" + classname + "'><img src='images/picto_feuilles.gif' align='absmiddle' /><a href='main.aspx?classid=" + dt.Rows[i][0].ToString() + "' >" + dt.Rows[i][1].ToString() + "</a></li>";
                }
            }
        }
Exemplo n.º 13
0
        private void dataBind(int pageIndex)
        {
            //AccountsPrincipal user = new AccountsPrincipal(Context.User.Identity.Name);
            //if (!user.HasPermissionID(PermId_Add))
            //{
            //    this.Page011.Page_Add = "";
            //}
            //if (!user.HasPermissionID(PermId_Search))
            //{
            //    this.Page011.Page_Search = "";
            //}
            //if (user.HasPermissionID(PermId_Modify))
            //{
            //    grid.Columns[6].Visible = true;
            //}
            //if (user.HasPermissionID(PermId_Delete))
            //{
            //    grid.Columns[7].Visible = true;
            //}

            pageIndex--;
            Maticsoft.BLL.NewsManage.NewsClass bll = new Maticsoft.BLL.NewsManage.NewsClass();
            string strWhere = "";

            if (Session["strWhereNewsClass"] != null && Session["strWhereNewsClass"].ToString() != "")
            {
                strWhere = Session["strWhereNewsClass"].ToString();
            }
            DataSet ds = new DataSet();

            ds = bll.GetList(strWhere);
            grid.DataSource = ds.Tables[0].DefaultView;
            int record_Count = ds.Tables[0].Rows.Count;
            int page_Size    = grid.PageSize;
            int totalPages   = int.Parse(Math.Ceiling((double)record_Count / page_Size).ToString());

            if (totalPages > 0)
            {
                if ((pageIndex + 1) > totalPages)
                {
                    pageIndex = totalPages - 1;
                }
            }
            else
            {
                pageIndex = 0;
            }
            grid.PageIndex = pageIndex;
            grid.DataBind();
            int page_Count   = grid.PageCount;
            int page_Current = pageIndex + 1;

            Page011.Record_Count = record_Count;
            Page011.Page_Count   = page_Count;
            Page021.Page_Count   = page_Count;

            Page011.Page_Size    = page_Size;
            Page021.Page_Size    = page_Size;
            Page011.Page_Current = page_Current;
            Page021.Page_Current = page_Current;
        }
Exemplo n.º 14
0
        public string GenNavigate(int ClassId)
        {
            Maticsoft.BLL.NewsManage.NewsClass bll = new Maticsoft.BLL.NewsManage.NewsClass();
            string strWhere = "";
            DataSet ds = new DataSet();
            ds = bll.GetList(strWhere);
            DataTable dt = ds.Tables[0];

            StringBuilder strNav = new StringBuilder();
            strNav.Append("当前位置:<a href='index_12_5.html'>首页</a>");
            ArrayList MyArray = new ArrayList();

            //取父级栏目
            string strparentNave = "";
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (dt.Rows[i][0].ToString() == ClassId.ToString())
                {

                    string strParentId = dt.Rows[i][0].ToString();
                    while (strParentId != "0")
                    {
                        strParentId = GenNavigateGetParent(dt, ref strparentNave, strParentId);
                        MyArray.Add(strparentNave);
                    }
                }
            };
            //生成导航条
            for (int i = MyArray.Count - 1; i >= 0; i--)
            {
                strNav.Append(MyArray[i].ToString());
            }

            return strNav.ToString();
        }