public ActionResult Month(string id, int?m, int?y) { var db = new VITVSecondContext(); if (string.IsNullOrEmpty(id)) { id = User.Identity.GetUserId(); } if (!m.HasValue) { m = DateTime.Now.Month; } if (!y.HasValue) { y = DateTime.Now.Year; } var model = new CalendarMonthModel() { Year = y.Value, Month = m.Value, Employee = db.Employees.Find(id) }; return(View(model)); }
public CalendarMonthViewModel() { CurrentDate = DateTime.Now; CurrentMonth = CurrentDate.Month; CurrentYear = CurrentDate.Year; CurrentCalendarMonth = new CalendarMonthModel(CurrentMonth, CurrentYear); GoToNextMonthCommand = new RelayCommand(OnGoToNextMonth, CanGoToNextMonth); GoToLastMonthCommand = new RelayCommand(OnGoToLastMonth, CanGoToLastMonth); }
public void TestCalendarMonthViewModelShouldReturnSameCalendarMonthdModel() { var calendarMonthModel = new CalendarMonthModel(DateTime.Today.Month, DateTime.Today.Year); Assert.AreEqual(calendarMonthModel, calendarMonthViewModel.CurrentCalendarMonth); }
public void Setup() { calendarMonthModel = new CalendarMonthModel(11, 2019); }