示例#1
0
        public List <MediaModel> ListMediaByTitle(string title)
        {
            List <MediaModel> medias = new List <MediaModel>();

            MediaDS.ViewMediaDataTable mediaTable = mediaDAO.ListMediaByTitle(title);

            foreach (MediaDS.ViewMediaRow row in mediaTable.Rows)
            {
                MediaModel media = MediaModel.Parse(row);
                medias.Add(media);
            }
            return(medias);
        }
示例#2
0
        public List <MediaModel> ListMediaByBudget(int budget)
        {
            List <MediaModel> medias = new List <MediaModel>();

            MediaDS.ViewMediaDataTable mediaTable = mediaDAO.ListMediaByBudget(budget);

            foreach (MediaDS.ViewMediaRow row in mediaTable.Rows)
            {
                MediaModel media = MediaModel.Parse(row);
                medias.Add(media);
            }
            return(medias);
        }
示例#3
0
        public List <MediaModel> ListMedia()
        {
            //empty list of media models to start us off
            List <MediaModel> medias = new List <MediaModel>();

            MediaDS.ViewMediaDataTable mediaTable = mediaDAO.ListMedia();

            foreach (MediaDS.ViewMediaRow row in mediaTable.Rows)
            {
                //create a model representing that row
                MediaModel media = MediaModel.Parse(row);
                medias.Add(media);//add it to our list of media
            }
            return(medias);
        }
        public static MediaModel Parse(MediaDS.ViewMediaRow mediaRow)
        {
            if (mediaRow == null)
            {
                return(null);
            }

            MediaModel media = new MediaModel();

            media.MediaId     = mediaRow.MediaID;
            media.MediaName   = mediaRow.Title;
            media.PublishYear = mediaRow.PublishYear;
            media.GenreName   = mediaRow.GenreName;
            media.director    = mediaRow.DirectorName;
            media.Language    = mediaRow.LanguageName;
            media.Budget      = mediaRow.Budget.ToString();
            return(media);
        }
示例#5
0
        public static MediaModel Parse(MediaDS.ViewMediaRow mediaRow)
        {
            if (mediaRow == null)
            {
                return(null);
            }

            MediaModel media = new MediaModel();

            media.MediaId      = mediaRow.MediaID;
            media.MediaName    = mediaRow.Title;
            media.PublishYear  = mediaRow.PublishYear;
            media.Budget       = (int)mediaRow.Budget;
            media.GenreName    = mediaRow.GenreName;
            media.DirectorName = mediaRow.DirectorName;
            media.LanguageName = mediaRow.LanguageName;
            media.setGenre(mediaRow.Genre);
            media.setLanguage(mediaRow.Language);
            media.setDirector(mediaRow.Director);

            return(media);
        }