Beispiel #1
0
        public ActionResult NewHolidayForm(Holiday newHoliday)
        {
            DateTime currentDate = DateTime.Now;
            int daysUntil = (newHoliday.Date - currentDate).Days;
            newHoliday.Days = daysUntil;

            return View("NewHolidayConfirm", newHoliday);
        }
Beispiel #2
0
        public ActionResult FavoriteHoliday()
        {
            DateTime currentDate = DateTime.Now;
            DateTime holidayDate = new DateTime(currentDate.Year, 12, 25);

            Holiday favoriteHoliday = new Holiday();
            favoriteHoliday.Name = "Christmas";
            favoriteHoliday.Date = holidayDate;
            favoriteHoliday.Days = (holidayDate-currentDate).Days;

            return View(favoriteHoliday);
        }