Exemple #1
0
        public ActionResult AddNode()
        {
            if (!SiteConfig.YPage.UserCanNode)
            {
                function.WriteErrMsg("不允许自建栏目!"); return(Content(""));
            }
            M_Templata model = new M_Templata()
            {
                IsTrue = 1
            };
            string op     = "添加";
            string menu   = Request["menu"] ?? "";
            int    tempID = DataConverter.CLng(Request["ID"]);

            if (menu.ToLower().Equals("edit") && tempID >= 0)
            {
                op    = "修改";
                model = tempBll.Getbyid(tempID) ?? new M_Templata();
            }
            DataTable nodes = nodeBll.Sel();

            ViewBag.ClassNode = GetNodeList(nodes);
            ViewBag.op        = op;
            return(View(model));
        }
Exemple #2
0
        public void MyBind(string skey = "")
        {
            DataTable dt = nodeBll.Sel(0, skey);

            dt.DefaultView.RowFilter = "NodeBySite>0";
            RPT.DataSource           = dt.DefaultView.ToTable();
            RPT.DataBind();
        }
        //节点权限
        public void NodeDPBind()
        {
            M_AdminInfo adminMod = new M_AdminInfo();
            DataTable   nodedt   = nodeBll.Sel();

            if (!adminMod.IsSuperAdmin())
            {
                DataTable dt  = roleBll.SelectNodeRoleName(adminMod.NodeRole);
                string    ids = "";
                foreach (DataRow dr in dt.Rows)
                {
                    ids += dr["NodeID"] + ",";
                }
                ids = ids.TrimEnd(',');
                if (!string.IsNullOrEmpty(ids))
                {
                    nodedt.DefaultView.RowFilter = "NodeID in(" + ids + ")";
                    nodedt = nodedt.DefaultView.ToTable();
                }
            }
            BindItem(nodedt);
        }