public VRequestInfo SaveNavigationImgPlays(ImgPlayDto input) { if (input.NavigationID != -1) { var navModel = navigationRepositrory.Query(input.NavigationID); if (navModel == null || navModel.Id == 0) { return(VRequestInfo.ErrorResult("导航不存在")); } } bool res = false; if (input.Id == 0) { input.IsDisable = Models.Enum.EYesOrNo.No; input.CreateTime = DateTime.Now; res = playInfoRepository.Insert(ModelConvertUtil <ImgPlayDto, ImgPlayInfo> .ModelCopy(input)) > 0; } else { var model = ModelConvertUtil <ImgPlayDto, ImgPlayInfo> .ModelCopy(input); res = playInfoRepository.Update(model); } if (res) { return(VRequestInfo.SuccessResult()); } else { return(VRequestInfo.ErrorResult("保存失败")); } }
public IActionResult SlideshowSave(ImgPlayDto input) { if (!ModelState.IsValid) { return(ShowError(GetModelError(ModelState))); } input.ImgUrl = UrlCommon.GetUrlPath(Config.OtherService.Gateway, input.ImgUrl); var res = pageMngService.SaveNavigationImgPlays(input); return(new JsonResult(res)); }