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

📄 hotel_empty.asmx

📁 visual studio.net学习资料
💻 ASMX
字号:


<%@ WebService Language="VB" Class="hotel_Empty" %>

Imports System.Web.Services


' ==============================================================================
'
'  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_Empty.aspx
'
'  Application: Conference registration
'
'  Tested: with IE5.5 / Windows 2000
'
'  This file contains the web service for the Empty Hotel. This hotel
'  will always have a vacant room.
'
'  Technical details:
'
'  This page uses web methods
'
' ===============================================================================


Class hotel_Empty



  '*******************************************************
  '
  ' 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 not full
    Reserve = True
  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 in dollars
    Price = 100.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 close to the conference" & _
      " center. It has a business center, a health" & _
      " club, and a hair salon." 
  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 is one cafeteria-style restaurant in" & _
      " this hotel. It provides a buffet for" & _
      " breakfast, lunch, and dinner."
  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 and a color TV." & _
      "Double rooms also have a mini bar."     
  End Function

End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -