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

📄 areaman.frm

📁 采用VisualBasic和SQL Server 2000开发 功能比较全面的旅游资源管理系
💻 FRM
字号:
VERSION 5.00
Begin VB.Form AreaMan 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "旅游地信息管理"
   ClientHeight    =   2820
   ClientLeft      =   45
   ClientTop       =   345
   ClientWidth     =   5520
   Icon            =   "AreaMan.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2820
   ScaleWidth      =   5520
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Cmd_Add 
      Caption         =   "添 加"
      Default         =   -1  'True
      Height          =   400
      Left            =   2280
      MouseIcon       =   "AreaMan.frx":27A2
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   9
      Top             =   1200
      Width           =   1300
   End
   Begin VB.CommandButton Cmd_Modi 
      Caption         =   "修 改"
      Height          =   400
      Left            =   3840
      MouseIcon       =   "AreaMan.frx":2AAC
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   8
      Top             =   1200
      Width           =   1300
   End
   Begin VB.CommandButton Cmd_Del 
      Caption         =   "删 除"
      Height          =   400
      Left            =   2280
      MouseIcon       =   "AreaMan.frx":2DB6
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   7
      Top             =   1920
      Width           =   1300
   End
   Begin VB.CommandButton Cmd_Close 
      Cancel          =   -1  'True
      Caption         =   "关 闭"
      Height          =   400
      Left            =   3840
      MouseIcon       =   "AreaMan.frx":30C0
      MousePointer    =   99  'Custom
      Style           =   1  'Graphical
      TabIndex        =   6
      Top             =   1920
      Width           =   1300
   End
   Begin VB.Frame Frame1 
      Height          =   735
      Left            =   240
      TabIndex        =   1
      Top             =   120
      Width           =   5055
      Begin VB.OptionButton Option3 
         Caption         =   "国外"
         Height          =   375
         Left            =   3675
         TabIndex        =   2
         Top             =   240
         Width           =   1215
      End
      Begin VB.OptionButton Option1 
         Caption         =   "本市"
         Height          =   375
         Left            =   1320
         TabIndex        =   4
         Top             =   240
         Value           =   -1  'True
         Width           =   1215
      End
      Begin VB.OptionButton Option2 
         Caption         =   "外埠"
         Height          =   375
         Left            =   2520
         TabIndex        =   3
         Top             =   240
         Width           =   1215
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         BackColor       =   &H0000FFFF&
         BackStyle       =   0  'Transparent
         Caption         =   "旅游地类型:"
         Height          =   180
         Left            =   120
         TabIndex        =   5
         Top             =   330
         Width           =   990
      End
   End
   Begin VB.ListBox List1 
      Height          =   1680
      Left            =   240
      TabIndex        =   0
      Top             =   960
      Width           =   1695
   End
End
Attribute VB_Name = "AreaMan"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public CurAreaId As Long
Public CurType As Integer
Private Sub Loadarea()
  Dim i As Integer
  List1.Clear
  MyArea.Load_Area
  If Option1.Value = True Then
    Do While d1(i) <> ""
      List1.AddItem d1(i)
      i = i + 1
    Loop
  End If
  If Option2.Value = True Then
    Do While d2(i) <> ""
      List1.AddItem d2(i)
      i = i + 1
    Loop
  End If
  If Option3.Value = True Then
    Do While d3(i) <> ""
      List1.AddItem d3(i)
      i = i + 1
    Loop
  End If
End Sub

Private Function DeleteCheck(ByVal TmpId As Long) As Integer
  Dim TmpName As String
  TmpName = MyPlace.AreaInPlace(CurAreaId)
  If TmpName <> "" Then
    DeleteCheck = -1
    MsgBox "当前地域信息在娱乐厅 - " + TmpName + " - 中使用,为保证数据的完整性,不允许删除此地域。"
    Exit Function
  End If
  TmpName = MyHotel.AreaInHotel(CurAreaId)
  If TmpName <> "" Then
    DeleteCheck = -1
    MsgBox "当前地域信息在宾馆 - " + TmpName + " - 中使用,为保证数据的完整性,不允许删除此地域。"
    Exit Function
  End If
  TmpName = MyRes.AreaInRes(CurAreaId)
  If TmpName <> "" Then
    DeleteCheck = -1
    MsgBox "当前地域信息在餐厅 - " + TmpName + " - 中使用,为保证数据的完整性,不允许删除此地域。"
    Exit Function
  End If
  TmpName = MyAmuse.AreaInAmuse(CurAreaId)
  If TmpName <> "" Then
    DeleteCheck = -1
    MsgBox "当前地域信息在娱乐厅 - " + TmpName + " - 中使用,为保证数据的完整性,不允许删除此地域。"
    Exit Function
  End If
  TmpName = MyLine.AreaInLine(CurAreaId)
  If TmpName <> "" Then
    DeleteCheck = -1
    MsgBox "当前地域信息 -在线路- " + TmpName + " - 中使用,为保证数据的完整性,不允许删除此地域。"
    Exit Function
  End If
  DeleteCheck = 0
End Function

Private Sub Cmd_Add_Click()
  If Option1.Value = True Then
    AreaEdit.CurType = 1
    AreaEdit.lblAreaType = "本市"
  End If
  If Option2.Value = True Then
    AreaEdit.CurType = 2
    AreaEdit.lblAreaType = "外埠"
  End If
  If Option3.Value = True Then
    AreaEdit.CurType = 3
    AreaEdit.lblAreaType = "国外"
  End If
  AreaEdit.Modify = False
  AreaEdit.OriAreaName = ""
  AreaEdit.OriId = 0
  AreaEdit.Show 1
  Loadarea
End Sub

Private Sub Cmd_Close_Click()
  Unload Me
End Sub

Private Sub Cmd_Del_Click()
  If List1.ListIndex < 0 Then
    MsgBox "请选择要删除的地域"
    Exit Sub
  End If
  If DeleteCheck(CurAreaId) = -1 Then
    Exit Sub
  End If
  If MsgBox("是否删除当前地域?", vbYesNo, "请确认") = vbYes Then
    MyArea.Delete (CurAreaId)
    Loadarea
  End If
End Sub

Private Sub Cmd_Modi_Click()
  If List1.ListIndex < 0 Then
    MsgBox "请选择要修改的地域"
    Exit Sub
  End If
  If Option1.Value = True Then
    AreaEdit.CurType = 1
    AreaEdit.lblAreaType = "本市"
  End If
  If Option2.Value = True Then
    AreaEdit.CurType = 2
    AreaEdit.lblAreaType = "外埠"
  End If
  If Option3.Value = True Then
    AreaEdit.CurType = 3
    AreaEdit.lblAreaType = "国外"
  End If
  AreaEdit.Modify = True
  AreaEdit.OriAreaName = List1.Text
  AreaEdit.txtAreaName = List1.Text
  AreaEdit.OriId = CurAreaId
  AreaEdit.Show 1
  Loadarea
End Sub

Private Sub Form_Load()
  Option1.Value = True
  Loadarea
End Sub

Private Sub List1_click()
  If List1.ListIndex < 0 Then
    Exit Sub
  End If
    
  CurAreaId = MyArea.GetId(MakeStr(List1.Text))
End Sub

Private Sub Option1_Click()
  Loadarea
End Sub

Private Sub Option2_Click()
  Loadarea
End Sub

Private Sub Option3_Click()
  Loadarea
End Sub


⌨️ 快捷键说明

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