public ActionResult EditOnPost(EditDiscoveryViewModel editDiscovery) { var result = new DataJsonResult(); Models.Discovery model = new Models.Discovery(); if (editDiscovery.Id != Guid.Empty) { model = _currencyService.GetSingleById <Models.Discovery>(editDiscovery.Id); } model.Title = editDiscovery.Title; model.Source = editDiscovery.Source; model.Content = editDiscovery.Content; model.Blurb = editDiscovery.Blurb; model.Author = editDiscovery.Author; model.Id = _discoveryService.SaveDiscovery(model, editDiscovery.Goods); if (model.Id != Guid.Empty) { //添加图片关联关系 _storageFileService.ReplaceFile(model.Id, DiscoveryModule.Key, DiscoveryModule.DisplayName, editDiscovery.DiscoveryImages, DiscoveryImages); } else { result.ErrorMessage = "保存失败"; } return(Json(result)); }