Esempio n. 1
0
        private void CheckPaths()
        {
            String    strQuery      = "Select * from videos";
            ArrayList alAllEntries  = vdb.GetMovieList(strQuery);
            ArrayList alSearchPaths = vdb.GetSearchPaths();

            foreach (DisplayData dd in alAllEntries)
            {
                vdb.MovieName = dd.MovieName;
                if (!File.Exists(vdb.Location))
                {
                    vdb.RemoveMovie(dd.MovieName);
                }
                // Remove if parent path is not a search path
                Boolean bRemove = true;
                foreach (String sp in alSearchPaths)
                {
                    if (!(vdb.Location == null) && (vdb.Location.Contains(sp)))
                    {
                        bRemove = false;
                    }
                }
                if (bRemove)
                {
                    // It should be removed
                    vdb.RemoveMovie(dd.MovieName);
                }
            }
        }
Esempio n. 2
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            dgvSearchList.Rows.Clear();
            String    strQuery     = GetQuery();
            ArrayList alSearchList = vdb.GetMovieList(strQuery);

            lblResultCount.Text = alSearchList.Count.ToString();

            foreach (DisplayData dd in alSearchList)
            {
                dgvSearchList.Rows.Add();
                dgvSearchList.Rows[dgvSearchList.RowCount - 1].Cells["Video"].Value = dd.MovieName;

                // Get the location of the video
                vdb.MovieName = dd.MovieName;
                String strFilePath = vdb.Location;

                if (File.Exists(strFilePath))
                {
                    dgvSearchList.Rows[dgvSearchList.RowCount - 1].Cells["Availability"].Style.ForeColor = Color.Green;
                    dgvSearchList.Rows[dgvSearchList.RowCount - 1].Cells["Availability"].Value           = "YES";
                }
                else
                {
                    dgvSearchList.Rows[dgvSearchList.RowCount - 1].Cells["Availability"].Style.ForeColor = Color.Red;
                    dgvSearchList.Rows[dgvSearchList.RowCount - 1].Cells["Availability"].Value           = "NO";
                }
            }
        }