abp(net core)+easyui+efcore实现仓储管理系统――EasyUI之货物管理六(二十四)

匿名 (未验证) 提交于 2019-12-03 00:15:02

abp(net core)+easyui+efcore实现仓储管理系统――领域层创建实体(三)

abp(net core)+easyui+efcore实现仓储管理系统――定义仓储并实现 (四)

abp(net core)+easyui+efcore实现仓储管理系统――创建应用服务(五)

abp(net core)+easyui+efcore实现仓储管理系统――展现层实现增删改查之控制器(六)

abp(net core)+easyui+efcore实现仓储管理系统――展现层实现增删改查之列表视图(七)

abp(net core)+easyui+efcore实现仓储管理系统――展现层实现增删改查之增删改视图(八)

abp(net core)+easyui+efcore实现仓储管理系统――展现层实现增删改查之菜单与测试(九)

abp(net core)+easyui+efcore实现仓储管理系统――多语言(十)

abp(net core)+easyui+efcore实现仓储管理系统――使用 WEBAPI实现CURD (十一)

abp(net core)+easyui+efcore实现仓储管理系统――菜单-上 (十六)

abp(net core)+easyui+efcore实现仓储管理系统――EasyUI前端页面框架 (十八)

abp(net core)+easyui+efcore实现仓储管理系统――EasyUI之货物管理一 (十九)

abp(net core)+easyui+efcore实现仓储管理系统――EasyUI之货物管理二 (二十)

abp(net core)+easyui+efcore实现仓储管理系统――EasyUI之货物管理五 (二十三) 文章中,我们修正了一些BUG,让货物信息管理的前端与后台功能基本实现了我们所要。现在我们运行起应用程序看看新增功能。

十五、新增货物信息

protected dynamic JsonEasyUIResult(int id,string result) {      string strId = string.Empty;     if (id>0)     {         strId = id.ToString();     }          var obj = new     {         result = result,         Id = strId      };      var json = ABP.TPLMS.Helpers.JsonHelper.Instance.Serialize(obj);      return json; }

 public ActionResult Add(CargoDto createDto)         {             var json = string.Empty;             string result = "NO";             if (createDto == null)             {                 json = JsonEasyUIResult(0, result);                 return Content(json);              }             try             {                 var cargo = ObjectMapper.Map<CreateUpdateCargoDto>(createDto);                  // TODO: Add logic here                 var obj = _cargoAppService.Create(cargo);                 int id = obj.GetAwaiter().GetResult().Id;                 if (obj != null)                 {                     json = JsonEasyUIResult(id, "OK");                  }                 else                  {                     json = JsonEasyUIResult(0,result);                  }             }             catch              {             }             return Content(json);          }

abp(net core)+easyui+efcore实现仓储管理系统――菜单-上 (十六) )。

具体错误信息如下:

AbpValidationException: Method arguments are not valid! See ValidationErrors for details.

Abp.Runtime.Validation.Interception.MethodInvocationValidator.ThrowValidationError() in MethodInvocationValidator.cs, line 118

EnableValidation和DisableValidation 用来控制validation。我们在Add方法上面添加两个特性[HttpPost]与[DisableValidation]。

[HttpPost] [DisableValidation] public ActionResult Add(CargoDto createDto)  {… 代码见第2步。}

10.重新从第3步到第7步。这次保存成功。见下图。


易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!