mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-04-24 18:04:55 +08:00
85 lines
2.0 KiB
C#
85 lines
2.0 KiB
C#
using System;
|
|
using System.Threading.Tasks;
|
|
using Infrastructure;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using OpenAuth.App;
|
|
using OpenAuth.App.Interface;
|
|
using OpenAuth.App.Request;
|
|
|
|
namespace OpenAuth.Mvc.Controllers
|
|
{
|
|
public class WmsInboundOrderTblsController : BaseController
|
|
{
|
|
private readonly WmsInboundOrderTblApp _app;
|
|
|
|
public WmsInboundOrderTblsController(WmsInboundOrderTblApp app, IAuth auth) : base(auth)
|
|
{
|
|
_app = app;
|
|
}
|
|
|
|
//主页
|
|
public ActionResult Index()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
//添加或修改
|
|
[HttpPost]
|
|
public string Add(AddOrUpdateWmsInboundOrderTblReq obj)
|
|
{
|
|
try
|
|
{
|
|
_app.Add(obj);
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Result.Code = 500;
|
|
Result.Message = ex.Message;
|
|
}
|
|
return JsonHelper.Instance.Serialize(Result);
|
|
}
|
|
|
|
//添加或修改
|
|
[HttpPost]
|
|
public string Update(AddOrUpdateWmsInboundOrderTblReq obj)
|
|
{
|
|
try
|
|
{
|
|
_app.Update(obj);
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Result.Code = 500;
|
|
Result.Message = ex.Message;
|
|
}
|
|
return JsonHelper.Instance.Serialize(Result);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 加载列表
|
|
/// </summary>
|
|
public async Task<string> Load([FromQuery]QueryWmsInboundOrderTblListReq request)
|
|
{
|
|
var objs = await _app.Load(request);
|
|
return JsonHelper.Instance.Serialize(objs);
|
|
}
|
|
|
|
[HttpPost]
|
|
public string Delete(string[] ids)
|
|
{
|
|
try
|
|
{
|
|
_app.Delete(ids);
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Result.Code = 500;
|
|
Result.Message = e.Message;
|
|
}
|
|
|
|
return JsonHelper.Instance.Serialize(Result);
|
|
}
|
|
}
|
|
} |