protected void Page_Load(object sender, EventArgs e) { Call.HideBread(Master); B_Admin badmin = new B_Admin(); B_ARoleAuth.Check(ZLEnum.Auth.content, "ContentEdit"); B_Spec bll = new B_Spec(); DataTable dt = nodeBll.SelForShowAll(0, true); BindNode(dt); }
protected void Page_Load(object sender, EventArgs e) { B_Admin.CheckIsLogged(); if (!IsPostBack) { //内容,商品,会员 //只显示有数据的第一级父节点 DataTable condt = nodeBll.SelForShowAll(0); condt.DefaultView.RowFilter = "ItemCount>0 AND NodeBySite<1 AND NodeType>0"; condt = condt.DefaultView.ToTable(); condt = condt.DefaultView.ToTable(false, "ItemCount", "NodeName"); data1 = JsonConvert.SerializeObject(condt); //商品 //DataTable prodt = SqlHelper.JoinQuery("A.*,B.NodeName", "(SELECT COUNT(ID) AS ICount,NodeID FROM ZL_Commodities Group BY NodeID)", "ZL_Node", "A.NodeID=B.NodeID"); //data2 = JsonConvert.SerializeObject(prodt); //商品,数量与销量 string prosql = "SELECT Pro.*,Cart.SellCount FROM " + " (SELECT A.*,B.NodeName FROM (SELECT COUNT(ID) AS ProCount,Nodeid FROM ZL_Commodities GROUP BY Nodeid) A LEFT JOIN ZL_Node B ON A.Nodeid=B.NodeID WHERE B.NodeName IS NOT NULL) Pro" + " LEFT JOIN" + " (SELECT COUNT(A.ID) AS SellCount,B.Nodeid FROM ZL_CartPro A LEFT JOIN ZL_Commodities B ON A.ProID=B.ID GROUP BY B.Nodeid) Cart" + " ON Pro.Nodeid=Cart.Nodeid"; DataTable prodt = SqlHelper.ExecuteTable(prosql); DataRow dr = prodt.NewRow(); dr["NodeName"] = "总计"; dr["ProCount"] = prodt.Compute("SUM(ProCount)", ""); dr["SellCount"] = prodt.Compute("SUM(SellCount)", ""); prodt.Rows.Add(dr); data2 = JsonConvert.SerializeObject(prodt); //内芯 DataTable userdt1 = SqlHelper.ExecuteTable("SELECT COUNT(UserID) AS count1,(SELECT COUNT(UserID) FROM ZL_User Where ParentUserID>0) AS count2 FROM ZL_User"); data3_1 = JsonConvert.SerializeObject(userdt1); DataTable userdt2 = SqlHelper.JoinQuery("A.*,B.GroupName", "(SELECT COUNT(UserID) AS ICount,GroupID FROM ZL_User Group BY GroupID)", "ZL_Group", "A.GroupID=B.GroupID"); data3_2 = JsonConvert.SerializeObject(userdt2); this.litUserName.Text = B_Admin.GetLogin().AdminName; this.litDate.Text = DateTime.Now.ToShortDateString() + " " + Resources.L.农历 + Season.GetLunarCalendar(DateTime.Now) + " " + Season.GetWeekCHA() + " " + Season.ChineseTwentyFourDay(DateTime.Now); this.Version.Text = "当前版本:CMS2 X3.8 版,数据引擎:SQL Server 2005及更高版本"; //支付明细 DataTable paydt = modelBll.SelectTableName("ZL_Payment", "PayPlatID>0 AND PaymentNum like 'DD%' "); var payquery = (from pay in paydt.AsEnumerable() select pay).Take(5); payquery.Count(); Pay_RPT.DataSource = payquery.Count() > 0 ? payquery.CopyToDataTable() : null; Pay_RPT.DataBind(); //订单列表 DataTable orderdt = orderBll.SearchByQuickAndSkey("0,4", "", "", 0, 0, ""); var query = (from order in orderdt.AsEnumerable() select order).Take(5); Order_RPT.DataSource = query.Count() > 0 ? query.CopyToDataTable() : null; Order_RPT.DataBind(); Sche_RPT.DataSource = new B_Content_ScheLog().Sel(5); Sche_RPT.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { B_Admin.CheckIsLogged(); if (!IsPostBack) { //内容,商品,会员 //只显示有数据的第一级父节点 DataTable condt = nodeBll.SelForShowAll(0); condt.DefaultView.RowFilter = "ItemCount>0"; condt = condt.DefaultView.ToTable(); condt = condt.DefaultView.ToTable(false, "ItemCount", "NodeName"); data1 = JsonConvert.SerializeObject(condt); //商品 //DataTable prodt = SqlHelper.JoinQuery("A.*,B.NodeName", "(SELECT COUNT(ID) AS ICount,NodeID FROM ZL_Commodities Group BY NodeID)", "ZL_Node", "A.NodeID=B.NodeID"); //data2 = JsonConvert.SerializeObject(prodt); //商品,数量与销量 string prosql = "SELECT Pro.*,Cart.SellCount FROM " + " (SELECT A.*,B.NodeName FROM (SELECT COUNT(ID) AS ProCount,Nodeid FROM ZL_Commodities GROUP BY Nodeid) A LEFT JOIN ZL_Node B ON A.Nodeid=B.NodeID) Pro" + " LEFT JOIN" + " (SELECT COUNT(A.ID) AS SellCount,B.Nodeid FROM ZL_CartPro A LEFT JOIN ZL_Commodities B ON A.ProID=B.ID GROUP BY B.Nodeid) Cart" + " ON Pro.Nodeid=Cart.Nodeid"; DataTable prodt = SqlHelper.ExecuteTable(prosql); DataRow dr = prodt.NewRow(); dr["NodeName"] = "总计"; dr["ProCount"] = prodt.Compute("SUM(ProCount)", ""); dr["SellCount"] = prodt.Compute("SUM(SellCount)", ""); prodt.Rows.Add(dr); data2 = JsonConvert.SerializeObject(prodt); //内芯 DataTable userdt1 = SqlHelper.ExecuteTable("SELECT COUNT(UserID) AS count1,(SELECT COUNT(UserID) FROM ZL_User Where ParentUserID>0) AS count2 FROM ZL_User"); data3_1 = JsonConvert.SerializeObject(userdt1); DataTable userdt2 = SqlHelper.JoinQuery("A.*,B.GroupName", "(SELECT COUNT(UserID) AS ICount,GroupID FROM ZL_User Group BY GroupID)", "ZL_Group", "A.GroupID=B.GroupID"); data3_2 = JsonConvert.SerializeObject(userdt2); this.litUserName.Text = B_Admin.GetLogin().AdminName; this.litDate.Text = DateTime.Now.ToShortDateString() + " " + Resources.L.农历 + Season.GetLunarCalendar(DateTime.Now) + " " + Season.GetWeekCHA() + " " + Season.ChineseTwentyFourDay(DateTime.Now); this.Version.Text = "当前版本:CMS2 X3.6Beta 版,数据引擎:SQL Server 2005及更高版本"; Sche_RPT.DataSource = new B_Content_ScheLog().Sel(5); Sche_RPT.DataBind(); } }
public void MyBind() { M_UserInfo mu = buser.GetLogin(); M_Design_SiteInfo sfMod = sfBll.SelReturnModel(mu.SiteID); DataTable nodetable = nodeBll.SelForShowAll(0, true); nodetable.DefaultView.RowFilter = "NodeBySite='" + mu.SiteID + "'"; nodetable = nodetable.DefaultView.ToTable(); DataRow dr = nodetable.NewRow();//根节点 dr["NodeID"] = 0; dr["NodeType"] = 0; dr["NodeName"] = sfMod.SiteName; dr["NodeDir"] = "root"; dr["CDate"] = sfMod.CDate; dr["Depth"] = 0; dr["ItemCount"] = nodetable.Compute("SUM(ItemCount)", "ParentID=0"); dr["ChildCount"] = nodetable.Rows.Count; dr["SafeGuard"] = 0; nodetable.Rows.InsertAt(dr, 0); RPT.DataSource = nodetable; RPT.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { B_ARoleAuth.CheckEx(ZLEnum.Auth.model, "NodeManage"); if (function.isAjax() && Request.Form["want"] != null) { #region AJAX int nodeID = DataConvert.CLng(Request.Form["nid"]); if (nodeID == 0) { Response.Clear(); Response.End(); } string json = ""; DataTable dt = bll.SelForShowAll(nodeID); if (dt != null && dt.Rows.Count > 0) { string[] cols = "Meta_Keywords,Meta_Description,Description".Split(','); foreach (string col in cols) { dt.Columns.Remove(col); } dt.Columns.Add(new DataColumn("icon", typeof(string))); dt.Columns.Add(new DataColumn("type2", typeof(string))); dt.Columns.Add(new DataColumn("oper", typeof(string))); //dt.Columns.Add(new DataColumn("showhidden",typeof(string))); for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = dt.Rows[i]; dt.Rows[i]["icon"] = GetIcon(dr["NodeName"].ToString(), Convert.ToInt32(dr["NodeID"]), Convert.ToInt32(dr["Depth"]), Convert.ToInt32(dr["NodeType"]), dr["nodeDir"].ToString(), Convert.ToInt32(dr["ChildCount"]), dr["ContentModel"].ToString()); dt.Rows[i]["type2"] = GetNodeType(dr["NodeType"].ToString()); dt.Rows[i]["oper"] = GetOper(dr); dt.Rows[i]["Purview"] = ""; } json = JsonHelper.JsonSerialDataTable(dt); } Response.Clear(); Response.Write(json); Response.End(); #endregion } if (!IsPostBack) { DataTable nodetable = new DataTable(); if (Action == "del") { EmptyNode(); Response.Redirect("NodeManage.aspx"); return; } else if (Action == "showall") { nodetable = bll.SelForShowAll(0, true); } else { nodetable = bll.SelForShowAll(0); } DataRow dr = nodetable.NewRow();//根节点 dr["NodeID"] = 0; dr["NodeType"] = (int)NodeEnum.Root; dr["NodeName"] = Call.SiteName; dr["NodeDir"] = "root"; dr["Depth"] = 0; dr["ItemCount"] = nodetable.Compute("SUM(ItemCount)", "ParentID=0"); dr["ChildCount"] = nodetable.Rows.Count; dr["SafeGuard"] = 0; dr["NodeBySite"] = 0; nodetable.Rows.InsertAt(dr, 0); //-------------- nodetable.DefaultView.RowFilter = "NodeBySite IS NULL OR NodeBySite=0"; nodetable = nodetable.DefaultView.ToTable(); RPT.DataSource = nodetable; RPT.DataBind(); Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "Main.aspx'>" + Resources.L.工作台 + "</a></li><li><a href='" + customPath2 + "Config/SiteInfo.aspx'>" + Resources.L.系统设置 + "</a></li><li class='active dropdown'><a href='NodeManage.aspx'>" + Resources.L.节点管理 + "</a> <a href='#' class='dropdown-toggle' data-toggle='dropdown'>" + Resources.L.便捷操作 + " <span class='caret'></span></a> <ul class='dropdown-menu' role='menu'><li><a href='NodeManage.aspx?action=showall'>" + Resources.L.展开所有节点 + "</a></li><li><a href=\'NodeManage.aspx\' >" + Resources.L.收缩所有节点 + "</a></li> <li><a href=\'javascript:void(0)\' onclick=\'emptynode()\'>" + Resources.L.除所有节点 + "</a></li><li><a href=\"" + customPath2 + "Config/EmptyData.aspx\">[" + Resources.L.初始化全站数据 + "]</a></li></ul></li>" + Call.GetHelp(15)); } }