public static void AddStaff(int titleid, int manid, string staffname, string occ, string page) { AnimeDataContext db = new AnimeDataContext(); Staff adt = new Staff { TitleID = titleid, MangaID = manid, StaffName = staffname, Occupation = occ, PersonalPage = page }; db.Staffs.InsertOnSubmit(adt); db.SubmitChanges(); }
public static StaffConstructModel[] ReturnAllStaffNamesByGenre(int genID, ref Staff[] anit) { AnimeDataContext db = new AnimeDataContext(); StaffConstructModel[] temp = (from tp in db.Staffs join ant in db.Animes on tp.TitleID equals ant.TitleID join mang in db.Mangas on tp.MangaID equals mang.MangaID where ant.GenreID == genID || mang.GenreID == genID select new StaffConstructModel(tp.StaffName, tp.PersonalPage, tp.Occupation)).ToArray(); anit = (from tp in db.Staffs join ant in db.Animes on tp.TitleID equals ant.TitleID join mang in db.Mangas on tp.MangaID equals mang.MangaID where ant.GenreID == genID || mang.GenreID == genID select tp).ToArray(); return temp; }
private void detach_Staffs(Staff entity) { this.SendPropertyChanging(); entity.Anime = null; }
private void attach_Staffs(Staff entity) { this.SendPropertyChanging(); entity.Anime = this; }
partial void DeleteStaff(Staff instance);
partial void UpdateStaff(Staff instance);
partial void InsertStaff(Staff instance);
// returns all staff by genre public static StaffConstructModel[] ReturnAllFavStaffByGenre(string genrename, ref Staff[] anit) { AnimeDataContext db = new AnimeDataContext(); StaffConstructModel[] tmp = StaffModel.ReturnAllStaffNamesByGenre(GenreModel.ReturnGenreID(genrename), ref anit); return tmp; }