Example #1
0
        public void ProcessDayChange(int newDay)
        {
            var activeMPPs = militaryProtectionPactRepository.Where(mpp => mpp.Active && mpp.EndDay <= newDay).ToList();

            using (NoSaveChanges)
                foreach (var mpp in activeMPPs)
                {
                    EndMPP(mpp);
                }

            militaryProtectionPactRepository.SaveChanges();
        }
Example #2
0
        public ActionResult MPPs(int countryID)
        {
            var country = countryRepository.GetById(countryID);

            if (country == null)
            {
                return(RedirectBackWithError("Country does not exist!"));
            }

            var mpps = mppRepository.Where(c =>
                                           (c.FirstCountryID == countryID || c.SecondCountryID == countryID) && c.Active).ToList();

            var proposed  = mppOfferRepository.Where(c => c.FirstCountryID == countryID).ToList();
            var proposals = mppOfferRepository.Where(c => c.SecondCountryID == countryID).ToList();

            var vm = new CountryMPPListViewModel(country, mpps, proposed, proposals);

            return(View(vm));
        }