⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 goodsmodifycopy.frm

📁 即时通讯
💻 FRM
📖 第 1 页 / 共 2 页
字号:
'            Text1.text = Trim(.Fields("name"))                              '商品名称
'            bigunit.text = Trim(.Fields("bigunit"))                         '大单位
'            presetprice.text = Trim(.Fields("presetprice"))                 '预设进价
'            goodsname1.text = Trim(.Fields("goodsid"))                      '商品编号
'    Else
'        Exit Sub
'    End If
'        Dim retg As Boolean
'            retg = m_stockstoreDAO.judeg_stockstoredetail(m_recordset, Trim(StockStorec.suppliername.text), Trim(s_recordset.Fields("goodsid")))
'    If retg Then
'        presetprice.text = Trim(m_recordset.Fields("单价"))
'    End If
'    End With
'            For j = 1 To StockStorec.MSHFlexGrid1.Rows - 1
'                    If Trim(StockStorec.MSHFlexGrid1.TextMatrix(j, 8)) = Trim(s_recordset.Fields("goodsid")) Then
'                        MainForm.g_msgText = "对不起该商品已经存在,请选择添加其他的商品!!"
'                        Call HMsgBox(MainForm.g_msgText, 0, 1)
'                        Text1.text = ""
'                        bigunit.text = ""
'                        presetprice.text = 0
'                        goodsname1.text = ""
'                        'Exit Sub
'                    End If
'            Next j
'    m_recordset.Close
'
'        Text5.text = ""
'        Text6.text = ""
'        Text7.text = ""
'        Text3.text = "0"
'            'm_recordset.Close
'            s_recordset.Close
'End Sub

Private Sub presetprice_Change()
  If good_type1 = 1 Then
    If Len(Trim(Text3.text)) <> 0 Then
        Text5.text = CDbl(Trim(Text3.text) * CDbl(Trim(presetprice.text)))
    End If
  End If
  If good_type1 = 0 Then
    If Len(Trim(Text3.text)) <> 0 Then
        Text5.text = CDbl(Trim(Text3.text) * CDbl(Trim(presetprice.text)))
    End If
  End If
End Sub

Private Sub save_cmd_Click()
    If good_type1 = 1 Then                                                          ' 表示商品记录保存成功
        good_name2 = goodsname1.text
    If Not Check Then                                                               ' 判断输入文本的内容
         Exit Sub
    End If
    If StockStorec.currentrow1 > StockStorec.MSHFlexGrid1.Rows - 1 Then
                StockStorec.MSHFlexGrid1.AddItem ""
    End If
    'stockstore.currentrow1 = 1
        With StockStorec
            .MSHFlexGrid1.TextMatrix(.currentrow1, 0) = ""
            .MSHFlexGrid1.TextMatrix(.currentrow1, 1) = Trim(Text1.text)                       ' 商品编号
            .MSHFlexGrid1.TextMatrix(.currentrow1, 2) = Trim(bigunit.text)                          ' 单位
            .MSHFlexGrid1.TextMatrix(.currentrow1, 3) = Trim(Text3.text)                            ' 数量
            .MSHFlexGrid1.TextMatrix(.currentrow1, 4) = CDbl(Trim(presetprice.text))                ' 单价
            .MSHFlexGrid1.TextMatrix(.currentrow1, 5) = CDbl(Trim(Text5.text))                      ' 金额
            .MSHFlexGrid1.TextMatrix(.currentrow1, 6) = Trim(Text6.text)                            ' 完成数量
            .MSHFlexGrid1.TextMatrix(.currentrow1, 7) = Trim(Text7.text)
            .MSHFlexGrid1.TextMatrix(.currentrow1, 8) = Trim(goodsname1.text)                            ' 商品备注
            .currentrow1 = .currentrow1 + 1
        End With
        Unload Me
    End If
    If good_type1 = 0 Then                                                              ' 修改商品
        If Not Check Then                                                               ' 判断输入文本的内容
            Exit Sub
        End If
        With StockStorec
            .MSHFlexGrid1.TextMatrix(.c_goodsname, 1) = Trim(Text1.text)
            .MSHFlexGrid1.TextMatrix(.c_goodsname, 2) = Trim(bigunit.text)                          ' 单位
            .MSHFlexGrid1.TextMatrix(.c_goodsname, 3) = Trim(Text3.text)                            ' 数量
            .MSHFlexGrid1.TextMatrix(.c_goodsname, 4) = CDbl(Trim(presetprice.text))                ' 单价
            .MSHFlexGrid1.TextMatrix(.c_goodsname, 5) = CDbl(Trim(Text5.text))                      ' 金额
            .MSHFlexGrid1.TextMatrix(.c_goodsname, 6) = Trim(Text6.text)                            ' 完成数量
            .MSHFlexGrid1.TextMatrix(.c_goodsname, 7) = Trim(Text7.text)                            ' 商品备注
            .MSHFlexGrid1.TextMatrix(.c_goodsname, 8) = Trim(goodsname1.text)
        End With
        Unload Me
    End If
End Sub

Private Sub xgjl()
        With StockStorec
            Text1.text = Trim(.MSHFlexGrid1.TextMatrix(.c_goodsname, 1))
            Text1.Tag = Trim(.MSHFlexGrid1.TextMatrix(.c_goodsname, 1))
            bigunit.text = Trim(.MSHFlexGrid1.TextMatrix(.c_goodsname, 2))
            bigunit.Tag = Trim(.MSHFlexGrid1.TextMatrix(.c_goodsname, 2))
            presetprice.text = CDbl(Trim(.MSHFlexGrid1.TextMatrix(.c_goodsname, 4)))
            presetprice.Tag = CDbl(Trim(.MSHFlexGrid1.TextMatrix(.c_goodsname, 4)))
            Text5.text = CDbl(Trim(.MSHFlexGrid1.TextMatrix(.c_goodsname, 5)))
            Text5.Tag = CDbl(Trim(.MSHFlexGrid1.TextMatrix(.c_goodsname, 5)))
            Text6.text = Trim(.MSHFlexGrid1.TextMatrix(.c_goodsname, 6))
            Text6.Tag = Trim(.MSHFlexGrid1.TextMatrix(.c_goodsname, 6))
            Text7.text = Trim(.MSHFlexGrid1.TextMatrix(.c_goodsname, 7))
            Text7.Tag = Trim(.MSHFlexGrid1.TextMatrix(.c_goodsname, 7))
            Text3.text = Trim(.MSHFlexGrid1.TextMatrix(.c_goodsname, 3))
            Text3.Tag = Trim(.MSHFlexGrid1.TextMatrix(.c_goodsname, 3))
            goodsname1.text = Trim(.MSHFlexGrid1.TextMatrix(.c_goodsname, 8))
            goodsname1.Tag = Trim(.MSHFlexGrid1.TextMatrix(.c_goodsname, 8))
    End With
End Sub

Private Sub Text3_Change()
    If Not IsNumeric(Text3.text) Then
        MainForm.g_msgText = "数量,你输入的数字格式有错误!"
        Call HMsgBox(MainForm.g_msgText, 0, 1)
        Text3.text = ""
        Text3.SetFocus
        Exit Sub
    End If
    If good_type1 = 1 Then
    If Len(Trim(Text3.text)) <> 0 Then
        Text5.text = CDbl(Trim(Text3.text) * CDbl(Trim(presetprice.text)))
    End If
  End If
      If good_type1 = 0 Then
    If Len(Trim(Text3.text)) <> 0 Then
        Text5.text = CDbl(Trim(Text3.text) * CDbl(Trim(presetprice.text)))
    End If
  End If
End Sub

Private Sub xz_cmd_Click()
        If good_type1 = 1 Then                        ' 表示商品记录保存成功
           If Not Check Then                                                               ' 判断输入文本的内容
                Exit Sub
           End If
            If StockStorec.currentrow1 > StockStorec.MSHFlexGrid1.Rows - 1 Then
                StockStorec.MSHFlexGrid1.AddItem ""
            End If
            With StockStorec
                .MSHFlexGrid1.TextMatrix(.currentrow1, 0) = ""
                .MSHFlexGrid1.TextMatrix(.currentrow1, 1) = Trim(Text1.text)
                .MSHFlexGrid1.TextMatrix(.currentrow1, 2) = Trim(bigunit.text)
                .MSHFlexGrid1.TextMatrix(.currentrow1, 3) = Trim(Text3.text)
                .MSHFlexGrid1.TextMatrix(.currentrow1, 4) = CDbl(Trim(presetprice.text))
                .MSHFlexGrid1.TextMatrix(.currentrow1, 5) = CDbl(Trim(Text5.text))
                .MSHFlexGrid1.TextMatrix(.currentrow1, 6) = Trim(Text6.text)
                .MSHFlexGrid1.TextMatrix(.currentrow1, 7) = Trim(Text7.text)
                .MSHFlexGrid1.TextMatrix(.currentrow1, 8) = Trim(goodsname1.text)
                .currentrow1 = .currentrow1 + 1
        End With
            Call clear
    End If
End Sub

Private Sub clear()                     ' 初始化窗体
    Text1.text = ""
    bigunit.text = ""
    Text3.text = 0
    presetprice.text = 0
    Text5.text = ""
    Text6.text = ""
    Text7.text = ""
    goodsname1.text = ""
    Text1.Tag = ""
End Sub
'*******************************************************
'*    功 能 描 述 :判断输入数据的合法性
'*    备        注:
'*******************************************************
Private Function Check() As Boolean
    Check = True
    If Len(Trim(goodsname1.text)) = 0 Then
        MainForm.g_msgText = "商品名称不能为空!"
        Call HMsgBox(MainForm.g_msgText, 0, 1)
        'goodsname1.SetFocus
        Check = False
        Exit Function
    End If
    If Len(Trim(bigunit.text)) = 0 Then
        MainForm.g_msgText = "单位不能为空!"
        Call HMsgBox(MainForm.g_msgText, 0, 1)
        bigunit.SetFocus
        Check = False
        Exit Function
    End If
    If Len(Trim(presetprice.text)) = 0 Then
        MainForm.g_msgText = "单价不能为空!"
        Call HMsgBox(MainForm.g_msgText, 0, 1)
        presetprice.SetFocus
        Check = False
        Exit Function
    End If
'    If Len(Trim(Text6.text)) = 0 Then
'        MainForm.g_msgText = "完成数量不能为空!"
'        Call HMsgBox(MainForm.g_msgText, 0, 1)
'        Text6.SetFocus
'        Check = False
'        Exit Function
'    End If
    If Len(Trim(Text5.text)) = 0 Then
        MainForm.g_msgText = "金额不能为空!"
        Call HMsgBox(MainForm.g_msgText, 0, 1)
        Text5.SetFocus
        Check = False
        Exit Function
    End If
    If Len(Trim(Text3.text)) = 0 Then
        MainForm.g_msgText = "数量不能为空!"
        Call HMsgBox(MainForm.g_msgText, 0, 1)
        Text3.SetFocus
        Check = False
        Exit Function
    End If
    If Trim(Text3.text) = 0 Then                    ' 判断数量是否为空
        MainForm.g_msgText = "数量不能为0!"
        Call HMsgBox(MainForm.g_msgText, 0, 1)
        Text3.SetFocus
        Check = False
        Exit Function
    End If
'    If Not IsNumeric(Text6.text) Then
'        MainForm.g_msgText = "完成数量,你输入的数字格式有错误!"
'        Call HMsgBox(MainForm.g_msgText, 0, 1)
'        Text6.text = ""
'        Text6.SetFocus
'        Exit Function
'    End If
    If CDbl(Trim(Text3.Tag)) < CDbl(Trim(Text3.text)) Then
        MainForm.g_msgText = "数量不能比总数量减去完成数量还大"
        Call HMsgBox(MainForm.g_msgText, 0, 1)
        Text3.SetFocus
        Check = False
        Exit Function
    End If
End Function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -