示例#1
0
        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");
        }
示例#2
0
        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("Виедо не выбрано");
        }
示例#3
0
        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);
                }
            }
        }