public CreateMeetingRoomCommand(
     IDatabaseService database,
     IMeetingRoomFactory factory)
 {
     _database = database;
     _factory  = factory;
 }
        public JsonResult LoadMeetingRoom(int?meetingRoomID)
        {
            mrFactory = new MeetingRoomFactorys();
            List <DAL.db.MeetingRoom> list = mrFactory.SearchMeetingRoom(meetingRoomID);
            var appointmentList            = list.Select(x => new { x.MeetingRoomID, x.RoomNo, x.FloorLocation, x.ProjectorAvailable, x.SeatCapacity });

            return(Json(appointmentList, JsonRequestBehavior.AllowGet));
        }
        public void Setup()
        {
            var dbMock = new Mock <IDatabaseService>();

            _meetingRooms = GetDbSetMeetingRoomMock();

            dbMock.Setup(x => x.MeetingRooms).Returns(_meetingRooms.Object);
            _database = dbMock;

            var factoryMock = new Mock <IMeetingRoomFactory>();

            factoryMock.Setup(x => x.Update(It.IsAny <MeetingRoom>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <int>()))
            .Returns(new MeetingRoom());
            _factory = factoryMock.Object;

            _model = new UpdateMeetingRoomModel()
            {
                Name = "Meeting Room 1",
                Id   = MeetingRoomId,
                Size = 8
            };
        }
 public JsonResult SaveMeetingRoom(DAL.db.MeetingRoom meetingRoom)
 {
     mrFactory = new MeetingRoomFactorys();
     result    = mrFactory.SaveMeetingRoom(meetingRoom);
     return(Json(result));
 }