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

📄 customerservice.asmx.vb

📁 介绍vb.net的一本很好的英文资料,深入浅出,值得一读
💻 VB
字号:
Imports System.Web.Services

<WebService(Description:="Stores and retrieves Customer information.")> _
Public Class CustomerService
    Inherits System.Web.Services.WebService

#Region " Web Services Designer Generated Code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Web Services Designer.
        InitializeComponent()

        'Add your own initialization code after the InitializeComponent() call

    End Sub

    'Required by the Web Services Designer
    Private components As System.ComponentModel.Container

    'NOTE: The following procedure is required by the Web Services Designer
    'It can be modified using the Web Services Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        components = New System.ComponentModel.Container()
    End Sub

    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        'CODEGEN: This procedure is required by the Web Services Designer
        'Do not modify it using the code editor.
    End Sub

#End Region

    <WebMethod(Description:="Retrieves customer details based on the Customer ID.")> _
    Public Sub GetDetails(ByVal intID As Integer, ByRef strEmail As String, _
        ByRef strPassword As String, ByRef strFName As String, _
        ByRef strLName As String, ByRef strAddress As String, _
        ByRef strCompany As String)

        'create a Customer object and retrieve the details
        Dim cust As New Customer(intID)
        With cust
            strEmail = .Email
            strPassword = .Password
            strFName = .FirstName
            strLName = .LastName
            strAddress = .Address
            strCompany = .Company
        End With
        cust = Nothing
    End Sub

    <WebMethod(Description:="Adds a customer to the system.")> _
    Public Function AddCustomer(ByVal strEmail As String, ByVal strPassword As String, _
            ByVal strFName As String, ByVal strLName As String, ByVal strAddress As String, _
            ByVal strCompany As String) As Integer

        'create a new Customer object and call the AddCustomer details
        Dim newCustomer As New Customer(), iResult As Integer
        iResult = newCustomer.AddCustomer(strEmail, strPassword, strFName, strLName, strAddress, strCompany)
        newCustomer = Nothing
        Return iResult
    End Function

    <WebMethod(Description:="Retrieves customer details based on logon details.")> _
    Public Sub LogOn(ByVal strEmail As String, ByVal strPassword As String, _
        ByRef intID As Integer, ByRef strFName As String, _
        ByRef strLName As String, ByRef strAddress As String, ByRef strCompany As String)

        'create a Customer object and call LogOn method to retrieve the details
        Dim cust As New Customer()
        With cust
            .LogOn(strEmail, strPassword)
            intID = .CustomerID
            strFName = .FirstName
            strLName = .LastName
            strAddress = .Address
            strCompany = .Company
        End With
        cust = Nothing
    End Sub

End Class

⌨️ 快捷键说明

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