Beispiel #1
0
        public async Task <IActionResult> Create(ModuleModel model)
        {
            if (!ModelState.IsValid)
            {
                return(Json(ResultDto.Err("数据验证失败")));
            }
            var module = model.MapTo <Module>();

            module.CreatorTime = DateTime.Now;
            var r = await ModuleApp.CreateAsync(module);

            return(Json(r));
        }
        public async Task <IActionResult> Create(ModuleModel model)
        {
            if (!ModelState.IsValid)
            {
                return(Operation(false, "数据验证失败"));
            }
            Module module = MapperHelper.Map <ModuleModel, Module>(model);

            module.Id          = module.CreateId();
            module.CreatorTime = DateTime.Now;
            var r = await ModuleApp.CreateAsync(module);

            return(Operation(r.IsSuc, r.IsSuc ? "数据添加成功" : r.Msg));
        }