// returns all names by genre and.. oh shit =O public static AnimeConstructModel[] ReturnAllAnimeNamesByGenre(int genID, ref Anime[] anit) { AnimeDataContext db = new AnimeDataContext(); AnimeConstructModel[] temp = (from tp in db.Animes join ma in db.Mangas on tp.MangaID equals ma.MangaID join st in db.Studios on tp.StudioID equals st.StudioID join sty in db.SerialTypes on tp.SerialTypeID equals sty.SerialTypeID 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 AnimeConstructModel(ma.MangaName, st.StudioName, tp.AniYear, tp.TitleName, sty.SerialName, gen.GenreName, tp.ShortDescription, tp.Episodes, air.AiredName)).ToArray(); anit = (from tp in db.Animes where tp.GenreID == genID select tp).ToArray(); return temp; }
// adds title public static void AddAnime(int manid, int studid, int ayear, string tname, int stypeid, int genid, string shortdesc, int eps, int airedid) { AnimeDataContext db = new AnimeDataContext(); Anime adt = new Anime { MangaID = manid, StudioID = studid, AniYear = ayear, TitleName = tname, SerialTypeID = stypeid, GenreID = genid , ShortDescription = shortdesc, Episodes = eps, AiredID = airedid}; db.Animes.InsertOnSubmit(adt); db.SubmitChanges(); }
// searches by genre public static AnimeConstructModel[] ReturnAllFavAnimeByGenre(string genrename, ref Anime[] anit) { AnimeDataContext db = new AnimeDataContext(); AnimeConstructModel[] tmp = AnimeModel.ReturnAllAnimeNamesByGenre(GenreModel.ReturnGenreID(genrename), ref anit); return tmp; }
private void detach_Animes(Anime entity) { this.SendPropertyChanging(); entity.AiredYet = null; }
private void attach_Animes(Anime entity) { this.SendPropertyChanging(); entity.AiredYet = this; }
private void detach_Animes(Anime entity) { this.SendPropertyChanging(); entity.Studio = null; }
private void attach_Animes(Anime entity) { this.SendPropertyChanging(); entity.Studio = this; }
partial void DeleteAnime(Anime instance);
partial void UpdateAnime(Anime instance);
partial void InsertAnime(Anime instance);