Browse Source

Add config controller

master
fanwensheng 3 years ago
parent
commit
945ecbf566
  1. 2
      04.系统编码/App/App.csproj
  2. 2
      04.系统编码/App/App.csproj.user
  3. 25
      04.系统编码/App/Controllers/ConfigController.cs
  4. 5
      04.系统编码/BLL/ConfigBLL.cs
  5. 6
      04.系统编码/DAL/ConfigDAL.cs

2
04.系统编码/App/App.csproj

@ -129,6 +129,7 @@
<Compile Include="App_Start\FilterConfig.cs" />
<Compile Include="App_Start\RouteConfig.cs" />
<Compile Include="Controllers\BaseController.cs" />
<Compile Include="Controllers\ConfigController.cs" />
<Compile Include="Controllers\ConfigManagementController.cs" />
<Compile Include="Controllers\OrgManagementController.cs" />
<Compile Include="Controllers\PointController.cs" />
@ -342,6 +343,7 @@
<ItemGroup>
<Folder Include="App_Data\" />
<Folder Include="Models\" />
<Folder Include="Views\Config\" />
</ItemGroup>
<ItemGroup>
<Content Include="Content\scripts\beijing\wind-template.json" />

2
04.系统编码/App/App.csproj.user

@ -16,7 +16,7 @@
<WebStackScaffolding_IsReferencingScriptLibrariesSelected>False</WebStackScaffolding_IsReferencingScriptLibrariesSelected>
<WebStackScaffolding_LayoutPageFile />
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Controller</Controller_SelectedScaffolderCategoryPath>
<Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
<WebStackScaffolding_ControllerDialogWidth>600</WebStackScaffolding_ControllerDialogWidth>
<WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
<NameOfLastUsedPublishProfile>E:\2021\Metro\BeijingSafeguard\04.系统编码\App\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>

25
04.系统编码/App/Controllers/ConfigController.cs

@ -0,0 +1,25 @@
using System;
using System.Web.Mvc;
using System.Collections.Generic;
using Pingchuan.BeijingSafeguard.BLL;
using Pingchuan.BeijingSafeguard.Model;
namespace Pingchuan.BeijingSafeguard.App.Controllers
{
public class ConfigController : Controller
{
// GET: Config
public ActionResult Index()
{
return View();
}
[HttpPost]
public JsonResult All()
{
List<Config> configs = ConfigBLL.All();
return Json(configs);
}
}
}

5
04.系统编码/BLL/ConfigBLL.cs

@ -17,5 +17,10 @@ namespace Pingchuan.BeijingSafeguard.BLL
{
return ConfigDAL.Query(pageIndex, pageSize);
}
public static List<Config> All()
{
return ConfigDAL.All();
}
}
}

6
04.系统编码/DAL/ConfigDAL.cs

@ -18,5 +18,11 @@ namespace Pingchuan.BeijingSafeguard.DAL
Page<Config> page = db.Page<Config>(pageIndex, pageSize, sql);
return page.Items;
}
public static List<Config> All()
{
string sql = $@"select * from configs";
return db.Fetch<Config>(sql);
}
}
}
Loading…
Cancel
Save