public static void AddManga(int airedid, int chaps, int genreid, string mname, int myear, int pubid, string shortd, int thomes) { AnimeDataContext db = new AnimeDataContext(); Manga adt = new Manga {AiredID = airedid, Chapters = chaps, GenreID = genreid, MangaName = mname, MangaYear = myear, PublisherID = pubid, ShortDescription = shortd, Thomes = thomes}; db.Mangas.InsertOnSubmit(adt); db.SubmitChanges(); }
public static MangaConstructModel[] ReturnAllMangaNamesByGenre(int genID, ref Manga[] anit) { AnimeDataContext db = new AnimeDataContext(); MangaConstructModel[] temp = (from tp in db.Mangas join pub in db.Publishers on tp.PublisherID equals pub.PublisherID join gen in db.Genres on tp.GenreID equals gen.GenreID join air in db.AiredYets on tp.AiredID equals air.AiredID where tp.GenreID == genID select new MangaConstructModel(tp.MangaName, pub.PublisherName, tp.MangaYear, tp.MangaName, tp.ShortDescription, tp.Chapters, tp.Thomes, air.AiredName, gen.GenreName)).ToArray(); anit = (from tp in db.Mangas join pub in db.Publishers on tp.PublisherID equals pub.PublisherID join gen in db.Genres on tp.GenreID equals gen.GenreID join air in db.AiredYets on tp.AiredID equals air.AiredID where tp.GenreID == genID select tp).ToArray(); return temp; }
private void detach_Mangas(Manga entity) { this.SendPropertyChanging(); entity.AiredYet = null; }
private void attach_Mangas(Manga entity) { this.SendPropertyChanging(); entity.AiredYet = this; }
partial void DeleteManga(Manga instance);
partial void UpdateManga(Manga instance);
partial void InsertManga(Manga instance);
private void detach_Mangas(Manga entity) { this.SendPropertyChanging(); entity.Publisher = null; }
private void attach_Mangas(Manga entity) { this.SendPropertyChanging(); entity.Publisher = this; }
private void attach_Mangas(Manga entity) { this.SendPropertyChanging(); entity.Genre = this; }
// searches by genre public static MangaConstructModel[] ReturnAllFavMangaByGenre(string genrename, ref Manga[] anit) { AnimeDataContext db = new AnimeDataContext(); MangaConstructModel[] tmp = MangaModel.ReturnAllMangaNamesByGenre(GenreModel.ReturnGenreID(genrename), ref anit); return tmp; }