Exemplo n.º 1
0
        public bool SalvaVideoNelDatabase(string Filename, string ConnectedUser)
        {
            VideoDS ds = new VideoDS();

            using (VideoBusiness bVideo = new VideoBusiness())
            {
                try
                {
                    bVideo.FillRW_VIDEO(ds);

                    if (ds.RW_VIDEO.Where(x => x.NOMEVIDEO == Filename && x.PATHVIDEO == @"~\Video").Count() == 0)
                    {
                        VideoDS.RW_VIDEORow VideoB = ds.RW_VIDEO.NewRW_VIDEORow();
                        VideoB.NOMEVIDEO = Filename;
                        VideoB.PATHVIDEO = @"~\Video";


                        VideoB.UTENTE          = ConnectedUser;
                        VideoB.DATAINSERIMENTO = DateTime.Now;

                        ds.RW_VIDEO.AddRW_VIDEORow(VideoB);
                        bVideo.UpdateVideoDS(ds.RW_VIDEO.TableName, ds);
                    }
                    return(true);
                }
                catch //(Exception ex)
                {
                    bVideo.Rollback();
                    throw;
                }
            }
        }
Exemplo n.º 2
0
        public string LeggiVideo(string reparto)
        {
            string Path = string.Empty;

            using (VideoBusiness bVideo = new VideoBusiness())
            {
                VideoDS ds = new VideoDS();
                bVideo.FillRW_VIDEO(ds);
                bVideo.FillRW_VIDEO_REPARTI(ds);

                //VideoDS.RW_VIDEO_REPARTIRow VideoR = ds.RW_VIDEO_REPARTI.NewRW_VIDEO_REPARTIRow();

                VideoDS.RW_VIDEO_REPARTIRow VideoR = ds.RW_VIDEO_REPARTI.Where(x => x.REPARTO == reparto &&
                                                                               x.DATAINIZIO <= System.DateTime.Today &&
                                                                               x.DATAFINE >= System.DateTime.Today).FirstOrDefault();
                if (VideoR != null)
                {
                    //VideoDS.RW_VIDEORow Video = ds.RW_VIDEO.NewRW_VIDEORow();
                    VideoDS.RW_VIDEORow Video = ds.RW_VIDEO.Where(x => x.IDVIDEO == VideoR.IDVIDEO).FirstOrDefault();
                    if (Video != null)
                    {
                        Path = Video.PATHVIDEO + "\\" + Video.NOMEVIDEO;
                    }
                }
            }
            return(Path);
        }