public bool Modify(iPow.Infrastructure.Data.DataSys.Sys_VideoInfo entity, iPow.Infrastructure.Data.DataSys.Sys_AdminUser operUser) { var res = false; if (entity != null && entity.VideoID > 0) { try { videoInfoRepository.Modify(entity); res = true; } catch (Exception ex) { } } return(res); }
public bool DeleteTrue(iPow.Infrastructure.Data.DataSys.Sys_VideoInfo entity, iPow.Infrastructure.Data.DataSys.Sys_AdminUser operUser) { var res = false; if (entity != null) { try { videoInfoRepository.Delete(entity); videoInfoRepository.Uow.Commit(); res = true; } catch (Exception ex) { } } return(res); }
/// <summary> /// Inits the sight video info. /// 随机选取一个视频来给一个景区 /// </summary> /// <param name="sight">The sight.</param> public iPow.Domain.Dto.Sys_VideoInfoDto GetVideoRandSingleBySight(int sightId) { iPow.Infrastructure.Data.DataSys.Sys_VideoInfo vi = null; var rand = new Random(); var temp = (from e in videoInfoRepository.GetList() where e.SightID == sightId && e.IsDelete == 0 select e).Count(); if (temp > 0) { var toSkip = rand.Next(0, temp); vi = (from e in videoInfoRepository.GetList() where e.SightID == sightId && e.IsDelete == 0 orderby e.AddTime descending select e).Skip(toSkip).Take(1).FirstOrDefault(); } var dto = vi.ToDto(); return(dto); }
public bool Delete(iPow.Infrastructure.Data.DataSys.Sys_VideoInfo entity, iPow.Infrastructure.Data.DataSys.Sys_AdminUser operUser) { throw new NotImplementedException(); }