public RoomFacilityModel GetRoomFacilityById(int id)
        {
            var roomid = GetRoomIdFromRoomFacilityId(id);
            var facilityid = GetFacilityIdFromRoomFacilityId(id);
            var room = _internalUnitOfWork.RoomRepository.GetByID(roomid);
            var roomcategory = room.Category;
            var facility = _internalUnitOfWork.FacilitiesRepository.GetByID(facilityid);
 
            var roomfacility = _internalUnitOfWork.RoomFacilitiesRepository.GetByID(id);
            return FacilityMappings.MapRoomFacilityToRFModel(roomfacility, RoomMappings.MapRoomToRModel(room), FacilityMappings.MapFacilityToFacilityModel2(facility));
        }
 public void AddRoomFacilities(RoomModel room, FacilityModel facility)
 {
     var roomfaciliy = new RoomFacilityModel()
         {
             RoomId = room.Id,
             FacilityId = facility.FacilityId,
             FQuantity = 0,
         };
     var dbroomfacility = FacilityMappings.MapRfModelToRoomFacility(roomfaciliy,null,null);
         _internalUnitOfWork.RoomFacilitiesRepository.Insert(dbroomfacility);
         _internalUnitOfWork.Save();
 }
        public void AddNewFacility(string FName, string FDescription, int fquantity)
        {
            var facility = new FacilityModel()
            {
                FacilityName = FName,
                Description  = FDescription,
                FQuantity    = fquantity,
                Available    = true,
            };

            _internalUnitOfWork.FacilitiesRepository.Insert(FacilityMappings.MapFacilityModelToFacility(facility));
            _internalUnitOfWork.Save();
        }
 public List<RoomFacilityModel> GetAllRoomFacilities()
 {
     return _internalUnitOfWork.RoomFacilitiesRepository.Get()
         .Select(rf => FacilityMappings.MapRoomFacilityToRFModel(rf, null, null)).ToList();
 }
        public FacilityModel GetFacilityById(int id)
        {
            var facility = _internalUnitOfWork.FacilitiesRepository.GetByID(id);

            return(FacilityMappings.MapFacilityToFacilityModel(facility));
        }
 public List <FacilityModel> GetAllFacilities()
 {
     return(_internalUnitOfWork.FacilitiesRepository.Get()
            .Select(f => FacilityMappings.MapFacilityToFacilityModel(f)).ToList());
 }