public IActionResult CheckRoomTypeExists(int roomStyleId, int roomSizeId) { if (RoomTypeDAO.CheckIsExistRoomTypeByStyleIdAndSizeId(roomStyleId, roomSizeId)) { return(Json(true)); } else { return(Json(false)); } }
public IActionResult CreateRoomType(int roomStyleId, int roomSizeId, int price, string description) { if (!RoomTypeDAO.CheckIsExistRoomTypeByStyleIdAndSizeId(roomStyleId, roomSizeId)) { RoomTypeDAO.InsertRoomType(roomStyleId, roomSizeId, price, description); return(Json(price)); } else { RoomTypeDAO.UpdateRoomType(roomStyleId, roomSizeId, price, description); return(Json(price)); } }