📄 stockstore.frm
字号:
CDbl(Trim(MSHFlexGrid1.TextMatrix(currentrow2, 3))), _
CDbl(Replace(Trim(MSHFlexGrid1.TextMatrix(currentrow2, 4)), "¥", "")), _
CDbl(Replace(Trim(MSHFlexGrid1.TextMatrix(currentrow2, 5)), "¥", "")), _
CDbl(Trim(MSHFlexGrid1.TextMatrix(currentrow2, 6))), _
Trim(MSHFlexGrid1.TextMatrix(currentrow2, 7))
End If
Next currentrow2
MainForm.g_application.m_databaseCon.m_adoConnection.CommitTrans
Exit Sub
EXITSUB:
MainForm.g_application.m_databaseCon.m_adoConnection.RollbackTrans
End Sub
'*******************************************************
'* 模 块 名 称 :检查文本框内容的有效性
'* 最后修改时间:2005/08/31
'* 备 注:
'*******************************************************
Private Function Check() As Boolean
Check = True
If Len(Trim(deliverydate.text)) = 0 Then
MainForm.g_msgText = "交货日期不能为空!"
Call HMsgBox(MainForm.g_msgText, 0, 1)
deliverydate.SetFocus
Check = False
Exit Function
End If
If Not IsDate(Trim(deliverydate.text)) Then
MainForm.g_msgText = "交货日期格式有错!"
HMsgBox MainForm.g_msgText, 0, 1
deliverydate.SetFocus
Check = False
Exit Function
End If
If Len(Trim(suppliername.text)) = 0 Then
MainForm.g_msgText = "供应商名称不能为空!"
Call HMsgBox(MainForm.g_msgText, 0, 1)
'suppliername.SetFocus
Check = False
Exit Function
End If
If Len(Trim(store.text)) = 0 Then
MainForm.g_msgText = "仓库位不能为空!"
Call HMsgBox(MainForm.g_msgText, 0, 1)
Check = False
Exit Function
End If
If CDate(deliverydate.text) < Date Then
MainForm.g_msgText = "交货日期比记录时间小!"
Call HMsgBox(MainForm.g_msgText, 0, 1)
deliverydate.SetFocus
Check = False
Exit Function
End If
Dim Y As Integer
Dim p As Integer
p = 1
For Y = 1 To j - 1
If Trim(MSHFlexGrid1.TextMatrix(Y, 1)) = "" Then
p = p + 1
End If
Next Y
If Y = p Then
MainForm.g_msgText = "请输入一条记录!!"
Call HMsgBox(MainForm.g_msgText, 0, 1)
Check = False
Exit Function
End If
If Len(Trim(inputman.text)) = 0 Then
MainForm.g_msgText = "制单人不能为空!"
Call HMsgBox(MainForm.g_msgText, 0, 1)
Check = False
Exit Function
End If
End Function
'*******************************************************
'* 模 块 名 称 :显示保存入库--供应商的信息
'* 功 能 描 述 :显示供应商的数据
'*******************************************************
Private Sub suppliershow() '显示采购订单-供应商记录
Dim ret As Boolean
ret = m_stockstoreDAO.stockstore_show1(m_recordset, Trim(stockstorelistform.stockstoreid))
With m_recordset
counterman.text = Trim(.Fields("counterman"))
inputman.text = Trim(.Fields("inputman"))
storenotenum.text = Trim(.Fields("storenotenum"))
Text1.text = Trim(suppliername3)
storedate.text = Trim(.Fields("storedate"))
deliverydate.text = Trim(.Fields("deliverydate"))
superinrtendent.text = Trim(.Fields("superinrtendent"))
phone.text = Trim(.Fields("phone"))
memo.text = Trim(.Fields("memo"))
shhe.text = Trim(.Fields("shhe"))
store.text = Trim(storename)
suppliername.text = Trim(.Fields("store"))
suppliername.Tag = Trim(.Fields("stockstoreid"))
End With
m_recordset.Close
End Sub
'*******************************************************
'* 模 块 名 称 :显示保存入库--供应商所对应的商品信息
'* 功 能 描 述 :显示商品的数据
'*******************************************************
Private Sub goodsshow() '显示采购订单-商品记录
Dim ret As Boolean
Dim i As Integer
ret = m_stockstoreDAO.s_stockstoredetail(m_recordset, Trim(stockstorelistform.stockstoreid))
MSHFlexGrid1.clear
MSHFlexGrid1.Rows = 2
Call showform
With m_recordset
i = 1
Do While Not .EOF
If i > MSHFlexGrid1.Rows - 1 Then
MSHFlexGrid1.AddItem ""
End If
'[>>自定义填充内容
MSHFlexGrid1.TextMatrix(i, 0) = Trim(.Fields("stockstoredetailid")) '取一个采购订单明细的编号
Dim ret1 As Boolean
ret1 = m_goodsDAO.name_goods(g_recordset, Trim(.Fields("goodsid")))
MSHFlexGrid1.TextMatrix(i, 1) = Trim(g_recordset.Fields("name"))
g_recordset.Close
MSHFlexGrid1.TextMatrix(i, 2) = Trim(.Fields("unit"))
MSHFlexGrid1.TextMatrix(i, 3) = Trim(.Fields("num"))
MSHFlexGrid1.TextMatrix(i, 4) = "¥" & Trim(.Fields("price"))
MSHFlexGrid1.TextMatrix(i, 5) = "¥" & Trim(.Fields("money"))
MSHFlexGrid1.TextMatrix(i, 6) = Trim(.Fields("finishnum"))
MSHFlexGrid1.TextMatrix(i, 7) = Trim(.Fields("memo"))
MSHFlexGrid1.TextMatrix(i, 8) = Trim(.Fields("goodsid"))
MSHFlexGrid1.TextMatrix(i, 9) = CDbl(Trim(.Fields("num"))) + CDbl(Trim(.Fields("finishnum")))
'<<]
'动态集指针加1,同时将计数器加1(Fixed)
.MoveNext
i = i + 1
Loop
End With
m_recordset.Close ' 关闭数据集
End Sub
'*******************************************************
'* 模 块 名 称 :按钮事件
'* 功 能 描 述 :窗体给控件的有效性
'*******************************************************
Private Sub form_enabled()
storenotenum.Enabled = False
suppliername.Enabled = False
storedate.Enabled = False
phone.Enabled = False
deliverydate.Enabled = False
memo.Enabled = False
store.Enabled = False
counterman.Enabled = False
inputman.Enabled = False
shhe.Enabled = False
superinrtendent.Enabled = False
MSHFlexGrid1.Enabled = False
Text1.Enabled = False
Label2.Enabled = False
Label5.Enabled = False
Label11.Enabled = False
Label13.Enabled = False
Label8.Enabled = False
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command1.Enabled = False
Tlb_Action.Buttons("xz").Enabled = False
Tlb_Action.Buttons("bc").Enabled = False
Tlb_Action.Buttons("close").Enabled = False
Tlb_Action.Buttons("cx").Enabled = False
End Sub
'*******************************************************
'* 模 块 名 称 :检查保存入库内容的有效性
'* 最后修改时间:2005/09/09
'* 备 注:
'*******************************************************
Private Function judge_position() As Boolean
judge_position = True
Dim judge As Boolean
Dim currentrow3 As Integer
For currentrow3 = 1 To MSHFlexGrid1.Rows - 1
If Trim(MSHFlexGrid1.TextMatrix(currentrow3, 8)) <> "" Then
judge = m_stockstoreDAO.judge_position(m_recordset, Trim(store.Tag), Trim(MSHFlexGrid1.TextMatrix(currentrow3, 8)), "0")
If Not judge Then
Dim i As String
i = MsgBox("仓库里没有该商品的库位,你确定要添加吗?", vbOKCancel + vbInformation, "选择供应商提示")
If i = vbOK Then
' p_goodsname = MSHFlexGrid1.TextMatrix(currentrow3, 1)
' p_goodsid = MSHFlexGrid1.TextMatrix(currentrow3, 8)
' Add_position.show 1
positionsingleform.articleid = MSHFlexGrid1.TextMatrix(currentrow3, 8)
positionsingleform.articletype = "0"
positionsingleform.m_operatorType = 2
positionsingleform.warehouseid = store.Tag
positionsingleform.show 1
positionsingleform.articleid = ""
positionsingleform.articletype = ""
positionsingleform.warehouseid = ""
Else
judge_position = False
End If
End If
m_recordset.Close
Else
End If
Next currentrow3
End Function
'*******************************************************
'* 模 块 名 称 :判断是否真的要提交所填内容
'* 最后修改时间:2005/09/09
'* 备 注:
'*******************************************************
Private Function judge_position1() As Boolean
judge_position1 = True
Dim i As String
i = MsgBox("你真的要保存采购入库订单吗?", vbOKCancel + vbInformation, "添加采购入库订单提示")
If i = vbOK Then
judge_position1 = True
Else
judge_position1 = False
Exit Function
End If
End Function
'*******************************************************
'* 模 块 名 称 :查询记录
'* 功 能 描 述 :显示
'*******************************************************
Private Sub cxjl()
If stockstore_form = 0 Then
QueryFom.m_currentQuery = QUERY_STOCKORDER1
QueryFom.show 1
s_stockorderDAO.stockorderdetail1_show t_recordset, Trim(MainForm.g_application.m_queryResultId)
s_stockorderDAO.stockorderdetail_show m_recordset, Trim(MainForm.g_application.m_queryResultId)
ElseIf stockstore_form = 1 And stockstorelistform.stockstore_type = 1 Then
s_stockorderDAO.stockorderdetail1_show t_recordset, Trim(stockstore_stockstoreid)
s_stockorderDAO.stockorderdetail_show m_recordset, Trim(stockstore_stockstoreid)
End If
Dim ci As Integer
Dim d As Integer
Do While Not m_recordset.EOF
If Trim(m_recordset.Fields("num")) = Trim(m_recordset.Fields("finishnum")) Then
ci = ci + 1
End If
m_recordset.MoveNext
d = d + 1
Loop
If ci = m_recordset.RecordCount Then
MsgBox "该采购订单已经全部完成,不能再入库", vbOKOnly + vbInformation, "采购入库"
m_recordset.Close
ci = 0
d = 0
Unload Me
Exit Sub
End If
With t_recordset
If Not .EOF Then
If Trim(.Fields("shhe")) = 1 Then
MsgBox "该采购订单还未审核!!不能入库", vbOKOnly + vbInformation, "采购入库"
Exit Sub
ElseIf Trim(.Fields("shhe")) = 0 Then
MsgBox "欢迎添加采购订单", vbOKOnly + vbInformation, "采购入库"
End If
Dim ret1 As Boolean
ret1 = m_supplierDAO.S_DanTiao(s_recordset, Trim(.Fields("supplierid")))
Text1.text = Trim(s_recordset.Fields("supplier"))
s_recordset.Close
superinrtendent.text = Trim(.Fields("superinrtendent"))
phone.text = Trim(.Fields("phone"))
memo.text = Trim(.Fields("memo"))
suppliername.text = Trim(.Fields("supplierid"))
storenotenum.text = Trim(.Fields("notenum"))
Else
Exit Sub
End If
End With
Dim i As Integer
s_stockorderDAO.stockorderdetail_show h_recordset, Trim(t_recordset.Fields("stockorderid"))
MSHFlexGrid1.clear
MSHFlexGrid1.Rows = 2
Call showform
j = 1
If Not h_recordset.EOF Then
With h_recordset
Do While Not .EOF
If j > MSHFlexGrid1.Rows - 1 Then
MSHFlexGrid1.AddItem ""
End If
'[>>自定义填充内容
Dim ret6 As Boolean
MSHFlexGrid1.TextMatrix(j, 0) = ""
ret6 = m_goodsDAO.name_goods(g_recordset, Trim(.Fields("goodsid")))
MSHFlexGrid1.TextMatrix(j, 1) = Trim(g_recordset.Fields("name"))
g_recordset.Close
MSHFlexGrid1.TextMatrix(j, 2) = Trim(.Fields("unit"))
MSHFlexGrid1.TextMatrix(j, 3) = CDbl(Trim(.Fields("num")) - Trim(.Fields("finishnum")))
MSHFlexGrid1.TextMatrix(j, 4) = "¥" & Trim(.Fields("price"))
MSHFlexGrid1.TextMatrix(j, 5) = "¥" & (CDbl(Trim(.Fields("num")) - Trim(.Fields("finishnum")))) * (Trim(.Fields("price")))
MSHFlexGrid1.TextMatrix(j, 6) = Trim(.Fields("finishnum"))
MSHFlexGrid1.TextMatrix(j, 7) = Trim(.Fields("memo"))
MSHFlexGrid1.TextMatrix(j, 8) = Trim(.Fields("goodsid"))
MSHFlexGrid1.TextMatrix(j, 9) = CDbl(Trim(.Fields("num")) - Trim(.Fields("finishnum")))
If CDbl(Trim(.Fields("num")) - Trim(.Fields("finishnum"))) = 0 Then
MSHFlexGrid1.TextMatrix(j, 0) = ""
MSHFlexGrid1.TextMatrix(j, 1) = ""
MSHFlexGrid1.TextMatrix(j, 2) = ""
MSHFlexGrid1.TextMatrix(j, 3) = ""
MSHFlexGrid1.TextMatrix(j, 4) = ""
MSHFlexGrid1.TextMatrix(j, 5) = ""
MSHFlexGrid1.TextMatrix(j, 6) = ""
MSHFlexGrid1.TextMatrix(j, 7) = ""
MSHFlexGrid1.TextMatrix(j, 8) = ""
MSHFlexGrid1.TextMatrix(j, 9) = ""
End If
'<<]
'动态集指针加1,同时将计数器加1(Fixed)
'hander:
.MoveNext
j = j + 1
Loop
End With
Else
Exit Sub
End If
t_recordset.Close
m_recordset.Close
'删除无数据的行
wcjl:
Dim o As Integer
For o = 0 To j - 1
If MSHFlexGrid1.TextMatrix(o, 8) = "" Then
MSHFlexGrid1.RemoveItem o
j = j - 1
GoTo wcjl
End If
Next o
End Sub
Private Sub PrintData(id As String)
' Dim Report As DataReportStockOrder
' Set Report = New DataReportStockOrder
' Report.PrintData 1
' Report.show 1
PrintCrystalReport "采购入库订单", "'" & id & "'"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -