// 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); } }
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); } }
public int AddMedia(string title, int genreId, int directorId, int languageId, int year, decimal budget) { return(tabMediaTableAdapter.InsertMedia(title, genreId, directorId, languageId, year, budget)); }
public int InsertMedia(string title, int genre, int director, int language, int publishYear, int budget) { return(MediaTableAdapter.InsertMedia(title, genre, director, language, publishYear, budget)); }
public int InsertMedia(string Title, int Genre, int Director, int Language, int PublishYear, decimal Budget) { return(mediaTableAdapter.InsertMedia(Title, Genre, Director, Language, PublishYear, Budget)); }