(#15)医疗机构前置机增加IOC模块,数据库模块
This commit is contained in:
parent
aada97e27c
commit
2c00f5902f
119
WebSiteCode/Cmdjy/CmdjyHisFront/Bll/BackgroundTask.cs
Normal file
119
WebSiteCode/Cmdjy/CmdjyHisFront/Bll/BackgroundTask.cs
Normal file
|
@ -0,0 +1,119 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Timers;
|
||||||
|
using Autofac;
|
||||||
|
using CommonClass.Factory;
|
||||||
|
|
||||||
|
namespace CmdjyHisFront.Bll
|
||||||
|
{
|
||||||
|
public interface ITask
|
||||||
|
{
|
||||||
|
void Run();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 任务管理器
|
||||||
|
/// </summary>
|
||||||
|
public interface ITaskManager
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 心跳间隔。毫秒
|
||||||
|
/// </summary>
|
||||||
|
double BackgroundTaskHeartbeat { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 执行任务
|
||||||
|
/// </summary>
|
||||||
|
void Start();
|
||||||
|
/// <summary>
|
||||||
|
/// 结束任务
|
||||||
|
/// </summary>
|
||||||
|
void Stop();
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 背景任务注册管理器
|
||||||
|
/// </summary>
|
||||||
|
public class TaskManagerRegister:IRegister
|
||||||
|
{
|
||||||
|
public void Register(ContainerBuilder builder) {
|
||||||
|
builder.Register<ITaskManager>(c => new TaskManager());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 背景任务管理器
|
||||||
|
/// </summary>
|
||||||
|
public class TaskManager:ITaskManager
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 任务心跳触发计时器
|
||||||
|
/// </summary>
|
||||||
|
public static Timer CTimer { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 要执行的背景线程
|
||||||
|
/// </summary>
|
||||||
|
public IEnumerable<ITask> BackTasks { get; set; }
|
||||||
|
|
||||||
|
public double BackgroundTaskHeartbeat { get; set; } = 1000;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建一个背景任务管理器
|
||||||
|
/// </summary>
|
||||||
|
public TaskManager() { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 通过提供任务和背景心跳间隔创建背景任务管理器
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="bt">背景任务枚举</param>
|
||||||
|
/// <param name="bh">心跳</param>
|
||||||
|
public TaskManager(IEnumerable<ITask> bt) {
|
||||||
|
this.BackTasks = bt;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 通过提供任务和背景心跳间隔创建背景任务管理器
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="bt">背景任务枚举</param>
|
||||||
|
/// <param name="bh">心跳</param>
|
||||||
|
public TaskManager(IEnumerable<ITask> bt,double bh) {
|
||||||
|
this.BackTasks = bt; this.BackgroundTaskHeartbeat = bh;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 开始执行背景任务
|
||||||
|
/// </summary>
|
||||||
|
public void Start() {
|
||||||
|
if(this.BackTasks == null || this.BackTasks.Count() == 0) return;
|
||||||
|
CTimer = CTimer ?? new Timer(this.BackgroundTaskHeartbeat);
|
||||||
|
CTimer.Elapsed += this.run;
|
||||||
|
CTimer.AutoReset = false;
|
||||||
|
CTimer.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 任务处理事件
|
||||||
|
/// </summary>
|
||||||
|
private void run(object sender,ElapsedEventArgs e) {
|
||||||
|
//启动具体任务
|
||||||
|
foreach(var t in this.BackTasks) {
|
||||||
|
Task.Factory.StartNew(m => {
|
||||||
|
if(m is ITask task) {
|
||||||
|
task.Run();
|
||||||
|
}
|
||||||
|
},t as object);
|
||||||
|
}
|
||||||
|
//任务启动后重启心跳计时器
|
||||||
|
if(sender is Timer timer) {
|
||||||
|
timer.Start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Stop() {
|
||||||
|
if(CTimer == null) return;
|
||||||
|
CTimer.Stop();
|
||||||
|
CTimer.Elapsed -= run;
|
||||||
|
CTimer = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -45,6 +45,21 @@
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="Autofac, Version=4.9.1.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Autofac.4.9.1\lib\net45\Autofac.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Autofac.Integration.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Autofac.Mvc5.4.0.2\lib\net45\Autofac.Integration.Mvc.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="CommonClass.Factory, Version=1.2.0.8, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\CommonClass.Factory.1.2.0.8\lib\net45\CommonClass.Factory.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
|
@ -147,13 +162,19 @@
|
||||||
<Compile Include="App_Start\BundleConfig.cs" />
|
<Compile Include="App_Start\BundleConfig.cs" />
|
||||||
<Compile Include="App_Start\FilterConfig.cs" />
|
<Compile Include="App_Start\FilterConfig.cs" />
|
||||||
<Compile Include="App_Start\RouteConfig.cs" />
|
<Compile Include="App_Start\RouteConfig.cs" />
|
||||||
|
<Compile Include="Bll\BackgroundTask.cs" />
|
||||||
<Compile Include="Controllers\HomeController.cs" />
|
<Compile Include="Controllers\HomeController.cs" />
|
||||||
|
<Compile Include="Dal\DbConfig.cs" />
|
||||||
|
<Compile Include="Dal\HisFrontDbContext.cs" />
|
||||||
<Compile Include="Global.asax.cs">
|
<Compile Include="Global.asax.cs">
|
||||||
<DependentUpon>Global.asax</DependentUpon>
|
<DependentUpon>Global.asax</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="IocFactory.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="WebSettings.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Content Include="CommonClass.Factory.Log.txt" />
|
||||||
<Content Include="Content\bootstrap-theme.css" />
|
<Content Include="Content\bootstrap-theme.css" />
|
||||||
<Content Include="Content\bootstrap-theme.min.css" />
|
<Content Include="Content\bootstrap-theme.min.css" />
|
||||||
<Content Include="Content\bootstrap.css" />
|
<Content Include="Content\bootstrap.css" />
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
V8 2018年1月8日
|
||||||
|
1、特性注入支持属性注入。接口注入方式暂不支持。
|
12
WebSiteCode/Cmdjy/CmdjyHisFront/Dal/DbConfig.cs
Normal file
12
WebSiteCode/Cmdjy/CmdjyHisFront/Dal/DbConfig.cs
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
|
namespace CmdjyHisFront.Dal
|
||||||
|
{
|
||||||
|
public class DbConfig:DbMigrationsConfiguration<HisFrontDbContext>
|
||||||
|
{
|
||||||
|
public DbConfig() {
|
||||||
|
AutomaticMigrationsEnabled = WebSettings.AutoMigrations;
|
||||||
|
AutomaticMigrationDataLossAllowed = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
12
WebSiteCode/Cmdjy/CmdjyHisFront/Dal/HisFrontDbContext.cs
Normal file
12
WebSiteCode/Cmdjy/CmdjyHisFront/Dal/HisFrontDbContext.cs
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
using System.Data.Entity;
|
||||||
|
|
||||||
|
namespace CmdjyHisFront.Dal
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// HIS前置机数据库h
|
||||||
|
/// </summary>
|
||||||
|
public partial class HisFrontDbContext:DbContext
|
||||||
|
{
|
||||||
|
public HisFrontDbContext() : base("HisFrontDbContext") { }
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,16 +1,23 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Data.Entity;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using System.Web.Optimization;
|
using System.Web.Optimization;
|
||||||
using System.Web.Routing;
|
using System.Web.Routing;
|
||||||
|
using Autofac.Integration.Mvc;
|
||||||
|
using CmdjyHisFront.Dal;
|
||||||
|
|
||||||
namespace CmdjyHisFront
|
namespace CmdjyHisFront
|
||||||
{
|
{
|
||||||
public class MvcApplication:System.Web.HttpApplication
|
public class MvcApplication:System.Web.HttpApplication
|
||||||
{
|
{
|
||||||
protected void Application_Start() {
|
protected void Application_Start() {
|
||||||
|
Database.SetInitializer(new MigrateDatabaseToLatestVersion<HisFrontDbContext,DbConfig>());
|
||||||
|
//配置autofac依赖注入
|
||||||
|
DependencyResolver.SetResolver(new AutofacDependencyResolver(IocFactory.Factory));
|
||||||
|
|
||||||
AreaRegistration.RegisterAllAreas();
|
AreaRegistration.RegisterAllAreas();
|
||||||
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
|
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
|
||||||
RouteConfig.RegisterRoutes(RouteTable.Routes);
|
RouteConfig.RegisterRoutes(RouteTable.Routes);
|
||||||
|
|
28
WebSiteCode/Cmdjy/CmdjyHisFront/IocFactory.cs
Normal file
28
WebSiteCode/Cmdjy/CmdjyHisFront/IocFactory.cs
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
using Autofac;
|
||||||
|
using Autofac.Integration.Mvc;
|
||||||
|
using CommonClass.Factory;
|
||||||
|
|
||||||
|
namespace CmdjyHisFront
|
||||||
|
{
|
||||||
|
public class IocFactory
|
||||||
|
{
|
||||||
|
private static IOCFactory _iocFactory = null;
|
||||||
|
/// <summary>
|
||||||
|
/// 控制反转容器工厂
|
||||||
|
/// </summary>
|
||||||
|
public static ILifetimeScope Factory {
|
||||||
|
get {
|
||||||
|
if(_iocFactory == null) {
|
||||||
|
_iocFactory = new IOCFactory();
|
||||||
|
_iocFactory.BeforeBuild += _iocFactory_BeforeBuild;
|
||||||
|
_iocFactory.Init();
|
||||||
|
}
|
||||||
|
return _iocFactory.Container.BeginLifetimeScope();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void _iocFactory_BeforeBuild(IOCFactory arg1,ContainerBuilder arg2) {
|
||||||
|
arg2.RegisterControllers();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,75 +4,89 @@
|
||||||
https://go.microsoft.com/fwlink/?LinkId=301880
|
https://go.microsoft.com/fwlink/?LinkId=301880
|
||||||
-->
|
-->
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<configSections>
|
||||||
|
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||||
|
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||||
|
</configSections>
|
||||||
|
<connectionStrings>
|
||||||
|
<add name="HisFrontDbContext" connectionString="Server=FALCON-PC\SQLSERVER2008R2;Database=cmdjyHisFront;User ID=sa;Password=saabc123" providerName="System.Data.SqlClient" />
|
||||||
|
</connectionStrings>
|
||||||
<appSettings>
|
<appSettings>
|
||||||
<add key="webpages:Version" value="3.0.0.0"/>
|
<add key="webpages:Version" value="3.0.0.0" />
|
||||||
<add key="webpages:Enabled" value="false"/>
|
<add key="webpages:Enabled" value="false" />
|
||||||
<add key="ClientValidationEnabled" value="true"/>
|
<add key="ClientValidationEnabled" value="true" />
|
||||||
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
|
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
|
||||||
</appSettings>
|
</appSettings>
|
||||||
<system.web>
|
<system.web>
|
||||||
<compilation debug="true" targetFramework="4.6.1"/>
|
<compilation debug="true" targetFramework="4.6.1" />
|
||||||
<httpRuntime targetFramework="4.6.1"/>
|
<httpRuntime targetFramework="4.6.1" />
|
||||||
<httpModules>
|
<httpModules>
|
||||||
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"/>
|
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
|
||||||
</httpModules>
|
</httpModules>
|
||||||
</system.web>
|
</system.web>
|
||||||
<runtime>
|
<runtime>
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f"/>
|
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2"/>
|
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51"/>
|
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.1" newVersion="4.0.2.1"/>
|
<bindingRedirect oldVersion="0.0.0.0-4.0.2.1" newVersion="4.0.2.1" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed"/>
|
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
|
||||||
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0"/>
|
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35"/>
|
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
|
||||||
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0"/>
|
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35"/>
|
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
|
||||||
<bindingRedirect oldVersion="1.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930"/>
|
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>
|
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||||
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
|
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
|
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
|
||||||
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
|
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
|
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
|
||||||
<bindingRedirect oldVersion="1.0.0.0-5.2.4.0" newVersion="5.2.4.0"/>
|
<bindingRedirect oldVersion="0.0.0.0-5.2.4.0" newVersion="5.2.4.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.9.1.0" newVersion="4.9.1.0" />
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
<system.webServer>
|
<system.webServer>
|
||||||
<modules>
|
<modules>
|
||||||
<remove name="TelemetryCorrelationHttpModule"/>
|
<remove name="TelemetryCorrelationHttpModule" />
|
||||||
<add name="TelemetryCorrelationHttpModule"
|
<add name="TelemetryCorrelationHttpModule" type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation" preCondition="integratedMode,managedHandler" />
|
||||||
type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation"
|
<remove name="ApplicationInsightsWebTracking" />
|
||||||
preCondition="integratedMode,managedHandler"/>
|
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />
|
||||||
<remove name="ApplicationInsightsWebTracking"/>
|
|
||||||
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"
|
|
||||||
preCondition="managedHandler"/>
|
|
||||||
</modules>
|
</modules>
|
||||||
<validation validateIntegratedModeConfiguration="false"/>
|
<validation validateIntegratedModeConfiguration="false" />
|
||||||
</system.webServer>
|
</system.webServer>
|
||||||
<system.codedom>
|
<system.codedom>
|
||||||
<compilers>
|
<compilers>
|
||||||
<compiler language="c#;cs;csharp" extension=".cs"
|
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701" />
|
||||||
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
|
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" />
|
||||||
warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701"/>
|
|
||||||
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
|
|
||||||
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
|
|
||||||
warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+"/>
|
|
||||||
</compilers>
|
</compilers>
|
||||||
</system.codedom>
|
</system.codedom>
|
||||||
|
<entityFramework>
|
||||||
|
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
|
||||||
|
<parameters>
|
||||||
|
<parameter value="mssqllocaldb" />
|
||||||
|
</parameters>
|
||||||
|
</defaultConnectionFactory>
|
||||||
|
<providers>
|
||||||
|
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||||
|
</providers>
|
||||||
|
</entityFramework>
|
||||||
</configuration>
|
</configuration>
|
30
WebSiteCode/Cmdjy/CmdjyHisFront/WebSettings.cs
Normal file
30
WebSiteCode/Cmdjy/CmdjyHisFront/WebSettings.cs
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
using System.Configuration;
|
||||||
|
|
||||||
|
namespace CmdjyHisFront
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 网站配置
|
||||||
|
/// </summary>
|
||||||
|
public static class WebSettings
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取配置的值
|
||||||
|
/// </summary>
|
||||||
|
public static string GetValue(string key) {
|
||||||
|
var val = ConfigurationManager.AppSettings[key];
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 自动升级数据库
|
||||||
|
/// </summary>
|
||||||
|
public static bool AutoMigrations {
|
||||||
|
get {
|
||||||
|
var val = GetValue("AutoMigrations");
|
||||||
|
if(bool.TryParse(val,out bool v)) {
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,11 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Antlr" version="3.5.0.2" targetFramework="net461" />
|
<package id="Antlr" version="3.5.0.2" targetFramework="net461" />
|
||||||
|
<package id="Autofac" version="4.9.1" targetFramework="net461" />
|
||||||
|
<package id="Autofac.Mvc5" version="4.0.2" targetFramework="net461" />
|
||||||
<package id="bootstrap" version="3.3.7" targetFramework="net461" />
|
<package id="bootstrap" version="3.3.7" targetFramework="net461" />
|
||||||
|
<package id="CommonClass.Factory" version="1.2.0.8" targetFramework="net461" />
|
||||||
|
<package id="EntityFramework" version="6.2.0" targetFramework="net461" />
|
||||||
<package id="jQuery" version="3.3.1" targetFramework="net461" />
|
<package id="jQuery" version="3.3.1" targetFramework="net461" />
|
||||||
<package id="jQuery.Validation" version="1.17.0" targetFramework="net461" />
|
<package id="jQuery.Validation" version="1.17.0" targetFramework="net461" />
|
||||||
<package id="Microsoft.ApplicationInsights" version="2.5.1" targetFramework="net461" />
|
<package id="Microsoft.ApplicationInsights" version="2.5.1" targetFramework="net461" />
|
||||||
|
|
Loading…
Reference in New Issue
Block a user