?? hotel_full.asmx
字號:
<%@ WebService Language="VB" Class="hotel_Full" %>
Imports System.Web.Services
Imports System
' ==============================================================================
'
' Copyright (C) 2000 Microsoft Corporation
' All rights reserved
'
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
' OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
' LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND/OR
' FITNESS FOR A PARTICULAR PURPOSE.
'
' File name: hotel_Full.aspx
'
' Application: Conference registration
'
' Tested: with IE5.5 / Windows 2000
'
' This file contains the web service for the Full Hotel. This hotel will never
' have a vacant room.
'
' Technical details:
'
' This page uses web methods
'
' ===============================================================================
Class hotel_Full
'*******************************************************
'
' Reserve() WebMethod
'
' The Reserve WebMethod allows a user to reserve
' a room.
'
' Input Parameters:
' - strRoomType1: indicates if the room should be
' single or double.
' - strRoomType2: indicates if the room should be
' smoking or not
' - dtmStartDate: indicates the check-in date
' - dtmEndDate: indicates the check-out date
'
' Returned Value:
'
' - True if there is an available room
'
'*******************************************************
public Function <WebMethod()>Reserve(strRoomType1 As String, _
strRoomType2 As String, _
dtmStartDate As Date, _
dtmEndDate As Date) As Boolean
' Hotel is always full
Reserve = False
End Function
'*******************************************************
'
' Price() WebMethod
'
' The Price WebMethod returns the price of a
' given room type.
'
' Input Parameters:
' - strRoomType1: indicates if the room is
' single or double.
'
' Returned Value:
'
' - A Double that contains the price for
' the room
'
'*******************************************************
public Function <WebMethod()>Price(strRoomType1 As String) As Double
Price = 200.00
End Function
'*******************************************************
'
' Description() WebMethod
'
' The Description WebMethod returns a general
' description of the hotel.
'
' Returned Value:
'
' - A String that contains the general description
' for this hotel
'
'*******************************************************
public Function <WebMethod()>Description() As String
' Hotel description
Description = _
"This hotel is located in the heart of the city." & _
" It is surrounded by wonderful shops and many art museums."
End Function
'*******************************************************
'
' Food() WebMethod
'
' The Food WebMethod returns a description of
' the restaurants in the hotel.
'
' Returned Value:
'
' - A String that contains a description of
' the restaurants in this hotel
'
'*******************************************************
public Function <WebMethod()>Food() As String
Food = _
"There are three choices for food and drink in this hotel:" & _
" a cozy cafe, a lively bar, and an elegant bistro."
End Function
'*******************************************************
'
' Room() WebMethod
'
' The Room WebMethod returns a description
' of the rooms in the hotel.
'
' Returned Value:
'
' - A String that contains the description of the rooms
' in this hotel
'
'*******************************************************
public Function <WebMethod()>Room() As String
Room = _
"Each room has a private bath, a mini bar, and a" & _
" color TV. Double rooms feature a balcony with a" & _
" view of the city."
End Function
End Class
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -