%@ CodeTemplate Language="C#" ClassName="Project_WebSite" TargetLanguage="C#" Debug="False" Description="" %>
<%@ Property Name="databaseProjectName" Type="System.String" Default="SpSampleDb" Optional="True" Category="Context" Description="" %>
<%@ Property Name="WebSitePort" Type="System.Int32" Default="88" Optional="True" Category="Context" Description="" %>
<%@ Property Name="MsSQLServerName" Type="System.String" Default="(local)" Optional="True" Category="Context" Description="" %>
<%@ Property Name="MsSQLUserName" Type="System.String" Default="sa" Optional="True" Category="Context" Description="" %>
<%@ Property Name="MsSQLPasswd" Type="System.String" Default="sa" Optional="True" Category="Context" Description="" %>
<%
DbEntity db = Template.GetDataBase(databaseProjectName);
CopyDirectory("code\\website",databaseProjectName+"\\WebSite");
CreateSite(databaseProjectName+"\\website",WebSitePort,databaseProjectName);
%>
<%-- TopMenuEnums --%>
<%
OpenResponse(databaseProjectName+"\\WebSite\\App_Code\\TopMenuEnums.cs");
%>
using System;
using System.Data;
using System.Configuration;
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;
///
///
///
public enum TopMenuEnums:int
{
<%
int iModule = 0;
int iAllModuleCount = db.ModuleNames.Count;
foreach(string moduleName in db.ModuleNames)
{
string line = "\t"+moduleName+"="+Convert.ToString(iModule+1);
iModule++;
if( iModule != iAllModuleCount)
line+=",";
Response.WriteLine(line);
}
%>
}
<%CloseResponse();%>
<%-- Module Defalt Page --%>
<%
foreach(string moduleName in db.ModuleNames)
{
OpenResponse(databaseProjectName+"\\WebSite\\"+moduleName+"\\Default.aspx.cs");
%>
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;
public partial class <%=moduleName%>_Default : System.Web.UI.PageEx
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
TopMenuId = (int)TopMenuEnums.<%=moduleName%>;
}
}
}
<%
CloseResponse();
OpenResponse(databaseProjectName+"\\WebSite\\"+moduleName+"\\Default.aspx");
%>
<%%@ Page Language="C#" Theme="default" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="<%=moduleName%>_Default" Title="<%=moduleName%>" %>
ÎÞ±êÌâÒ³
<%
CloseResponse();
}
%>
<%
OpenResponse(databaseProjectName+"\\WebSite\\Web.config");
%>
<%
CloseResponse();
%>