CompanyController.cs
1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using HHECS.Application.Service;
using HHECS.Model.Entities;
using Microsoft.AspNetCore.Mvc;
namespace HHECS.Web.Areas.Base.Controllers
{
[Area("Base")]
public class CompanyController : BaseController
{
readonly CompanyService _companyService;
public CompanyController(CompanyService companyService)
{
_companyService = companyService;
}
[ServiceFilter(typeof(OperLogFilter))]
public IActionResult Index()
{
return View();
}
[HttpPost]
public string Load(PageReq pageRequest, Company entity)
{
return _companyService.Load(entity, pageRequest);
}
#region 提交数据
/// <summary>
/// 新增数据
/// </summary>
/// <param name="entity">新增实例</param>
/// <returns></returns>
[HttpPost]
[XSSFilter]
[ServiceFilter(typeof(OperLogFilter))]
public string Ins(Company entity)
{
return _companyService.Ins(entity, User);
}
/// <summary>
/// 修改数据
/// </summary>
/// <param name="entity">修改实例</param>
/// <returns></returns>
[HttpPost]
[XSSFilter]
[ServiceFilter(typeof(OperLogFilter))]
public string Upd(Company entity)
{
return _companyService.Upd(entity, User);
}
[HttpPost]
[ServiceFilter(typeof(OperLogFilter))]
public string DelByIds(int[] ids)
{
return _companyService.DelByIds(ids);
}
#endregion
}
}