コード例 #1
0
        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));
        }
コード例 #2
0
 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);
 }
コード例 #3
0
        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);
 }