Exemple #1
0
 public MediaLogic()
 {
     mediaDAO      = new MediaDAO();
     mediaTable    = new MediaDS.ViewMediaDataTable();
     languageTable = new MediaDS.TabLanguageDataTable();
     genreTable    = new MediaDS.TabGenreDataTable();
     tabMediaTable = new MediaDS.TabMediaDataTable();
 }
Exemple #2
0
        //functions ---------

        private List <TabMedia> parseTabMediaDataTolistAll(MediaDS.TabMediaDataTable myData)
        {
            List <TabMedia> mediaList = new List <TabMedia>();

            foreach (MediaDS.TabMediaRow row in myData.Rows)
            {
                if (row == null)
                {
                    return(null);
                }
                else
                {
                    TabMedia mTabItem = new TabMedia(row.MediaID, row.Title, row.PublishYear, row.Budget, row.Genre, row.Director, row.Language);
                    mediaList.Add(mTabItem);
                }
            }

            return(mediaList);
        }
Exemple #3
0
        public bool getDirectorExists(int directorId)
        {
            List <TabMedia> myList = new List <TabMedia>();

            MediaDS.TabMediaDataTable myData = mediaDAO.getDirectorExists(directorId);

            //parse data from datatable rows to list elements
            myList = parseTabMediaDataTolistAll(myData);

            // results list count == 0
            if (myList.Count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }