public void MyBind() { DataTable Cll = pll.GetPagestylelist(); EGV.DataSource = Cll; EGV.DataBind(); }
protected void loadmenulist(int usid) { int groupid = 0; if (StyleID > 0) { groupid = StyleID; } else if (styleids > 0) { if (!B_ARoleAuth.Check(ZLEnum.Auth.page, "AddPageStyle")) { function.WriteErrMsg("没有权限进行此项操作"); } groupid = DataConverter.CLng(tll.Getbyid(styleids).UserGroup); } else if (id > 0) { if (!B_ARoleAuth.Check(ZLEnum.Auth.page, "PageAudit")) { function.WriteErrMsg("没有权限进行此项操作"); } M_AdminInfo info = badmin.GetAdminLogin(); DataTable m_PageRega = regBll.Sel(DataConverter.CLng(Request["id"])); string nodename = m_PageRega.Rows[0]["UserName"].ToString(); SqlParameter[] sp = new SqlParameter[] { new SqlParameter("nodename", nodename) }; int UsertabID = ull.GetUserByName(nodename).UserID; DataTable regdt = mll.SelectTableName("ZL_Pagereg", "TableName like 'ZL_Reg_%' and UserName=@nodename", sp); if (regdt != null && regdt.Rows.Count > 0) { string PageTableName = regdt.Rows[0]["TableName"].ToString(); DataTable pagetable = mll.SelectTableName(PageTableName, "UserName = @nodename", sp); groupid = DataConverter.CLng(pagetable.Rows[0]["Styleid"]); } } else if (sid > 0) { string nodename = ull.SeachByID(usid).UserName; if (nodename != null) { SqlParameter[] sp2 = new SqlParameter[] { new SqlParameter("nodename", nodename) }; DataTable regdt = mll.SelectTableName("ZL_Pagereg", "TableName like 'ZL_Reg_%' and UserName=@nodename", sp2); if (regdt != null && regdt.Rows.Count > 0) { string PageTableName = regdt.Rows[0]["TableName"].ToString(); DataTable pagetable = mll.SelectTableName(PageTableName, "UserName = @nodename", sp2); groupid = DataConverter.CLng(pagetable.Rows[0]["Styleid"]); } } } DataTable styletable = null; styletable = sll.GetPagestylelist(); string TempParentID = "<select name=\"ParentID\" class='form-control' id=\"ParentID\">"; TempParentID = TempParentID + "<option value=\"0\" selected=\"selected\">请选择栏目</option>"; for (int s = 0; s < styletable.Rows.Count; s++) { string ddstr = ""; if (groupid.ToString() == styletable.Rows[s]["PageNodeid"].ToString()) { ddstr = "selected=\"selected\""; } TempParentID = TempParentID + "<option " + ddstr + " value=\"s-" + styletable.Rows[s]["PageNodeid"].ToString() + "\">" + styletable.Rows[s]["PageNodeName"].ToString() + "</option>"; TempParentID = TempParentID + optionlist(styletable.Rows[s]["PageNodeid"].ToString(), StyleID, usid); } ParentID.Text = TempParentID; }
public ActionResult PageInfo() { //传递到页面的数据 bool ShowRegPage = true;//显示表单 string PageTitle = "", TableTitle = "添加企业黄页"; int InfoID = 0; int SelModelID = 0; //对应申请类型,相关功能暂移除 string menu = DataSecurity.FilterBadChar(Request.QueryString["menu"]); M_PageReg prMod = prBll.GetSelectByUserID(mu.UserID); if (prMod != null) { SelModelID = prMod.ModelID; } DataTable RegDT = fieldBll.SelectTableName("ZL_Pagereg", "TableName like 'ZL/_Reg/_%' escape '/' and UserID='" + mu.UserID + "'"); DataTable UPageDT = new DataTable(); string TableNames = ""; if (RegDT.Rows.Count > 0) { TableNames = RegDT.Rows[0]["TableName"].ToString(); SafeSC.CheckDataEx(TableNames); if (!modBll.IsExistTemplate(TableNames)) { function.WriteErrMsg("找不到系统黄页信息!请到后台创建用户模型"); return(Content("")); } DataTable modeinfo = fieldBll.SelectTableName("ZL_Model", "TableName = '" + TableNames + "'"); UPageDT = fieldBll.SelectTableName(TableNames, "UserID='" + mu.UserID + "'"); } if (TableNames != "") { DataTable modetb = fieldBll.SelectTableName("ZL_Model", "TableName ='" + TableNames + "'"); if (modetb.Rows.Count > 0) { SelModelID = DataConverter.CLng(modetb.Rows[0]["ModelID"]); } } DataTable typeDt = modBll.GetListPage(); if (SelModelID <= 0 && typeDt.Rows.Count > 0) { SelModelID = DataConverter.CLng(typeDt.Rows[0]["ModelID"]); } int UPageCount = UPageDT.Rows.Count; int RegCount = RegDT.Rows.Count; int PageStatus = 0; if (UPageCount > 0 && RegCount > 0) { PageStatus = DataConverter.CLng(RegDT.Rows[0]["Status"]); } if (UPageCount == 0 && RegCount == 0 && PageStatus != 99)//注册黄页 { //ModelHtml = fieldBll.InputallHtml(SelModelID, 0, new ModelConfig() { Source = ModelConfig.SType.Admin }); } else { if (UPageCount > 0 && RegCount > 0 && PageStatus != 99)//审核黄页 { #region 正在审核黄页 if (menu == "modifile") { TableTitle = "修改企业黄页"; //InfoID = DataConverter.CLng(RegDT.Rows[0]["InfoID"]); //ModelHtml = fieldBll.InputallHtml(SelModelID, 0, new ModelConfig() //{ // ValueDT = UPageDT //}); } else { ShowRegPage = false; } #endregion } else if (UPageCount > 0 && RegCount > 0 && PageStatus == 99)//审核通过和注册 { #region 审核通过的用户(修改资料) if (menu.Equals("modifile")) { TableTitle = "修改企业黄页"; InfoID = DataConverter.CLng(RegDT.Rows[0]["InfoID"]); //显示域名绑定 //ModelHtml = fieldBll.InputallHtml(SelModelID, 0, new ModelConfig() //{ // ValueDT = UPageDT //}); } else { ShowRegPage = false; RedirectToAction("PageInfo", "Pages", new { menu = "modifile" }); } #endregion } else { if (menu.Equals("modifile")) { DataTable dt1 = fieldBll.SelectTableName(RegDT.Rows[0]["TableName"].ToString(), "ID = " + RegDT.Rows[0]["GeneralID"] + ""); TableTitle = "修改企业黄页"; InfoID = DataConverter.CLng(RegDT.Rows[0]["InfoID"]); DataTable tbinfo = fieldBll.SelectTableName(TableNames, "UserID = '" + mu.UserID + "'"); //ModelHtml = fieldBll.InputallHtml(SelModelID, 0, new ModelConfig() { ValueDT = UPageDT }); } else { ShowRegPage = false; } } } DataTable styleDt = styleBll.GetPagestylelist(); styleDt.Columns["PageNodeid"].ColumnName = "TemplateID"; styleDt.Columns["TemplateIndex"].ColumnName = "TemplateUrl"; styleDt.Columns["TemplateIndexPic"].ColumnName = "TemplatePic"; styleDt.Columns["PageNodeName"].ColumnName = "rname"; ViewBag.PageTitle = PageTitle; ViewBag.TableTitle = TableTitle; ViewBag.ShowRegPage = ShowRegPage; if (UPageDT.Rows.Count > 0) { ViewBag.valuedr = UPageDT.Rows[0]; } else { ViewBag.valuedr = null; } //ViewBag.ModelHtml = ModelHtml; ViewBag.typeDt = typeDt; ViewBag.styleDt = styleDt; ViewBag.UserName = mu.UserName; ViewBag.ModelID = SelModelID; ViewBag.InfoID = InfoID; return(View(prMod)); }