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

📄 frmchangeg.frm

📁 酒店管理系统 (VB版) 简单的酒店管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form Frmchangeg 
   Caption         =   "登记信息修改"
   ClientHeight    =   7500
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   6120
   LinkTopic       =   "Form2"
   ScaleHeight     =   7500
   ScaleWidth      =   6120
   StartUpPosition =   3  '窗口缺省
   Begin VB.CheckBox Checkcf 
      Caption         =   "换房"
      Height          =   255
      Left            =   480
      TabIndex        =   22
      Top             =   600
      Width           =   735
   End
   Begin VB.TextBox Textroomno1 
      Enabled         =   0   'False
      Height          =   390
      Left            =   2280
      TabIndex        =   21
      Top             =   480
      Width           =   1095
   End
   Begin VB.TextBox Textroomno2 
      Height          =   375
      Left            =   4320
      TabIndex        =   20
      Top             =   480
      Width           =   975
   End
   Begin VB.CheckBox Checkgn 
      Caption         =   "修改客人姓名"
      Height          =   255
      Left            =   480
      TabIndex        =   19
      Top             =   1200
      Width           =   1575
   End
   Begin VB.TextBox Textgname 
      Height          =   375
      Left            =   2280
      TabIndex        =   18
      Text            =   "Text3"
      Top             =   1200
      Width           =   1095
   End
   Begin VB.CheckBox Checksex 
      Caption         =   "修改性别"
      Height          =   255
      Left            =   480
      TabIndex        =   17
      Top             =   1800
      Width           =   1095
   End
   Begin VB.CheckBox Checkage 
      Caption         =   "修改年龄"
      Height          =   255
      Left            =   480
      TabIndex        =   16
      Top             =   2400
      Width           =   1095
   End
   Begin VB.CheckBox Checkcert 
      Caption         =   "修改证件号码"
      Height          =   255
      Left            =   480
      TabIndex        =   15
      Top             =   3720
      Width           =   1455
   End
   Begin VB.CheckBox Checkcountry 
      Caption         =   "修改国籍"
      Height          =   255
      Left            =   480
      TabIndex        =   14
      Top             =   4320
      Width           =   1095
   End
   Begin VB.CheckBox Checkarr 
      Caption         =   "修改离开日期"
      Height          =   255
      Left            =   480
      TabIndex        =   13
      Top             =   4920
      Width           =   1455
   End
   Begin VB.TextBox Textsex 
      Height          =   375
      Left            =   2280
      TabIndex        =   12
      Text            =   "Text4"
      Top             =   1800
      Width           =   1095
   End
   Begin VB.TextBox Textage 
      Height          =   375
      Left            =   2280
      TabIndex        =   11
      Text            =   "Text5"
      Top             =   2400
      Width           =   1095
   End
   Begin VB.TextBox Textcert 
      Height          =   375
      Left            =   2280
      TabIndex        =   10
      Text            =   "Text6"
      Top             =   3600
      Width           =   3495
   End
   Begin VB.TextBox Textcountry 
      Enabled         =   0   'False
      Height          =   375
      Left            =   2280
      TabIndex        =   9
      Text            =   "Text7"
      Top             =   4200
      Width           =   1095
   End
   Begin VB.TextBox Textleave 
      Height          =   375
      Left            =   2280
      TabIndex        =   8
      Text            =   "Text9"
      Top             =   4920
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "修改"
      Height          =   495
      Left            =   1920
      TabIndex        =   7
      Top             =   6720
      Width           =   1095
   End
   Begin VB.CommandButton Command2 
      Caption         =   "退出"
      Height          =   495
      Left            =   4200
      TabIndex        =   6
      Top             =   6720
      Width           =   1095
   End
   Begin VB.CheckBox Checkcertc 
      Caption         =   "修改证件种类"
      Height          =   375
      Left            =   480
      TabIndex        =   5
      Top             =   3000
      Width           =   1455
   End
   Begin VB.TextBox Textcertc 
      Enabled         =   0   'False
      Height          =   375
      Left            =   2280
      TabIndex        =   4
      Text            =   "Text1"
      Top             =   3000
      Width           =   1095
   End
   Begin VB.CheckBox Checkremark 
      Caption         =   "修改备注"
      Height          =   255
      Left            =   480
      TabIndex        =   3
      Top             =   5520
      Width           =   1575
   End
   Begin VB.TextBox Textremark 
      Height          =   855
      Left            =   2280
      TabIndex        =   2
      Top             =   5520
      Width           =   3495
   End
   Begin MSDataListLib.DataCombo Datacountry 
      Height          =   330
      Left            =   4560
      TabIndex        =   0
      Top             =   4200
      Width           =   1095
      _ExtentX        =   1931
      _ExtentY        =   582
      _Version        =   393216
      Text            =   ""
   End
   Begin MSDataListLib.DataCombo Datacert 
      Height          =   330
      Left            =   4560
      TabIndex        =   1
      Top             =   3000
      Width           =   1095
      _ExtentX        =   1931
      _ExtentY        =   582
      _Version        =   393216
      Text            =   ""
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "原房间号:"
      Height          =   255
      Left            =   1320
      TabIndex        =   28
      Top             =   600
      Width           =   1095
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "换为"
      Height          =   255
      Left            =   3600
      TabIndex        =   27
      Top             =   600
      Width           =   375
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "男:M    女:F"
      Height          =   255
      Left            =   3720
      TabIndex        =   26
      Top             =   1920
      Width           =   1335
   End
   Begin VB.Label Label4 
      BackStyle       =   0  'Transparent
      Caption         =   "更改为:"
      Height          =   255
      Left            =   3600
      TabIndex        =   25
      Top             =   3120
      Width           =   735
   End
   Begin VB.Label Label6 
      BackStyle       =   0  'Transparent
      Caption         =   "更改为:"
      Height          =   255
      Left            =   3600
      TabIndex        =   24
      Top             =   4320
      Width           =   615
   End
   Begin VB.Label Label5 
      BackStyle       =   0  'Transparent
      Caption         =   "yyyy-mm-dd"
      Height          =   255
      Left            =   3720
      TabIndex        =   23
      Top             =   5040
      Width           =   1215
   End
End
Attribute VB_Name = "Frmchangeg"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rsguests As ADODB.Recordset
Dim rscertclasses As ADODB.Recordset
Dim rscountry As ADODB.Recordset
Dim str As String

Private Sub Command1_Click()
Set cnn = New ADODB.Connection
Dim connectstring As String
connectstring = "DSN=hotelodbc"
cnn.Open connectstring

Dim a As String
If Checkcf.Value = 1 Then
str = "update guests set roomcode='" & Textroomno2.Text & "' where roomcode='" & Frmchaxung.Dataguests.Columns(0) & "'"
str1 = "update roomstate set roomstate='l' where roomcode='" & Textroomno2.Text & "'"
str2 = "update roomstate set roomstate='z' where roomcode='" & Textroomno1.Text & "'"
cnn.Execute str
cnn.Execute str1
cnn.Execute str2
a = "'换房'"
Else: a = ""
End If

Dim b As String
If Checkgn.Value = 1 Then
str = "update guests  set name='" & Textgname & "' where roomcode='" & Frmchaxung.Dataguests.Columns(0) & "'"
cnn.Execute str
b = "'客人姓名'"
Else: b = ""
End If

Dim c As String
If Checksex.Value = 1 Then
str = "update guests  set sex='" & Textsex & "' where roomcode='" & Frmchaxung.Dataguests.Columns(0) & "'"
cnn.Execute str
c = "'客人性别'"
Else: c = ""
End If

Dim d As String
If Checkage.Value = 1 Then
str = "update guests  set age='" & Textage & "' where roomcode='" & Frmchaxung.Dataguests.Columns(0) & "'"
cnn.Execute str
d = "'客人年龄'"
Else: d = ""
End If

Dim e As String
If Checkcertc.Value = 1 Then
str = "update guests  set certclassno='" & Datacert.BoundText & "' where roomcode='" & Frmchaxung.Dataguests.Columns(0) & "'"
cnn.Execute str
e = "'证件'"
Else: e = ""
End If

Dim f As String
If Checkcert.Value = 1 Then
str = "update guests  set certificate ='" & Textcert & "' where roomcode='" & Frmchaxung.Dataguests.Columns(0) & "'"
cnn.Execute str
f = "'证件号码'"
Else: f = ""
End If

Dim i As String
If Checkcountry.Value = 1 Then
str = "update guests  set countryno ='" & Datacountry.BoundText & "' where roomcode='" & Frmchaxung.Dataguests.Columns(0) & "'"
cnn.Execute str
i = "'国籍'"
Else: i = ""
End If

Dim g As String
If Checkarr.Value = 1 Then
str = "update guests  set leftdate ='" & Textleave & "' where roomcode='" & Frmchaxung.Dataguests.Columns(0) & "'"
cnn.Execute str
g = "'离开日期'"
Else: g = ""
End If

Dim h As String
If Checkremark.Value = 1 Then
str = "update guests  set remarks ='" & Textremark & "' where roomcode='" & Frmchaxung.Dataguests.Columns(0) & "'"
cnn.Execute str
h = "'备注'"
Else: h = ""
End If

If a = "" And b = "" And c = "" And d = "" And e = "" And f = "" And i = "" And g = "" And h = "" Then
  MsgBox "请选择修改的内容", vbOKOnly + vbInformation, "提示"
Else:
  MsgBox "修改" & a & "" & b & "" & c & "" & d & "" & e & "" & f & "" & g & "" & h & "" & i & "成功", vbOKOnly + vbInformation, "提示"
  
  
  Unload Me
End If

End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Load()
Textroomno1.Text = Frmchaxung.Dataguests.Columns(0)
Textgname.Text = Frmchaxung.Dataguests.Columns(1)
Textsex.Text = Frmchaxung.Dataguests.Columns(2)
Textage.Text = Frmchaxung.Dataguests.Columns(3)
Textcertc.Text = Frmchaxung.Dataguests.Columns(4)
Textcert.Text = Frmchaxung.Dataguests.Columns(5)
Textcountry.Text = Frmchaxung.Dataguests.Columns(6)
Textleave.Text = Frmchaxung.Dataguests.Columns(8)
Textremark.Text = Frmchaxung.Dataguests.Columns(9)

Set cnn = New ADODB.Connection
Dim connectstring As String
connectstring = "DSN=hotelodbc"
cnn.Open connectstring

Set rscertclasses = New ADODB.Recordset
str = "select * from certclasses "
rscertclasses.Open str, cnn, adOpenKeyset, adLockOptimistic
Set Datacert.RowSource = rscertclasses
Datacert.ListField = "certclass"
Datacert.BoundColumn = "certno"
rscertclasses.MoveFirst
Datacert.Text = rscertclasses.Fields("certclass")

Set rscountry = New ADODB.Recordset
str = "select * from countrycodes "
rscountry.Open str, cnn, adOpenKeyset, adLockOptimistic
Set Datacountry.RowSource = rscountry
Datacountry.ListField = "country"
Datacountry.BoundColumn = "countryno"
rscountry.MoveFirst
Datacountry.Text = rscountry.Fields("country")

End Sub



⌨️ 快捷键说明

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