private void AddAwardExecute() { try { if (!string.IsNullOrEmpty(Award.Name)) { Award award = new Award() { Name = Award.Name, Deleted = false }; _dALAward.AddAward(award); var lastedAddedAward = _dALAward.AllAwards().LastOrDefault(); AwardFestival awardFestival = new AwardFestival() { Award_Id = lastedAddedAward.Id, Festival_Id = _dALFestival.AllFestivals().ElementAt(SelectedFestival).Id }; _dALAward.AddAwardFestival(awardFestival); award_window.Close(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public List <Award> GetAwards() { return(_dALAward.AllAwards()); }
public FestivalAndAwardsViewModel(FestivalAndAwards window) { _allFestivals = _dALFestival.AllFestivals(); _allAwards = _dALAward.AllAwards(); _allAwardFestival = _dALAward.AllAwardFestival(); }