Exemplo n.º 1
0
 public MediaLogic()
 {
     mediaDAO      = new MediaDAO();
     mediaTable    = new MediaDS.ViewMediaDataTable();
     languageTable = new MediaDS.TabLanguageDataTable();
     genreTable    = new MediaDS.TabGenreDataTable();
     tabMediaTable = new MediaDS.TabMediaDataTable();
 }
Exemplo n.º 2
0
 public MediaLogic()
 {
     mediaDAO            = new MediaDAO();
     mediaTable          = new MediaDS.ViewMediaDataTable();
     languageTable       = new MediaDS.TabLanguageDataTable();
     genreTable          = new MediaDS.TabGenreDataTable();
     directorTable       = new MediaDS.TabDirectorDataTable();
     borrowTable         = new MediaDS.TabBorrowDataTable();
     mediaAvailableTable = new MediaDS.ViewMediaAvailableDataTable();
     mediaBorrowedTable  = new MediaDS.ViewMediaBorrowedDataTable();
 }
Exemplo n.º 3
0
        //Genre tabel ---------------------
        public List <IdAndValue> getAllGenreTable()
        {
            List <IdAndValue> myList = new List <IdAndValue>();

            MediaDS.TabGenreDataTable myData = mediaDAO.getAllGenre();

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

            return(myList);
        }
Exemplo n.º 4
0
        public List <PairModel> ListGenres()
        {
            List <PairModel> list = new List <PairModel>();

            genreTable = mediaDAO.ListGenres();
            foreach (MediaDS.TabGenreRow row in genreTable.Rows)
            {
                PairModel pair = PairModel.Parse(row);
                list.Add(pair);
            }
            return(list);
        }
Exemplo n.º 5
0
        public List <PairModel> ListGenres()
        {
            //unused code from file in canvas that allows list all genres based on TabGenre
            List <PairModel> list = new List <PairModel>();

            genreTable = mediaDAO.ListGenres();
            foreach (MediaDS.TabGenreRow row in genreTable.Rows)
            {
                PairModel pair = PairModel.Parse(row);
                list.Add(pair);
            }
            return(list);
        }
Exemplo n.º 6
0
        public List <PairModel> ListGenre()
        {
            List <PairModel> pairs = new List <PairModel>();

            MediaDS.TabGenreDataTable genreTable = mediaDAO.ListGenre();

            foreach (MediaDS.TabGenreRow row in genreTable.Rows)
            {
                PairModel pair = PairModel.Parse(row);
                pairs.Add(pair);
            }
            return(pairs);
        }
Exemplo n.º 7
0
        public List <PairModel> ListGenre()
        {
            List <PairModel> medias = new List <PairModel>();

            MediaDS.TabGenreDataTable genreTable = mediaDAO.ListGenre();

            foreach (MediaDS.TabGenreRow row in genreTable.Rows)
            {
                PairModel media = PairModel.Parse(row);
                medias.Add(media);
            }
            return(medias);
        }
Exemplo n.º 8
0
        public int getGenreIdByName(string genreName)
        {
            //get data from DAO
            MediaDS.TabGenreDataTable myData = mediaDAO.getGenreByName(genreName);

            int recievedId = -1;

            foreach (MediaDS.TabGenreRow row in myData.Rows) //should only result to one row
            {
                if (row != null)
                {
                    recievedId = row.GID;
                }
            }

            return(recievedId); //if is -1 their is an error
        }
Exemplo n.º 9
0
        //tableGenre
        public List <IdAndValue> parseGenreDataTolist(MediaDS.TabGenreDataTable myDataTable)
        {
            List <IdAndValue> idVal = new List <IdAndValue>();

            foreach (MediaDS.TabGenreRow row in myDataTable.Rows)
            //foreach (UserDS.TabUserRow row in myDataTable.Rows)
            {
                if (row == null)
                {
                    return(null);
                }
                else
                {
                    IdAndValue item = new IdAndValue(row.GID, row.GenreName);
                    idVal.Add(item);
                }
            }
            return(idVal);
        }