You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
99 lines
2.2 KiB
99 lines
2.2 KiB
3 years ago
|
using learun.iapplication;
|
||
|
using Microsoft.AspNetCore.Mvc;
|
||
|
using System.Threading.Tasks;
|
||
|
|
||
|
// For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
||
|
|
||
|
namespace EC.Web.Areas.LR_Desktop.Controllers
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 版 本 EasyCode EC管理后台
|
||
|
/// Copyright (c) 2019-present EC管理有限公司
|
||
|
/// 创建人:tobin
|
||
|
/// 日 期:2019.10.31
|
||
|
/// 描 述:桌面统计数据配置
|
||
|
/// </summary>
|
||
|
[Area("LR_Desktop")]
|
||
|
public class DTTargetController : MvcControllerBase
|
||
|
{
|
||
|
private readonly DTTargetIBLL _dTTargetIBLL;
|
||
|
|
||
|
public DTTargetController(DTTargetIBLL dTTargetIBLL)
|
||
|
{
|
||
|
_dTTargetIBLL = dTTargetIBLL;
|
||
|
}
|
||
|
|
||
|
#region 视图功能
|
||
|
|
||
|
/// <summary>
|
||
|
/// 表单页
|
||
|
/// </summary>
|
||
|
/// <returns></returns>
|
||
|
[HttpGet]
|
||
|
public IActionResult Form()
|
||
|
{
|
||
|
return View();
|
||
|
}
|
||
|
|
||
|
#endregion 视图功能
|
||
|
|
||
|
#region 获取数据
|
||
|
|
||
|
/// <summary>
|
||
|
/// 获取列表数据
|
||
|
/// </summary>
|
||
|
/// <returns></returns>
|
||
|
[HttpGet]
|
||
|
[AjaxOnly]
|
||
|
public async Task<IActionResult> GetList()
|
||
|
{
|
||
|
var data = await _dTTargetIBLL.GetList();
|
||
|
return Success(data);
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 获取表单数据
|
||
|
/// </summary>
|
||
|
/// <param name="keyValue">主键</param>
|
||
|
/// <returns></returns>
|
||
|
[HttpGet]
|
||
|
[AjaxOnly]
|
||
|
public async Task<IActionResult> GetFormData(string keyValue)
|
||
|
{
|
||
|
var data = await _dTTargetIBLL.GetEntity(keyValue);
|
||
|
return Success(data);
|
||
|
}
|
||
|
|
||
|
#endregion 获取数据
|
||
|
|
||
|
#region 提交数据
|
||
|
|
||
|
/// <summary>
|
||
|
/// 删除实体数据
|
||
|
/// </summary>
|
||
|
/// <param name="keyValue">主键</param>
|
||
|
/// <returns></returns>
|
||
|
[HttpPost]
|
||
|
[AjaxOnly]
|
||
|
public async Task<IActionResult> DeleteForm(string keyValue)
|
||
|
{
|
||
|
await _dTTargetIBLL.DeleteEntity(keyValue);
|
||
|
return SuccessInfo("删除成功!");
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 保存实体数据(新增、修改)
|
||
|
/// </summary>
|
||
|
/// <param name="keyValue">主键</param>
|
||
|
/// <returns></returns>
|
||
|
[HttpPost]
|
||
|
[AjaxOnly]
|
||
|
public async Task<IActionResult> SaveForm(string keyValue, DTTargetEntity entity)
|
||
|
{
|
||
|
await _dTTargetIBLL.SaveEntity(keyValue, entity);
|
||
|
return SuccessInfo("保存成功!");
|
||
|
}
|
||
|
|
||
|
#endregion 提交数据
|
||
|
}
|
||
|
}
|