📄 navimenu.aspx.cs
字号:
//======================================================
//== (c)2008 aspxcms inc by NeTCMS v1.0 ==
//== Forum:bbs.aspxcms.com ==
//== Website:www.aspxcms.com ==
//======================================================
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using NetCMS.Content;
public partial class manage_System_navimenu : NetCMS.Web.UI.ManagePage
{
public manage_System_navimenu()
{
Authority_Code = "Q025";
}
UserMisc rd = new UserMisc();
protected void Page_Load(object sender, EventArgs e)
{
Response.CacheControl = "no-cache";
if (!IsPostBack)
{
copyright.InnerHtml = CopyRight;
parentIDs.InnerHtml = parentidlist();
}
}
string parentidlist()
{
DataTable dt = rd.sel_GroupListStr(2);
string liststr = "\r<select name=\"parentID\" onChange=\"javascrpt:changevalue(this.value);\">\r";
liststr = liststr + "<option value=\"0\">不指定父菜单[顶部]</option>\r";
for (int i = 0; i < dt.Rows.Count; i++)
{
string Am_position = dt.Rows[i]["Am_position"].ToString();
string am_Name = dt.Rows[i]["am_Name"].ToString();
string am_ParentID = dt.Rows[i]["am_ParentID"].ToString();
string am_ClassID = dt.Rows[i]["am_ClassID"].ToString();
liststr = liststr + "<option value=\"" + am_ClassID + "\">" + am_Name + "</option>\r";
if (am_ClassID != "0")
{
liststr = liststr + childparentidlist(am_ClassID, "┝");
}
}
dt.Clear(); dt.Dispose();
liststr = liststr + "</select>\r";
return liststr;
}
string childparentidlist(string pID,string nchar)
{
DataTable dt = rd.sel_Misc(pID,7);
string TempStr = nchar + "┉";
string liststr = "";
for (int i = 0; i < dt.Rows.Count; i++)
{
string Am_position = dt.Rows[i]["Am_position"].ToString();
string am_Name = dt.Rows[i]["am_Name"].ToString();
string am_ParentID = dt.Rows[i]["am_ParentID"].ToString();
string am_ClassID = dt.Rows[i]["am_ClassID"].ToString();
liststr = liststr + "<option value=\"" + am_ClassID + "\">" + TempStr + am_Name + "</option>\r";
if (am_ClassID != "0")
{
liststr = liststr + childparentidlist(am_ClassID, TempStr);
}
}
return liststr;
}
protected void Navisubmit(object sender, EventArgs e)
{
if (Page.IsValid == true) //判断是否验证成功
{
//------------------获取表单值-----------------------------------------
string Am_position = Request.Form["position"];
string am_Name = Request.Form["menuName"];
string am_FilePath = Request.Form["FilePath"];
string am_target = Request.Form["f_target"];
string am_ParentID = Request.Form["parentID"];
int am_type = int.Parse(Request.Form["type"]);
int am_orderID = int.Parse(Request.Form["orderID"]);
string isSys = Request.Form["isSys"]+"nt";
string popCode = this.popCode.Text;
int am_isSys=0;
if (isSys=="nt")
{
am_isSys = 0;
}
else
{
am_isSys = 1;
}
//连接数据库
string am_ClassID = NetCMS.Common.Rand.Number(12);//产生12位随机字符
DataTable dt = rd.sel_Misc(am_ClassID,8);
if (dt != null)
{
if (dt.Rows.Count > 0)
{
PageError("意外错误:有可能是系统编号重复,请重新添加", "");
}
else
{
NetCMS.Model.UserInfo7 uc = new NetCMS.Model.UserInfo7();
uc.api_IdentID = "0";
uc.am_ClassID = am_ClassID;
uc.Am_position = Am_position;
uc.am_Name = am_Name;
uc.am_FilePath = am_FilePath;
uc.am_target = am_target;
uc.am_ParentID = am_ParentID;
uc.am_type = am_type;
uc.am_creatTime = System.DateTime.Now;
uc.am_orderID = am_orderID;
uc.popCode = popCode;
uc.isSys = am_isSys;
uc.siteID = SiteID;
uc.userNum = UserNum;
rd.addUpdate_manageMenu(uc,0);
PageRight("添加菜单成功。", "navimenu_list.aspx");
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -