public void ChangeVideo(ModelVideo oldVideo, ModelVideo newVideo) { if (oldVideo != null && newVideo != null) { oldVideo.Name = newVideo.Name; oldVideo.IconType = newVideo.IconType; oldVideo.PathIcon = newVideo.PathIcon; oldVideo.ItemPath = newVideo.ItemPath; oldVideo.TypeItem = newVideo.TypeItem; oldVideo.MonitorNumber = newVideo.MonitorNumber; oldVideo.VrSettingPath = newVideo.VrSettingPath; oldVideo.FileMotion = newVideo.FileMotion; oldVideo.TimeOut = newVideo.TimeOut; oldVideo.PathToBannerVideo = newVideo.PathToBannerVideo; context.SaveChanges(); if (oldVideo.TypeItem == TypeItem.Video360) { if (RefreshTableVideo360 != null) { RefreshTableVideo360.Invoke(this, null); } } if (oldVideo.TypeItem == TypeItem.Video5D) { if (RefreshTableVideo5D != null) { RefreshTableVideo5D.Invoke(this, null); } } return; } throw new Exception("Video not found"); }
public void DeleteVideo(ModelVideo video) { if (video != null) { context.Videos.Remove(video); context.SaveChanges(); if (video.TypeItem == TypeItem.Video360) { if (RefreshTableVideo360 != null) { RefreshTableVideo360.Invoke(this, null); } } if (video.TypeItem == TypeItem.Video5D) { if (RefreshTableVideo5D != null) { RefreshTableVideo5D.Invoke(this, null); } } return; } throw new Exception("Виедо не выбрано"); }
public void AddVideo(ModelVideo video) { context.Videos.Add(video); context.SaveChanges(); if (video.TypeItem == TypeItem.Video360) { if (RefreshTableVideo360 != null) { RefreshTableVideo360.Invoke(this, null); } } if (video.TypeItem == TypeItem.Video5D) { if (RefreshTableVideo5D != null) { RefreshTableVideo5D.Invoke(this, null); } } }