当前仓库属于暂停状态,部分功能使用受限,详情请查阅 仓库状态说明
4 Star 18 Fork 3

Fidel / 拍卖软件
暂停

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
AdminForm.frm 16.63 KB
一键复制 编辑 原始数据 按行查看 历史
Fidel 提交于 2017-12-03 18:22 . beta 1.2.0 版本更新
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
VERSION 5.00
Begin VB.Form AdminForm
BorderStyle = 3 'Fixed Dialog
Caption = "管理界面"
ClientHeight = 4770
ClientLeft = 45
ClientTop = 375
ClientWidth = 4590
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4770
ScaleWidth = 4590
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton buy
Caption = "成交"
Height = 495
Left = 2880
TabIndex = 20
Top = 4080
Width = 1455
End
Begin VB.CommandButton Turn
Caption = "更新"
Height = 495
Left = 2880
TabIndex = 19
Top = 3480
Width = 1455
End
Begin VB.TextBox NewMoney
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 960
TabIndex = 18
Top = 4080
Width = 1815
End
Begin VB.TextBox buyName
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 960
TabIndex = 16
Top = 3480
Width = 1815
End
Begin VB.CommandButton Down
Caption = "下一个"
Height = 495
Left = 3240
TabIndex = 6
Top = 480
Width = 1095
End
Begin VB.CommandButton Up
Caption = "上一个"
Height = 495
Left = 2040
TabIndex = 5
Top = 480
Width = 1095
End
Begin VB.TextBox Number
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 720
TabIndex = 2
Top = 480
Width = 1215
End
Begin VB.Label PeopleNames
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3120
TabIndex = 22
Top = 1560
Width = 1215
End
Begin VB.Label Label8
Caption = "拍卖者"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 2400
TabIndex = 21
Top = 1560
Width = 855
End
Begin VB.Label Label10
Caption = "拍卖价"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 17
Top = 4200
Width = 735
End
Begin VB.Line Line1
BorderColor = &H8000000A&
X1 = 4320
X2 = 240
Y1 = 3360
Y2 = 3360
End
Begin VB.Label Label9
Caption = "竞买者"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 15
Top = 3600
Width = 1095
End
Begin VB.Label Moneys
BackColor = &H00C0C0C0&
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1320
TabIndex = 14
Top = 2880
Width = 1455
End
Begin VB.Label Label7
Caption = "当前拍卖价"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 13
Top = 3000
Width = 1095
End
Begin VB.Label buyNames
BackColor = &H00C0C0C0&
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1320
TabIndex = 12
Top = 2400
Width = 975
End
Begin VB.Label Label5
Caption = "当前竞买者"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 11
Top = 2520
Width = 1095
End
Begin VB.Label MinMoneys
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1200
TabIndex = 10
Top = 1920
Width = 1095
End
Begin VB.Label Label6
Caption = "最低增幅"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 9
Top = 2040
Width = 855
End
Begin VB.Label FirstMoneys
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 960
TabIndex = 8
Top = 1440
Width = 1335
End
Begin VB.Label Label4
Caption = "起拍价"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 7
Top = 1560
Width = 855
End
Begin VB.Label Names
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 720
TabIndex = 4
Top = 1080
Width = 3615
End
Begin VB.Label Label3
Caption = "名称"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 3
Top = 1080
Width = 615
End
Begin VB.Label Label2
Caption = "序号"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 1
Top = 600
Width = 495
End
Begin VB.Label Label1
Caption = "拍卖软件 管理界面"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 0
Top = 120
Width = 2295
End
End
Attribute VB_Name = "AdminForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public FormAdmin As Boolean
Dim datNo As Integer
Dim datPeopleName As String
Dim datName As String
Dim datPassage As String
Dim datFirstMoney As Single
Dim datMinMoney As Single
'定义Excel模块变量
Dim objExcelFile As Excel.Application
Dim objWorkBook As Excel.Workbook
Dim objImportSheet As Excel.Worksheet
'定义实时变量
Dim nowMoney As Single
Private Sub LoadDat() '载入数据
'读取数据
If Number.Text < 1 Then
Number.Text = 1
End If
intCountI = Number.Text + 1
'Check if Empty Data Row
blnNullRow = True
'如果第1到第10个单元格的值均为空或空格,则视为空行
For intI = 1 To 6
If Trim$(objImportSheet.Cells(intCountI, intI).Value) <> "" Then
blnNullRow = False
Else
datName = ""
datPeopleName = ""
datFirstMoney = 0
datMinMoney = 0
datPassage = ""
End If
Next intI
'若不是空行,则进行读取动作,否则继续向后遍历Excel中的行
If blnNullRow = False Then
'获取单元格中的数据,做有效性Check,并将合法数据创建为实体存入对象数组中
datName = objImportSheet.Cells(intCountI, 2)
datPeopleName = objImportSheet.Cells(intCountI, 3)
datFirstMoney = objImportSheet.Cells(intCountI, 4)
datMinMoney = objImportSheet.Cells(intCountI, 5)
datPassage = objImportSheet.Cells(intCountI, 6)
End If
'读取数据
Names.Caption = datName
PeopleNames.Caption = datPeopleName
FirstMoneys.Caption = datFirstMoney
MinMoneys.Caption = datMinMoney
'同步至大屏幕
Form1.Number.Caption = Number.Text
Form1.PeopleName.Caption = datPeopleName
Form1.Names.Caption = datName
Form1.Passage.Caption = datPassage
Form1.FirstMoney = datFirstMoney
Form1.MinMoney = datMinMoney
Form1.Money.Caption = datFirstMoney
Form1.buyName.Caption = ""
'载入图片
If Dir(App.Path + "\Images\" & Number.Text & ".jpg") <> "" Then
Form1.Image1.Picture = LoadPicture(App.Path + "\Images\" & Number.Text & ".jpg")
ElseIf Dir(App.Path + "\Images\" & Number.Text & ".jpeg") <> "" Then
Form1.Image1.Picture = LoadPicture(App.Path + "\Images\" & Number.Text & ".jpeg")
Else
Form1.Image1.Picture = LoadPicture
End If
'实时变量赋值
nowMoney = datFirstMoney
'判断是否成交
For intI = 8 To 9
If Trim$(objImportSheet.Cells(intCountI, intI)) <> "" Then
Form1.State.Caption = "已成交"
Form1.State.BackColor = &H8080FF
Form1.Money.Caption = objImportSheet.Cells(intCountI, 9)
Moneys.Caption = objImportSheet.Cells(intCountI, 9)
Form1.buyName.Caption = objImportSheet.Cells(intCountI, 8)
buyNames.Caption = objImportSheet.Cells(intCountI, 8)
nowMoney = objImportSheet.Cells(intCountI, 9)
Else
Form1.State.Caption = "拍卖中"
Form1.State.BackColor = &H80FF80
Form1.Money.Caption = datMinMoney
Form1.buyName.Caption = ""
buyNames.Caption = ""
Moneys.Caption = datMinMoney
End If
Next intI
End Sub
Private Sub buy_Click()
On Error GoTo error
'成交
objImportSheet.Cells(Number.Text + 1, 8) = buyNames.Caption
objImportSheet.Cells(Number.Text + 1, 9) = nowMoney
Form1.State.Caption = "已成交"
Form1.State.BackColor = &H8080FF
buyName.Text = ""
NewMoney.Text = ""
buyName.SetFocus
Exit Sub
error:
MsgBox "数据类型错误"
End Sub
Private Sub buyName_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
NewMoney.SetFocus
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
FormAdmin = False
objWorkBook.SaveAs App.Path + "\data.xlsx"
'结束Excel模块
objExcelFile.Quit
Set objWorkBook = Nothing
Set objImportSheet = Nothing
Set objExcelFile = Nothing
End Sub
Private Sub NewMoney_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call Turn_Click
End If
End Sub
Private Sub Number_KeyPress(KeyAscii As Integer)
On Error GoTo error
If KeyAscii = 13 Then
buyName.SetFocus
Call LoadDat
End If
error:
MsgBox "数据类型错误"
End Sub
Private Sub Turn_Click()
On Error GoTo error
'更新数据
If NewMoney.Text = "" Or buyName.Text = "" Then
MsgBox "数值为空!"
Else
If NewMoney.Text - nowMoney < datMinMoney Then
MsgBox "小于最小增幅!"
Else
nowMoney = NewMoney.Text
buyNames.Caption = buyName.Text
Moneys.Caption = NewMoney.Text
Form1.Money.Caption = NewMoney.Text
Form1.buyName.Caption = buyName.Text
End If
End If
buyName.Text = ""
NewMoney.Text = ""
buyName.SetFocus
Exit Sub
error:
MsgBox "数据类型错误"
End Sub
Private Sub Down_Click()
On Error GoTo error
Number.Text = Number.Text + 1
Call LoadDat
Exit Sub
error:
MsgBox "数据类型错误"
End Sub
Private Sub Form_Load()
On Error GoTo error
FormAdmin = True
'加载Excel模块
Set objExcelFile = New Excel.Application
objExcelFile.DisplayAlerts = False
Set objWorkBook = objExcelFile.Workbooks.Open(App.Path + "\data.xlsx")
Set objImportSheet = objWorkBook.Sheets(1)
'获取行数
Number.Text = 1
Call LoadDat
Exit Sub
error:
MsgBox "数据类型错误"
End Sub
Private Sub Up_Click()
On Error GoTo error
If Number.Text > 1 Then
Number.Text = Number.Text - 1
End If
Call LoadDat
Exit Sub
error:
MsgBox "数据类型错误"
End Sub
Visual Basic
1
https://gitee.com/fidelxyz/Auction.git
git@gitee.com:fidelxyz/Auction.git
fidelxyz
Auction
拍卖软件
master

搜索帮助