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 async Task <NavigationDto> GetNavigationsAsync(int navId) { var naviagation = await Task.Run(() => navigationRepositrory.Query(navId)); if (naviagation == null) { naviagation = new NavigationInfo(); } return(ModelConvertUtil <NavigationInfo, NavigationDto> .ModelCopy(naviagation)); }