?? orderdetails.frm
字號:
VERSION 5.00
Object = "{8ED8CCC1-8472-46D0-93E7-F66929B98442}#2.0#0"; "XPCMD.OCX"
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
Begin VB.Form Orderdetails
Caption = "Form1"
ClientHeight = 5670
ClientLeft = 1845
ClientTop = 2130
ClientWidth = 9885
LinkTopic = "Form1"
ScaleHeight = 5670
ScaleWidth = 9885
Begin VB.TextBox OrderNoText
Height = 375
Left = 4920
TabIndex = 7
Top = 3840
Width = 1935
End
Begin MSHierarchicalFlexGridLib.MSHFlexGrid OrderdetailsGrid
Bindings = "Orderdetails.frx":0000
Height = 2775
Left = 720
TabIndex = 0
Top = 840
Width = 8535
_ExtentX = 15055
_ExtentY = 4895
_Version = 393216
Cols = 9
FixedCols = 0
DataMember = "ComOrderdetails"
_NumberOfBands = 1
_Band(0).Cols = 9
_Band(0)._NumMapCols= 9
_Band(0)._MapCol(0)._Name= "租借號"
_Band(0)._MapCol(0)._RSIndex= 0
_Band(0)._MapCol(1)._Name= "會員ID"
_Band(0)._MapCol(1)._RSIndex= 1
_Band(0)._MapCol(2)._Name= "影片名稱"
_Band(0)._MapCol(2)._RSIndex= 2
_Band(0)._MapCol(3)._Name= "影片類型"
_Band(0)._MapCol(3)._RSIndex= 3
_Band(0)._MapCol(4)._Name= "數(shù)量"
_Band(0)._MapCol(4)._RSIndex= 4
_Band(0)._MapCol(4)._Alignment= 7
_Band(0)._MapCol(5)._Name= "租借日期"
_Band(0)._MapCol(5)._RSIndex= 5
_Band(0)._MapCol(6)._Name= "應(yīng)歸還日期"
_Band(0)._MapCol(6)._RSIndex= 6
_Band(0)._MapCol(7)._Name= "實際歸還日期"
_Band(0)._MapCol(7)._RSIndex= 7
_Band(0)._MapCol(8)._Name= "固定租金"
_Band(0)._MapCol(8)._RSIndex= 8
_Band(0)._MapCol(8)._Alignment= 7
End
Begin VB.Frame Frame1
Height = 1095
Left = 720
TabIndex = 1
Top = 4320
Width = 8535
Begin XPCmd.xpcmdbutton RefreshBT
Height = 495
Left = 3720
TabIndex = 9
Top = 360
Width = 1215
_ExtentX = 2143
_ExtentY = 873
Caption = " 刷 新"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin XPCmd.xpcmdbutton xpcmdbutton1
Height = 495
Left = 7080
TabIndex = 3
Top = 360
Width = 1215
_ExtentX = 2143
_ExtentY = 873
Caption = " 離 開"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin XPCmd.xpcmdbutton CancelBT
Height = 495
Left = 5400
TabIndex = 4
Top = 360
Width = 1215
_ExtentX = 2143
_ExtentY = 873
Caption = " 取 消"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin XPCmd.xpcmdbutton DelteBT
Height = 495
Left = 1920
TabIndex = 5
Top = 360
Width = 1215
_ExtentX = 2143
_ExtentY = 873
Caption = " 刪 除"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin XPCmd.xpcmdbutton okBT
Height = 495
Left = 240
TabIndex = 6
Top = 360
Width = 1215
_ExtentX = 2143
_ExtentY = 873
Caption = " 確 定"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
End
Begin VB.Label Label2
Caption = "您的租借ID號:"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 285
Left = 2640
TabIndex = 8
Top = 3840
Width = 2010
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "租借信息"
BeginProperty Font
Name = "宋體"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF00FF&
Height = 315
Left = 4080
TabIndex = 2
Top = 240
Width = 1260
End
End
Attribute VB_Name = "Orderdetails"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim com As Command
Dim rst As Recordset
Dim id, trueid, memid, vcdname, tablename, remoney, zhmoney, tbname As String
Private Sub CancelBT_Click()
rst.Open "delete orderdetails", con, adOpenDynamic, adLockBatchOptimistic
Unload Me
End Sub
Private Sub DelteBT_Click()
zhmoney = VCDView.MoneyListText.Text
MsgBox id
trueid = "00" & id + 1
MsgBox "00" & id + 1
Dim a As Integer
a = MsgBox("確定要刪除第" & id + 1 & "條記錄嗎?!", vbYesNo, "提示信息")
'rst.Close
rst.Open "select * from orderdetails", con, adOpenDynamic, adLockBatchOptimistic
If a = 6 Then
'On Error GoTo err
'rst.Open "delete orderdetails where corderno='" & trueid & "'", con, adOpenDynamic, adLockBatchOptimistic
rst.Move (id)
rst.Delete
'rst.MoveNext
On Error GoTo err
If rst.EOF Then rst.MoveLast
rst.Close
MsgBox "信息刪除成功!"
OrdertailsData.rsComOrderdetails.Requery
Set OrderdetailsGrid.DataSource = OrdertailsData
'On Error GoTo err
OrderdetailsGrid.Row = trueid
OrderdetailsGrid.Col = 1
memid = Trim(OrderdetailsGrid.Text)
MsgBox memid
OrderdetailsGrid.Col = 2
vcdname = Trim(OrderdetailsGrid.Text)
MsgBox vcdname
OrderdetailsGrid.Col = 3
tablename = Trim(OrderdetailsGrid.Text)
MsgBox tablename
Select Case tablename
Case "愛情"
tbname = "love"
Case "喜劇"
tbname = "comedy"
Case "卡通"
tbname = "cartoon"
Case "科幻"
tbname = "science"
Case "冒險"
tbname = "venture"
Case "動作"
tbname = "action"
Case "藝術(shù)"
tbname = "art"
Case "戰(zhàn)爭"
tbname = "war"
Case "廣告"
tbname = "advertisement"
Case "恐怖"
tbname = "terror"
End Select
MsgBox tbname
OrderdetailsGrid.Col = 8
remoney = Trim(OrderdetailsGrid.Text)
MsgBox remoney
rst.Open "update " & tbname & " set istock=istock+1 where cname='" & vcdname & "'", con, adOpenDynamic, adLockBatchOptimistic
MsgBox "庫存回復(fù)!"
VCDView.MoneyListText.Text = CDbl(remoney) + CDbl(zhmoney)
'rst.Open "update member set mmoney=mmoney+" & CInt(remoney) & " where cmemberid='" & memid & "'", con, adOpenDynamic, adLockBatchOptimistic
MsgBox "賬戶回復(fù)!"
OrdertailsData.rsComOrderdetails.Requery
Set OrderdetailsGrid.DataSource = OrdertailsData
Else
Orderdetails.Show
rst.Close
End If
Exit Sub
err:
MsgBox err.Description
End Sub
Private Sub Form_Load()
Set com = New Command
Set rst = New Recordset
com.ActiveConnection = con
'rst.Open "select * from orderdetails", con, adOpenDynamic, adLockBatchOptimistic
OrdertailsData.rsComOrderdetails.Requery
Set OrderdetailsGrid.DataSource = OrdertailsData
OrderNoText.Text = VCDView.RentID.Text
With OrderdetailsGrid
.ColWidth(0) = 800
.ColWidth(1) = 800
.ColWidth(2) = 2000
.ColWidth(3) = 800
.ColWidth(4) = 500
.ColWidth(5) = 1000
.ColWidth(6) = 1000
.ColWidth(7) = 1000
.ColWidth(8) = 450
End With
End Sub
Private Sub OKBT_Click()
Dim a, cNO As String
a = MsgBox("請確定您要租借的以上影片是否正確!正確按是,要修改按否", vbYesNo, "系統(tǒng)提示")
If a = 6 Then
'addid
'cNO = OrderNoText.Text
'rst.Open "insert orders (corderno) values ('" & cNO & "')", con, adOpenDynamic, adLockBatchOptimistic
'rst.Close
rst.Open "insert into orders select * from orderdetails ", con, adOpenDynamic, adLockBatchOptimistic
MsgBox "您的租借信息已保存!請于兩天后歸還,如不按時歸還,將從您的帳戶扣去0.1元/盤/天!如果還要租借,請重新登陸!"
'rst.Close
rst.Open "delete orderdetails", con, adOpenDynamic, adLockBatchOptimistic
MsgBox "orderdetails刪除成功!"
DelteBT.Enabled = False
Unload Me
Else
Orderdetails.Show
End If
End Sub
Private Sub OrderdetailsGrid_Click()
OrderdetailsGrid.Refresh
rows = OrderdetailsGrid.Row
MsgBox rows
id = VCDAdd.getid(rows - 2)
MsgBox id
OrdertailsData.rsComOrderdetails.Requery
Set OrderdetailsGrid.DataSource = OrdertailsData
'On Error GoTo err
'rst.Open
'rst.Move (id)
'Call display
'rst.Close
'Exit Sub
'err:
'MsgBox "數(shù)據(jù)表為空!沒有記錄可以顯示!"
'MsgBox err.Description
'rst.Close
End Sub
Private Sub RefreshBT_Click()
OrdertailsData.rsComOrderdetails.Requery
Set OrderdetailsGrid.DataSource = OrdertailsData
End Sub
Private Sub xpcmdbutton1_Click()
Unload Me
End Sub
Public Sub addid()
Dim orderid As String
'Dim rst As Recordset
'Set rst = New Recordset
'On Error GoTo err
'com.ActiveConnection = con
rst.Open "select cOrderNo from orders", con, adOpenDynamic, adLockOptimistic
If rst.EOF = True Then
orderid = "00001"
Else
orderid = getid(Trim(rst!cOrderNo))
rst.MoveNext
Do While rst.EOF = False
If orderid = Trim(rst!cOrderNo) Then
orderid = getid(Trim(rst!cOrderNo))
rst.MoveNext
Else
Exit Do
End If
Loop
End If
OrderNoText.Text = orderid
'rst.MoveFirst
rst.Close
Exit Sub
err:
MsgBox "數(shù)據(jù)庫還未連接!"
Unload Me
End Sub
Private Function getid(temp As String)
temp = temp + 1
If temp < 10 Then
getid = "0000" & temp
Exit Function
End If
If temp < 100 Then
getid = "000" & temp
Exit Function
End If
If temp < 1000 Then
getid = "00" & temp
Exit Function
End If
If temp < 10000 Then
getid = "0" & temp
Exit Function
Else
getid = temp
End If
End Function
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -