⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hotel_full.asmx

📁 visual studio.net学习资料
💻 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 + -