示例#1
0
        public ActionResult TimeSlotsForAccount(Guid accountGuid)
        {
            List <TimeSlot> models = new List <TimeSlot>();

            models = new TimeSlotManager().GetTimeSlotsByAccount(accountGuid);
            return(View(models));
        }
示例#2
0
        public ActionResult TimeSlots()
        {
            List <TimeSlot> models = new List <TimeSlot>();

            models = new TimeSlotManager().GetTimeSlots();
            return(View(models));
        }
示例#3
0
 public ActionResult Create(TimeSlot model)
 {
     if (ModelState.IsValid)
     {
         model = new TimeSlotManager().Create(model);
         if (model.TimeSlotGuid != Guid.Empty)
         {
             return(RedirectToAction("Read", new { timeSlotGuid = model.TimeSlotGuid, accountGuid = model.AccountGuid }));
         }
     }
     return(View(model));
 }
示例#4
0
        public void SetUp()
        {
            _timeSlotObserver = new FakeTimeSlotObserver();
            _timeProvider     = new FakeTimeProvider();
            _timer            = new FakeTimer();

            var timeSlotStore = new Mock <ITimeSlotStore>();

            _timeSlots = new List <PowerTimeSlot>();
            timeSlotStore.Setup(x => x.GetTimeSlots()).Returns(_timeSlots);

            _timeSlotManager = new TimeSlotManager(_timeSlotObserver, _timer, _timeProvider, timeSlotStore.Object);
        }
示例#5
0
        public static void Startup(StartupHandlerBase startupHandler)
        {
            _startupHandler = startupHandler;
            _startupHandler.Startup();

            var proxy = new RenderManager(_startupHandler.CreateRenderEngine(), new DefaultLayoutBuilder());

            RenderEngine  = proxy;
            PluginHandler = new PluginManager(RenderEngine, new DefaultLayoutBuilder());

            TimeSlotManager = new TimeSlotManager(RenderEngine, new WordclockTimer(1000 * 60), new TimeProvider(), new TimeSlotStoreDecorator(new XMLTimeSlotStore()));

            PluginHandler.ChangeActivePlugin <Clock>();
        }
示例#6
0
        public ActionResult Read(Guid timeSlotGuid, Guid accountGuid)
        {
            TimeSlot model = new TimeSlotManager().Read(timeSlotGuid, accountGuid);

            return(View(model));
        }