public void DeleteRoomClass(RoomClass roomClass)
        {
            var rooms = RoomService.GetRooms().Where(r => r.RoomClass.RoomClassId == roomClass.RoomClassId).ToArray();
            for (int i = 0 ; i < rooms.Count(); i++)
            {
                rooms[i].RoomClass = null;
                RoomService.UpdateRoom(rooms[i]);
            }

            RoomClassRepository.Delete(roomClass);
            SaveRoomClass();
        }
        public ActionResult Create(CreateViewModel createViewModel)
        {
            if (!ModelState.IsValid)
            {
                return View(createViewModel);
            }

            var roomClass = new RoomClass()
            {
                Name = createViewModel.Name,
                Description = createViewModel.Description
            };
            RoomClassService.CreateRoomClass(roomClass);
            TempData["RoomClassId"] = roomClass.RoomClassId;
            TempData["RoomClassName"] = roomClass.Name;
            TempData["Message"] = RoomClassesMessage.CreateSuccess;
            return RedirectToAction("index", "roomclasses");
        }
 public void UpdateRoomClass(RoomClass roomClass)
 {
     RoomClassRepository.Update(roomClass);
     SaveRoomClass();
 }
 public void CreateRoomClass(RoomClass roomClass)
 {
     RoomClassRepository.Add(roomClass);
     SaveRoomClass();
 }