Files
2026-03-11 09:05:03 +08:00

81 lines
2.9 KiB
Plaintext

<%@ Application Language="C#" %>
<%@ Import Namespace="Castle.ActiveRecord" %>
<%@ Import Namespace="Castle.ActiveRecord.Framework.Config" %>
<%@ Import Namespace="BizCom" %>
<%@ Import Namespace="Utils" %>
<%@ Import Namespace="System.Threading" %>
<script RunAt="server">
System.Threading.Timer gtimer;
void Application_Start(object sender, EventArgs e)
{
//log4net.Config.XmlConfigurator.Configure();
// Code that runs on application startup
InPlaceConfigurationSource source = new InPlaceConfigurationSource();
System.Collections.Generic.IDictionary<string, string> properties = new System.Collections.Generic.Dictionary<string, string>();
properties.Add("connection.driver_class", "NHibernate.Driver.SqlClientDriver");
properties.Add("proxyfactory.factory_class", "NHibernate.ByteCode.Castle.ProxyFactoryFactory,NHibernate.ByteCode.Castle");
properties.Add("dialect", "NHibernate.Dialect.MsSql2005Dialect");
properties.Add("connection.provider", "NHibernate.Connection.DriverConnectionProvider");
string conn = ConfigurationManager.ConnectionStrings["ConnString"].ConnectionString;
properties.Add("connection.connection_string", SecurityHelper.DecryptSymmetric(conn));
source.Add(typeof(ActiveRecordBase), properties);
source.IsRunningInWebApp = true;
//IConfigurationSource source =ConfigurationManager.GetSection("activerecord") as IConfigurationSource;
Type[] acTypes = new[]
{
typeof(CeErpTrade),
typeof(CeErpTradeCell),
typeof(XLog),
typeof(CeErpTradeLog),
typeof(CeErpProduct),
typeof(CeErpDataSendOrderInfo),
};
ActiveRecordStarter.Initialize(source, acTypes);
}
void global_elapsed(object state)
{
}
void Application_End(object sender, EventArgs e)
{
// Code that runs on application shutdown
}
void Application_BeginRequest(Object sender, EventArgs e)
{
}
void Application_Error(object sender, EventArgs e)
{
// Code that runs when an unhandled error occurs
//if (config.Instance.Site.SpiderIp.Contains(CommonHelper.ClientIP))return;
//SyLog.WriteLog(Server.GetLastError());
}
void Session_Start(object sender, EventArgs e)
{
// Code that runs when a new session is started
}
void Session_End(object sender, EventArgs e)
{
// Code that runs when a session ends.
// Note: The Session_End event is raised only when the sessionstate mode
// is set to InProc in the Web.config file. If session mode is set to StateServer
// or SQLServer, the event is not raised.
}
</script>