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());
            }
        }
Example #2
0
 public List <Award> GetAwards()
 {
     return(_dALAward.AllAwards());
 }
Example #3
0
 public FestivalAndAwardsViewModel(FestivalAndAwards window)
 {
     _allFestivals     = _dALFestival.AllFestivals();
     _allAwards        = _dALAward.AllAwards();
     _allAwardFestival = _dALAward.AllAwardFestival();
 }