public BuildingController(IBuildingService buildings, IRoomService rooms, IConsumptionService consumptions, IFloorService floors)
 {
     this.buildings = buildings;
     this.consumptions = consumptions;
     this.floors = floors;
     this.rooms = rooms;
 }
 public BookRoomController(IBuildingService buildings, IFloorService floors, IRoomService rooms, IStudentService students)
 {
     this.buildings = buildings;
     this.floors = floors;
     this.rooms = rooms;
     this.students = students;
 }
 public RoomsController(IRoomClassService roomClassService, IRoomTypeService roomTypeService, IRoomService roomService, ICruiseService cruiseService)
 {
     _roomClassService = roomClassService;
     _roomTypeService = roomTypeService;
     _roomService = roomService;
     _cruiseService = cruiseService;
 }
 public RoomController(IRoomService roomService,
     IHotelService hotelService,
     IRoomTypeService roomTypeService)
 {
     this.roomService = roomService;
     this.hotelService = hotelService;
     this.roomTypeService = roomTypeService;
 }
 public BookingController(IBookingService bookingService,
     IBookingDetailService bookingDetailService,
     IRoomService roomService)
 {
     this.bookingService = bookingService;
     this.bookingDetailService = bookingDetailService;
     this.roomService = roomService;
 }
        public RoomsFormViewModel()
            : base()
        {
            _roomService = new RoomServiceClient();

            _currentRoom = new Room();

            SaveRoomCommand = new RelayCommand(this.SaveRoom,
                () => IsValid);

        }
 private void getAllRoom()
 {
     if (PageViewModel.StateManager.AllRoom == null)
     {
         roomService = new RoomServiceClient();
         _allRoom = roomService.GetList(false);
         PageViewModel.StateManager.AllRoom = _allRoom;
     }
     else
         _allRoom = PageViewModel.StateManager.AllRoom;
 }
        public RoomAccesActor(IRoomService roomService)
        {
            _roomService = roomService;
            Receive<LoadActiveRoomsMessage>(message =>
            {
                var sender = Sender;
                var self = Self;
                _roomService.GetRoomsAsync().SafelyPipeTo(
                    task => new ActiveRoomsMessage(task.Result),
                    task => new FailedToLoadActiveRoomsMessage(task.Exception?.InnerException),
                    sender, self);
            });

            Receive<CreateRoomMessage>(message =>
            {
                var sender = Sender;
                var self = Self;

                var room = new Room
                {
                    Name = message.Name,
                    CreateTime = message.CreateTime,
                    Users = new List<User>()
                };

                _roomService.AddRoomAsync(room).SafelyPipeTo(
                        task => new RoomCreatedMessage(task.Result),
                        task => new FailedToCreateMessage(message.Creator, task.Exception?.InnerException), 
                        sender, self);
            });

            Receive<GetUsersInRoomMessage>(message =>
            {
                var sender = Sender;
                var self = Self;
                _roomService.GetUsersInRoomAsync(message.RoomId).SafelyPipeTo(
                    task => new UsersInRoomMessage(message.RoomId, task.Result.ToList()),
                    task => new FailedToGetUsersInRoomMessage(message.RoomId, task.Exception?.InnerException),
                    sender, self);
            });

            Receive<RemoveRoomMessage>(message =>
            {
                var sender = Sender;
                var self = Self;
                _roomService.RemoveRoomAsync(message.Room).PipeFailureTo(
                    task => new FailedToRemoveRoomMessage(message.Room.Id, task.Exception?.InnerException), 
                    sender, self);
            });
        }
        public RoomsListViewModel()
            : base()
        {
            // set up model data
            roomService = new RoomServiceClient();
            FormViewModel = new RoomsFormViewModel();

            // set up commands
            AddRoomCommand = new RelayCommand(this.AddRoom, () => true);
            DeleteRoomCommand = new RelayCommand(this.DeleteRoom,
                () => FormViewModel.CurrentRoom != null && FormViewModel.CurrentRoom.ID != 0);

            MessengerInstance.Register<NotificationMessage>(this, (message) =>
            {
                if (message.Notification == "RoomSaved")
                {
                    RefreshRooms();
                    FormViewModel.CurrentRoom = new Room();
                }
            });
        }
        public RoomModule(IRoomService service)
            : base("/api/rooms")
        {
            Service = service;

            Get["/list"] = p =>
            {
                var rooms = Service.GetRooms();

                return Negotiate.WithModel(rooms.Select(e => e.ViewModel));
            };

            Post["/new"] = p =>
            {
                var model = this.Bind<NewRoomModel>();

                var room = Service.CreateRoom(model.Name);

                return Negotiate.WithModel(room.ViewModel);
            };

            Get["/{room}/listUsers"] = p =>
            {
                string room = p.room;

                var users = Service.GetUsers(room);

                return Negotiate.WithModel(users.Select(user => user.ViewModel.Name));
            };

            Post["/{room}/join"] = p =>
            {
                string room = p.room;
                var model = this.Bind<JoinRequest>();

                var user = Service.JoinRequest(model.User, room);

                return Negotiate.WithModel(user.ViewModel);
            };
        }
        public AssetsFormViewModel()
            : base()
        {
            _assetService = new AssetServiceClient();
            _roomService = new RoomServiceClient();

            _currentAsset = new Asset();

            var rooms = _roomService.GetList(false);
            _allRoomOptions = new ObservableCollection<RoomComboBoxItem>()
                {
                    new RoomComboBoxItem() { Room = null }
                };
            foreach (var room in rooms)
            {
                _allRoomOptions.Add(new RoomComboBoxItem() { Room = room });
            }
            RaisePropertyChanged("RoomOptions");

            SaveAssetCommand = new RelayCommand(this.SaveAsset,
                () => IsValid);
        }
 public RoomClassService(IRoomClassRepository roomClassRepository, IRoomService roomService, IUnitOfWork unitOfWork)
 {
     RoomClassRepository = roomClassRepository;
     RoomService = roomService;
     UnitOfWork = unitOfWork;
 }
 public ChatRoomHub()
 {
     _roomService = new RoomService();
 }
 public PriorityProcessor(IRoomService roomService, ICommandService commandService, int roomId)
 {
     this.roomService    = roomService;
     this.commandService = commandService;
     this.roomId         = roomId;
 }
 public GetRoomsModel(IRoomService service, IBookingService bservice)
 {
     roomService    = service;
     bookingService = bservice;
 }
 public RoomsController(IRoomService roomService)
 {
     _roomService = roomService;
 }
        private void Initialize()
        {
            MessengerInstance.Send(new LoadingMessage("Please wait..."));

            // set up commands
            AddBookingCommand = new RelayCommand(this.AddBooking);
            EditBookingCommand = new RelayCommand(this.EditBooking, CanEditSelectedBooking);
            CancelBookingCommand = new RelayCommand(this.CancelBooking, CanEditSelectedBooking);
            SelectedDatesCommand = new RelayCommand<SelectionChangedEventArgs>(this.SelectedDates);
            UpdateCalendarCommand = new RelayCommand( () => UpdateCalendarControl(true) );

            BackgroundWorker worker = new BackgroundWorker();
            worker.DoWork += (object sender, DoWorkEventArgs e) =>
            {   
                // set up options for filtering
                _roomService = new RoomServiceClient();
                _userService = new UserServiceClient();
                var rooms = _roomService.GetList(true);
                _allRoomOptions = new ObservableCollection<RoomComboBoxItem>()
                {
                    new RoomComboBoxItem()
                };
                foreach (var room in rooms)
                {
                    _allRoomOptions.Add(new RoomComboBoxItem() { Room = room });
                }
                RaisePropertyChanged("RoomOptions");
                var users = _userService.GetList();
                _allUserOptions = new ObservableCollection<UserComboBoxItem>()
                {
                    new UserComboBoxItem()
                };
                foreach (var user in users)
                {
                    _allUserOptions.Add(new UserComboBoxItem() { User = user });
                }
                RaisePropertyChanged("UserOptions");

                // set up sensible defaults for filters
                FilterStartDate = DateTime.Today;
                FilterEndDate = FilterStartDate.AddMonths(1);
                FilterUser = StateManager.CurrentUser;
                FilterCanceled = false;

                this.PropertyChanged += new PropertyChangedEventHandler(BookingsListViewModel_PropertyChanged);
            }; 
            worker.RunWorkerCompleted += (object sender, RunWorkerCompletedEventArgs e) =>
            {
                _isInitialized = true;
                MessengerInstance.Send(new LoadingMessage(false));

                // Finally, get the bookings needed (will start it's own BackgroundWorker)
                _bookingService = new BookingServiceClient();
                RefreshBookings(true);
            };
            worker.RunWorkerAsync();
            
        }
 public TimeSlotController(ITimeSlotService timeSlotService, ISessionService sessionService, IRoomService roomService, UserManager <IdentityUser> userManager)
 {
     _timeSlotService = timeSlotService;
     _sessionService  = sessionService;
     _roomService     = roomService;
     _userManager     = userManager;
 }
Beispiel #19
0
 public RegularRoomFacade(IRoomService service, IReservationService resService)
 {
     _roomService = service;
     _resService  = resService;
 }
Beispiel #20
0
 public CreateModel(IRoomService roomService)
 {
     _roomService = roomService;
 }
 public GameService(IRoomService roomService)
 {
     this.roomService = roomService;
 }
Beispiel #22
0
 public RoomsContoller(IRoomService roomService)
 {
     _roomService = roomService;
 }
        public BookingsFormViewModel(Booking booking)
            : base()
        {
            _booking = booking;

            // Initialize fields
            if (IsInDesignMode)
            {
                // Hardcoded design time data
                RoomList = new ObservableCollection<Room>()
                {
                    new Room() { Name = "Winterfell", Location = "25th floor", Capacity = 10 },
                    new Room() { Name = "King's Landing", Location = "24th floor", Capacity = 8 }
                };

                _isConflicting = true;
            }
            else
            {
                _bookingService = new BookingServiceClient();
                _roomService = new RoomServiceClient();
                _assetService = new AssetComponent();
                _isConflicting = false;
                RefreshRooms();
                RefreshAssets();
            }

            if (_booking == null)
            {
                // New booking
                _isNewBooking = true;
                _booking = new Booking();

                // Default booking dates are today
                _startDate = DateTime.Today;
                _endDate = DateTime.Today;
                // Default booking start time is now + rounded up to next half hour
                var startHour = DateTime.Now.Hour;
                var startMinute = DateTime.Now.Minute;
                if (startMinute < 30 && startMinute > 0)
                {
                    startMinute = 30;
                }
                else if (startMinute > 30)
                {
                    startMinute = 0;
                    startHour++;
                }
                _startTime = new TimeSpan(startHour, startMinute, 0);
                // Default booking end time is one hour later
                _endTime = _startTime + TimeSpan.FromHours(1);
                getBookedItem();
            }
            else
            {
                // Edit booking
                _isNewBooking = false;

                _startDate = _booking.StartDate.Date;
                _startTime = _booking.StartDate.TimeOfDay;
                _endDate = _booking.EndDate.Date;
                _endTime = _booking.EndDate.TimeOfDay;
                // Since we do not have navigational properties on Booking and properly 
                // implemented Compare methods on Room, have to do it the ugly way
                foreach (var r in RoomList)
                {
                    if (r.ID == _booking.RoomID)
                    {
                        _room = r;
                        break;
                    }
                }

                // pre-select booked assets
                foreach (var bookedAsset in _booking.AssetBookings)
                {
                    var asset = AssetList.First(a => a.Asset.ID == bookedAsset.AssetID);
                    if (asset != null)
                    {
                        asset.IsSelected = true;
                    }
                }

            }

            // Generate TimeComboBoxitems from 00:00 to 23:30, in 30 minute increments
            _allTimeOptions = new ObservableCollection<TimeComboBoxItem>();
            for (var i = 0; i < 48; i++)
            {
                var hours = i / 2;
                var minutes = (i % 2 == 0) ? 0 : 30;
                _allTimeOptions.Add(new TimeComboBoxItem() { Time = new TimeSpan(hours, minutes, 0) });
            }

            // Wire up commands
            MakeBookingCommand = new RelayCommand(this.MakeBooking, () => IsValid && !IsConflicting);
            CancelCommand = new RelayCommand(this.Cancel);
            SelectedAssetsChangedCommand = new RelayCommand<SelectionChangedEventArgs>(this.SelectedAssetsChanged);

            // Subscribe to own PropertyChanging event, to AJAX-ly call BLL validations
            this.PropertyChanged += new PropertyChangedEventHandler(BookingsFormViewModel_PropertyChanged);
        }
Beispiel #24
0
 public HomeController(ILogger <HomeController> logger, IMemoryCache memoryCache, IRoomService roomService,
                       IRoomTypeService roomTypeService, IGiaoDichService giaoDichService) : base(logger, memoryCache)
 {
     _giaoDichService = giaoDichService;
     _roomService     = roomService;
     _roomTypeService = roomTypeService;
     _memoryCache     = memoryCache;
 }
 public BookingsController(IBookingService bookingService, ITripService tripService, IRoomService roomService)
 {
     _bookingService = bookingService;
     _tripService = tripService;
     _roomService = roomService;
 }
Beispiel #26
0
 public RoomController(IRoomService roomService)
 {
     _roomService = roomService;
 }
 public HousesController(IHouseService houseService, IRoomService roomService, IAccessoryService accessoryService)
 {
     _houseService = houseService;
     _roomService = roomService;
     _accessoryService = accessoryService;
 }
Beispiel #28
0
 public RoomController(IRoomService service)
 {
     this.service = service;
     mapper       = new MapperConfiguration(cfg =>
                                            cfg.CreateMap <RoomDTO, RoomModel>()).CreateMapper();
 }
 public RoomController(IRoomService roomService)
 {
     this.roomService = roomService;
 }
Beispiel #30
0
 public BookingController(IHotelService hotelService, IRoomService roomService, UserManager <ApplicationUser> userManager)
 {
     this.hotelService = hotelService;
     this.roomService  = roomService;
     this.userManager  = userManager;
 }
Beispiel #31
0
 public RoomsController(IRoomService roomService)
 {
     this._roomService = roomService;
 }
Beispiel #32
0
 public RoomController(IRoomService _roomService)
 {
     roomService = _roomService;
 }