Exemple #1
0
        public void AddNewRoomTypeTest()
        {
            var roomType = new RoomTypeViewModel
            {
                RoomTypeName = "Room Type Service Test",
                CreateBy     = Guid.NewGuid()
            };

            Assert.True(_roomTypeService.AddRoomType(roomType).Result);
        }
 public IActionResult Create(RoomTypeViewModel model)
 {
     if (ModelState.IsValid)
     {
         roomTypeService.AddRoomType(model);
         return(RedirectToAction(nameof(Index)));
     }
     return(View(model));
 }
Exemple #3
0
        public IActionResult Create(CreateRoomTypeVM roomType)
        {
            RoomType type = new RoomType()
            {
                HotelId             = roomType.HotelId,
                Name                = roomType.Name,
                Area                = roomType.Area,
                PriceSeasonNumber   = Convert.ToDecimal(roomType.PriceStandardNumber),
                PriceStandardNumber = Convert.ToDecimal(roomType.PriceStandardNumber),
                NumberOfBeds        = roomType.NumberOfBeds,
                NumberOfPeople      = roomType.NumberOfPeople,
                Description         = roomType.Description,
            };

            if (IRoomTypeService.AddRoomType(type))
            {
                return(RedirectToAction("Index"));
            }

            return(RedirectToAction("Create"));
        }
        public async Task <IActionResult> AddRoomType([FromBody] RoomType roomType)
        {
            var addRooms = await _roomTypeService.AddRoomType(roomType);

            return(Ok(addRooms));
        }
Exemple #5
0
 public async Task <int> AddRoomType([FromBody] RoomTypeModel roomTypeModel) =>
 await _service.AddRoomType(roomTypeModel);
        public async Task <IActionResult> CreateRoomType(RoomType roomType)
        {
            var createdRoomType = await _roomTypeService.AddRoomType(roomType);

            return(Ok(createdRoomType));
        }