Browse Source

Update

master
fanwensheng 3 years ago
parent
commit
d4f7670746
  1. 3
      04.系统编码/App/Controllers/ConfigManagementController.cs
  2. 2
      04.系统编码/App/Controllers/OrgManagementController.cs
  3. 4
      04.系统编码/App/Controllers/StatisticAnalysisController.cs
  4. 2
      04.系统编码/App/Controllers/UserManagementController.cs
  5. 3
      04.系统编码/BLL/BLL.csproj
  6. 4
      04.系统编码/BLL/ConfigBLL.cs
  7. 2
      04.系统编码/BLL/OrgBLL.cs
  8. 2
      04.系统编码/BLL/UserBLL.cs
  9. 6
      04.系统编码/DAL/ConfigDAL.cs
  10. 3
      04.系统编码/DAL/DAL.csproj
  11. 5
      04.系统编码/DAL/OrgDAL.cs
  12. 8
      04.系统编码/DAL/UserDAL.cs
  13. 4
      04.系统编码/Model/Model.csproj
  14. 20
      04.系统编码/Model/Pagination.cs

3
04.系统编码/App/Controllers/ConfigManagementController.cs

@ -1,5 +1,6 @@
using PetaPoco;
using System.Web.Mvc;
using System.Collections.Generic;
using Pingchuan.BeijingSafeguard.BLL;
using Pingchuan.BeijingSafeguard.Model;
@ -19,7 +20,7 @@ namespace Pingchuan.BeijingSafeguard.App.Controllers
return ConfigBLL.Update(config);
}
public static Page<Config> Query(int pageIndex, int pageSize)
public static List<Config> Query(int pageIndex, int pageSize)
{
return ConfigBLL.Query(pageIndex, pageSize);
}

2
04.系统编码/App/Controllers/OrgManagementController.cs

@ -38,7 +38,7 @@ namespace Pingchuan.BeijingSafeguard.App.Controllers
[HttpPost]
public JsonResult Query(int pageIndex, int pageSize)
{
Page<Org> orgs = OrgBLL.Query(pageIndex, pageSize);
Pagination<Org> orgs = OrgBLL.Query(pageIndex, pageSize);
return Json(orgs);
}
}

4
04.系统编码/App/Controllers/StatisticAnalysisController.cs

@ -1,4 +1,4 @@
using PetaPoco;
using System;
using System.Web.Mvc;
using Pingchuan.BeijingSafeguard.BLL;
@ -17,7 +17,7 @@ namespace Pingchuan.BeijingSafeguard.App.Controllers
[HttpPost]
public JsonResult Query(int pageIndex, int pageSize)
{
Page<User> users = UserBLL.Query(pageIndex, pageSize);
Pagination<User> users = UserBLL.Query(pageIndex, pageSize);
return Json(users);
}
}

2
04.系统编码/App/Controllers/UserManagementController.cs

@ -38,7 +38,7 @@ namespace Pingchuan.BeijingSafeguard.App.Controllers
[HttpPost]
public JsonResult Query(int pageIndex, int pageSize)
{
Page<User> users = UserBLL.Query(pageIndex, pageSize);
Pagination<User> users = UserBLL.Query(pageIndex, pageSize);
return Json(users);
}
}

3
04.系统编码/BLL/BLL.csproj

@ -68,8 +68,5 @@
<Name>Utility</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

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

@ -1,5 +1,5 @@
using System;
using PetaPoco;
using System.Collections.Generic;
using Pingchuan.BeijingSafeguard.DAL;
using Pingchuan.BeijingSafeguard.Model;
@ -13,7 +13,7 @@ namespace Pingchuan.BeijingSafeguard.BLL
return ConfigDAL.Update(config);
}
public static Page<Config> Query(int pageIndex, int pageSize)
public static List<Config> Query(int pageIndex, int pageSize)
{
return ConfigDAL.Query(pageIndex, pageSize);
}

2
04.系统编码/BLL/OrgBLL.cs

@ -25,7 +25,7 @@ namespace Pingchuan.BeijingSafeguard.BLL
return OrgDAL.Delete(id);
}
public static Page<Org> Query(int pageIndex, int pageSize)
public static Pagination<Org> Query(int pageIndex, int pageSize)
{
return OrgDAL.Query(pageIndex, pageSize);
}

2
04.系统编码/BLL/UserBLL.cs

@ -38,7 +38,7 @@ namespace Pingchuan.BeijingSafeguard.BLL
return UserDAL.Delete(id);
}
public static Page<User> Query(int pageIndex, int pageSize)
public static Pagination<User> Query(int pageIndex, int pageSize)
{
return UserDAL.Query(pageIndex, pageSize);
}

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

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using PetaPoco;
using Pingchuan.BeijingSafeguard.Model;
@ -11,10 +12,11 @@ namespace Pingchuan.BeijingSafeguard.DAL
return db.Update(config);
}
public static Page<Config> Query(int pageIndex, int pageSize)
public static List<Config> Query(int pageIndex, int pageSize)
{
string sql = $@"select * from configs order by id desc";
return db.Page<Config>(pageIndex, pageSize, sql);
Page<Config> page = db.Page<Config>(pageIndex, pageSize, sql);
return page.Items;
}
}
}

3
04.系统编码/DAL/DAL.csproj

@ -68,8 +68,5 @@
<Name>Utility</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

5
04.系统编码/DAL/OrgDAL.cs

@ -27,10 +27,11 @@ namespace Pingchuan.BeijingSafeguard.DAL
return db.Execute(sql);
}
public static Page<Org> Query(int pageIndex, int pageSize)
public static Pagination<Org> Query(int pageIndex, int pageSize)
{
string sql = $@"select * from orgs order by create_time desc";
return db.Page<Org>(pageIndex, pageSize, sql);
Page<Org> orgs = db.Page<Org>(pageIndex, pageSize, sql);
return Pagination<Org>.FromPage(orgs);
}
}
}

8
04.系统编码/DAL/UserDAL.cs

@ -1,4 +1,5 @@
using PetaPoco;
using System;
using PetaPoco;
using Pingchuan.BeijingSafeguard.Model;
namespace Pingchuan.BeijingSafeguard.DAL
@ -42,10 +43,11 @@ namespace Pingchuan.BeijingSafeguard.DAL
return db.Execute(sql);
}
public static Page<User> Query(int pageIndex, int pageSize)
public static Pagination<User> Query(int pageIndex, int pageSize)
{
string sql = $@"select * from users order by create_time desc";
return db.Page<User>(pageIndex, pageSize, sql);
Page<User> users = db.Page<User>(pageIndex, pageSize, sql);
return Pagination<User>.FromPage(users);
}
}
}

4
04.系统编码/Model/Model.csproj

@ -49,6 +49,7 @@
<Compile Include="GmapNetCache.cs" />
<Compile Include="Config.cs" />
<Compile Include="Org.cs" />
<Compile Include="Pagination.cs" />
<Compile Include="RealPoint.cs" />
<Compile Include="Task.cs" />
<Compile Include="Tag.cs" />
@ -61,8 +62,5 @@
<Name>Utility</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

20
04.系统编码/Model/Pagination.cs

@ -0,0 +1,20 @@
using System;
using PetaPoco;
using System.Collections.Generic;
namespace Pingchuan.BeijingSafeguard.Model
{
public class Pagination<T>
{
public long total { get; set; }
public List<T> rows { get; set; }
public static Pagination<T> FromPage(Page<T> page)
{
Pagination<T> pagination = new Pagination<T>();
pagination.total = page.TotalItems;
pagination.rows = page.Items;
return pagination;
}
}
}
Loading…
Cancel
Save