//获取列表
[HttpPost]
public ActionResult List(DataSourceRequest command, RemitOrderListModel model)
{
if (_workContext.CurrentCustomer == null)
return null;
var result = 获取数据
var grid = new DataSourceResult()
{
Data = result.Select(x =>
{
var remitListResult = ParPerRemitListModel(x); //转换模型
return remitListResult;
}),
Total = result.TotalCount
};
return Json(grid);
}
//编辑
public ActionResult Edit(int Id)
{
var remitOrder = _remitOrderService.GetRemitOrderById(model.Id);
if (remitOrder == null || remitOrder.Status == 0)
return RedirectToAction("List");
var model = remitOrder.ToModel();
return View(model);
}
//编辑提交
[HttpPost]
public ActionResult Edit(RemitOrderModel model)
{
var remitOrder = _remitOrderService.GetRemitOrderById(model.Id);
if (remitOrder == null || remitOrder.Status == 0)
return RedirectToAction("List");
if (ModelState.IsValid)
{
DoSth();
return RedirectToAction("List");
}
}