📄 storein.cls
字号:
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "StoreIn"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'1 StoreinId Int 入库编号(与相应的采购单号或销售退货单号相同)
'2 StoreinType Varchar 20 入库类型,包括采购入库和销售退货入库
'3 StoreId Int 仓库编号
'4 EmpName Varchar 50 经办人
'5 OptDate Varchar 20 入库日期
Public StoreinId As Long
Public StoreinType As String
Public StoreId As Long
Public EmpName As String
Public OptDate As String
Public Sub Init()
StoreinId = 0
StoreinType = ""
StoreId = 0
EmpName = ""
OptDate = ""
End Sub
Public Function HaveStore(ByVal TmpStoreId As Long) As Boolean
DB_Connect
SqlStmt = "SELECT StoreinId FROM StoreIn WHERE StoreId=" + Trim(TmpStoreId)
OdbcExt (SqlStmt)
If SQLFetch(Hstmt) <> SQL_NO_DATA_FOUND Then
HaveStore = True
Else
HaveStore = False
End If
Rc = SQLFreeStmt(Hstmt, SQL_DROP)
DB_Disconnect
End Function
Public Function GetInfo(ByVal TmpStoreinId As Long) As Boolean
If TmpStoreinId <= 0 Then
GetInfo = False
Init
Exit Function
End If
StoreinId = TmpStoreinId
DB_Connect
SqlStmt = "SELECT * FROM StoreIn WHERE StoreinId=" _
+ Trim(Str(TmpStoreinId))
OdbcExt (SqlStmt)
If SQLFetch(Hstmt) = SQL_NO_DATA_FOUND Then
GetInfo = False
Init
Exit Function
Else
ColVal = String(400, 0)
Rc = SQLGetData(Hstmt, 2, 1, ColVal, Lench(ColVal), pcblench)
StoreinType = TrimStr(ColVal)
ColVal = String(40, 0)
Rc = SQLGetData(Hstmt, 3, 1, ColVal, Lench(ColVal), pcblench)
StoreId = Val(ColVal)
ColVal = String(400, 0)
Rc = SQLGetData(Hstmt, 4, 1, ColVal, Lench(ColVal), pcblench)
EmpName = TrimStr(ColVal)
ColVal = String(400, 0)
Rc = SQLGetData(Hstmt, 5, 1, ColVal, Lench(ColVal), pcblench)
OptDate = TrimStr(ColVal)
End If
Rc = SQLFreeStmt(Hstmt, SQL_DROP)
GetInfo = True
DB_Disconnect
End Function
Public Sub Insert()
DB_Connect
SqlStmt = "INSERT INTO StoreIn Values(" + Trim(StoreinId) + ",'" _
+ Trim(StoreinType) + "'," + Trim(Str(StoreId)) _
+ ",'" + Trim(EmpName) + "','" + Trim(OptDate) + "')"
OdbcExt (SqlStmt)
Rc = SQLFreeStmt(Hstmt, SQL_DROP)
DB_Disconnect
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -