Beispiel #1
0
 public SchedulerIndexViewModel SetIndexUrls(SchedulerIndexViewModel vm)
 {
     vm.CreateEventUrl            = _linkGenerator.GetPathByAction(nameof(Controllers.SchedulerController.Create), "Scheduler", null);
     vm.CreateEventMoreOptionsUrl = _linkGenerator.GetPathByAction(nameof(Controllers.SchedulerController.CreateMoreOptions), "Scheduler", new { title = "title_placeholder", start = "start_placeholder", end = "end_placeholder" });
     vm.EditEventUrl       = _linkGenerator.GetPathByAction(nameof(Controllers.SchedulerController.Edit), "Scheduler", new { id = "id_placeholder" });
     vm.CalendarSourceUrl  = _linkGenerator.GetPathByAction(nameof(Controllers.SchedulerController.UserEvents), "Scheduler", null);
     vm.PostCreateEventUrl = _linkGenerator.GetPathByAction(nameof(Controllers.SchedulerController.CreateEvent), "Scheduler", null);
     vm.ExportIcalUrl      = _linkGenerator.GetPathByAction(nameof(Controllers.SchedulerController.ExportEventsToIcal), "Scheduler", new { start = "start_placeholder", end = "end_placeholder" });
     return(vm);
 }
Beispiel #2
0
        public IActionResult Index(DateTime Start, DateTime End)
        {
            var model = new SchedulerIndexViewModel
            {
                Start = Start == DateTime.MinValue ? DateTime.Today : Start,
                End   = Start == DateTime.MinValue ? DateTime.Today : End
            };

            return(View(model));
        }
Beispiel #3
0
        public IActionResult Index(SchedulerIndexViewModel model)
        {
            if (ModelState.IsValid)
            {
                var shifts = shiftRepository.GetShiftsInDateRange(model.Start, model.End).ToList();
                if (shifts == null)
                {
                    model.Shifts = new List <Shift>();
                }
                else
                {
                    model.Shifts = shifts;
                }
            }

            return(View(model));
        }
Beispiel #4
0
        public SchedulerIndexViewModel CreateSchedulerIndexViewModel()
        {
            var vm = new SchedulerIndexViewModel();

            return(vm);
        }