DT 的数据字典
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
960 B

1 year ago
<%@ CodeTemplate Language="C#" ClassName="Menus" TargetLanguage="C#" Debug="False" Description="" %>
<%@ Property Name="databaseProjectName" Type="System.String" Default="SpSampleDb" Optional="True" Category="Context" Description="" %>
DELETE FROM MENUS;
<%
DbEntity db = Template.GetDataBase(databaseProjectName);
int iModule = 0;
foreach(string module in db.ModuleNames)
{
iModule++;
%>
INSERT INTO MENUS(menuId,upmenuId,text,url) VALUES(<%=iModule%>,0,'<%=module%>','/<%=module%>/default.aspx');
INSERT INTO MENUS(menuId,upmenuId,text,url) values(<%=iModule%>00,<%=iModule%>,'<%=module%>','');
<%
int iTable = 0;
foreach(Table tb in db.Tables)
{
if( tb.ModuleName == module)
{
iTable++;
string menuText = tb.CnName;
if( menuText == "")
menuText = tb.Name;
%>INSERT INTO MENUS(menuId,upmenuId,text,url) values(<%=Convert.ToString(iModule*1000+iTable)%>,<%=iModule%>00,'<%=menuText%>','/<%=module%>/<%=tb.Name%>.aspx');
<%
}
}
}
%>