?? 報損單.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form 報損單
BackColor = &H00FFC0C0&
BorderStyle = 3 'Fixed Dialog
Caption = "報損單"
ClientHeight = 6810
ClientLeft = 2760
ClientTop = 3750
ClientWidth = 8220
FillColor = &H00FF0000&
FillStyle = 7 'Diagonal Cross
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
HelpContextID = 226
Icon = "報損單.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 6810
ScaleWidth = 8220
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton 刪除報損單
BackColor = &H00FFC0C0&
Caption = "刪除報損單"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 6540
MaskColor = &H8000000F&
Style = 1 'Graphical
TabIndex = 3
Top = 6180
WhatsThisHelpID = 226
Width = 1335
End
Begin VB.CommandButton 打印報損單
BackColor = &H00FFC0C0&
Caption = "打印報損單"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4980
Style = 1 'Graphical
TabIndex = 2
Top = 6180
WhatsThisHelpID = 226
Width = 1395
End
Begin VB.CommandButton B新增報損單
BackColor = &H00FFC0C0&
Caption = "新增報損單"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3300
Style = 1 'Graphical
TabIndex = 1
Top = 6180
WhatsThisHelpID = 226
Width = 1395
End
Begin MSDataGridLib.DataGrid DataGrid1
Height = 5715
Left = 180
TabIndex = 0
Top = 180
WhatsThisHelpID = 226
Width = 7815
_ExtentX = 13785
_ExtentY = 10081
_Version = 393216
AllowUpdate = -1 'True
AllowArrows = -1 'True
ForeColor = -2147483630
HeadLines = 2
RowHeight = 18
TabAction = 1
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "楷體_GB2312"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
SizeMode = 1
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc1
Height = 390
Left = 180
Top = 6180
WhatsThisHelpID = 226
Width = 2955
_ExtentX = 5212
_ExtentY = 688
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = 16759225
ForeColor = -2147483630
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = $"報損單.frx":000C
Caption = ""
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 11.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
End
Attribute VB_Name = "報損單"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private SQL As String
Private startcol As Integer
Private endcol As Integer
Private col, row As Integer
Private rowheight As Integer
Private colwidth(14) As Long
Private order(14) As Boolean
Option Explicit
Private Sub SaveInit()
startcol = DataGrid1.SelStartCol
endcol = DataGrid1.SelEndCol
col = DataGrid1.LeftCol
row = DataGrid1.row
rowheight = DataGrid1.rowheight
Dim i As Integer
For i = 0 To DataGrid1.Columns.count - 1
colwidth(i) = DataGrid1.Columns(i).Width
Next
End Sub
Private Sub ResumeInit()
DataGrid1.SelStartCol = startcol
DataGrid1.SelEndCol = endcol
DataGrid1.Scroll col, row
DataGrid1.rowheight = rowheight
Dim i As Integer
For i = 0 To DataGrid1.Columns.count - 1
DataGrid1.Columns(i).Width = colwidth(i)
Next
DataGrid1.Columns(0).Locked = True
DataGrid1.Columns(1).Locked = True
DataGrid1.Columns(2).Locked = True
DataGrid1.Columns(3).Locked = True
DataGrid1.Columns(4).Locked = True
DataGrid1.Columns(6).Locked = True
DataGrid1.Columns(7).Locked = True
DataGrid1.Columns(8).Locked = True
DataGrid1.Columns(9).Locked = True
DataGrid1.Columns(10).Locked = True
End Sub
Private Sub initdatagrid1()
DataGrid1.Columns(0).Width = 500
DataGrid1.Columns(1).Width = 1000
DataGrid1.Columns(2).Width = 1000
DataGrid1.Columns(3).Width = 1000
DataGrid1.Columns(4).Width = 1000
DataGrid1.Columns(5).Width = 1000
DataGrid1.Columns(6).Width = 800
DataGrid1.Columns(7).Width = 800
DataGrid1.Columns(8).Width = 800
DataGrid1.Columns(9).Width = 800
DataGrid1.Columns(10).Width = 800
DataGrid1.Columns(11).Width = 800
DataGrid1.Columns(12).Width = 800
DataGrid1.Columns(0).Locked = True
DataGrid1.Columns(1).Locked = True
DataGrid1.Columns(2).Locked = True
DataGrid1.Columns(3).Locked = True
DataGrid1.Columns(4).Locked = True
DataGrid1.Columns(6).Locked = True
DataGrid1.Columns(7).Locked = True
DataGrid1.Columns(8).Locked = True
DataGrid1.Columns(9).Locked = True
DataGrid1.Columns(10).Locked = True
DataGrid1.rowheight = 270
End Sub
Private Sub Adodc1_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
On Error Resume Next
Adodc1.caption = Adodc1.Recordset.Fields("貨物名稱").Value
End Sub
Private Sub B新增報損單_Click()
新增報損單.Show vbModal
SaveInit
Adodc1.Refresh
ResumeInit
End Sub
Private Sub DataGrid1_HeadClick(ByVal ColIndex As Integer)
On Error Resume Next
Dim caption As String
caption = DataGrid1.Columns(ColIndex).caption
If caption = "經辦人" Then caption = "姓名"
If caption = "金額" Then Exit Sub
If caption = "備注" Then caption = "報損單.備注"
If caption = "編號" Then caption = "報損單.編號"
If caption = "存放倉庫" Then caption = "倉庫名稱"
Adodc1.RecordSource = SQL + " order by " + caption
order(ColIndex) = True - order(ColIndex)
If order(ColIndex) = True Then
Adodc1.RecordSource = Adodc1.RecordSource + " ASC"
Else
Adodc1.RecordSource = Adodc1.RecordSource + " DESC"
End If
SaveInit
Adodc1.Refresh
ResumeInit
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = DataConnectString
SQL = Adodc1.RecordSource
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
initdatagrid1
'通過權限來初始化控件性質
If 權限類別(0) = 0 Then B新增報損單.Enabled = False
If 權限類別(1) = 0 Then DataGrid1.AllowUpdate = False
If 權限類別(2) = 0 Then 刪除報損單.Enabled = False
If 權限類別(8) = 0 Then 打印報損單.Enabled = False
End Sub
Private Sub 打印報損單_Click()
On Error GoTo quit
Dim p As New 新增報損單
p.編號 = DataGrid1.Columns(0).Value
p.Show vbModal
Unload p
quit:
End Sub
Private Sub 刪除報損單_Click()
On Error GoTo quit
Dim code As Long
code = DataGrid1.Columns(0).Text
If MsgBox("您確信要刪除該報損單嗎?", vbYesNo Or vbQuestion) = vbNo Then Exit Sub
On Error Resume Next
'更新報損單
fMainForm.m_checkado.RecordSource = "select * from 報損單 where 編號=" + Str(code)
fMainForm.m_checkado.Refresh
fMainForm.m_checkado.Recordset.Delete
fMainForm.m_checkado.Refresh
SaveInit
Adodc1.Refresh
ResumeInit
MsgBox "報損單刪除成功!"
'寫入系統日志
fMainForm.WriteLog ("刪除報損單")
quit:
End Sub
'此源碼由程序太平洋收集整理發布,任何人都可自由轉載,但需保留本站信息
'╭⌒╮┅~ ¤ 歡迎光臨程序太平洋╭⌒╮
'╭⌒╭⌒╮╭⌒╮~╭⌒╮ ︶ ,︶︶
',︶︶︶︶,''︶~~ ,''~︶︶ ,''
'╔ ╱◥███◣═╬╬╬╬╬╬╬╬╬╗
'╬ ︱田︱田 田 ︱ ╬
'╬ http://www.5ivb.net ╬
'╬ ╭○╮● ╬
'╬ /■\/■\ ╬
'╬ <| || 有希望,就有成功! ╬
'╬ ╬
'╚╬╬╬╬╬╬╬╬╬╬╗ ╔╬╬╬╬╝
'
'說明:
'專業提供VB、.NET、Delphi、ASP、PB源碼下載
'包括:程序源碼,控件,商業源碼,系統方案,開發工具,書籍教程,技術文檔
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -