コード例 #1
0
        // add new media row into Media table
        public bool IsMediaInserted(MediaDTO newMedia)
        {
            int dID = GetDID(newMedia.Director);
            int gID = GetGID(newMedia.Genre);
            int lID = GetLID(newMedia.Language);

            try
            {
                if (dID != -1 && gID != -1 && lID != -1)
                {
                    // insert row using query
                    tabMediaTableAdapter.InsertMedia(newMedia.Title, gID, dID, lID, newMedia.PublishYear, newMedia.Budget);
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                return(false);
            }
        }
コード例 #2
0
 public int InsertMedia(string title, int genre, int director, int language, int publishYear, decimal budget)
 {
     try
     {
         int rowsAffected = tabMediaTableAdapter.InsertMedia(title, genre, director, language, publishYear, budget);
         return(rowsAffected);
     }
     catch (Exception)
     {
         return(0);
     }
 }
コード例 #3
0
ファイル: MediaDAO.cs プロジェクト: Marcus-V/ES2021
 public int AddMedia(string title, int genreId, int directorId, int languageId, int year, decimal budget)
 {
     return(tabMediaTableAdapter.InsertMedia(title, genreId, directorId, languageId, year, budget));
 }
コード例 #4
0
 public int InsertMedia(string title, int genre, int director, int language, int publishYear, int budget)
 {
     return(MediaTableAdapter.InsertMedia(title, genre, director, language, publishYear, budget));
 }
コード例 #5
0
 public int InsertMedia(string Title, int Genre, int Director, int Language, int PublishYear, decimal Budget)
 {
     return(mediaTableAdapter.InsertMedia(Title, Genre, Director, Language, PublishYear, Budget));
 }