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

📄 frmstoreinedit.frm

📁 erp中的库存管理子系统,Vb代码编写
💻 FRM
📖 第 1 页 / 共 3 页
字号:
            BeginProperty Column07 
            EndProperty
            BeginProperty Column08 
            EndProperty
            BeginProperty Column09 
            EndProperty
            BeginProperty Column10 
            EndProperty
            BeginProperty Column11 
            EndProperty
            BeginProperty Column12 
            EndProperty
            BeginProperty Column13 
            EndProperty
            BeginProperty Column14 
            EndProperty
            BeginProperty Column15 
            EndProperty
            BeginProperty Column16 
            EndProperty
            BeginProperty Column17 
            EndProperty
            BeginProperty Column18 
            EndProperty
         EndProperty
      End
      Begin VB.Label LblAlarmDays 
         Height          =   255
         Left            =   9960
         TabIndex        =   34
         Top             =   840
         Width           =   1455
      End
      Begin VB.Label LblValid 
         Height          =   255
         Left            =   6840
         TabIndex        =   33
         Top             =   840
         Width           =   1455
      End
      Begin VB.Label LblProHigh 
         Height          =   255
         Left            =   3960
         TabIndex        =   32
         Top             =   840
         Width           =   1455
      End
      Begin VB.Label LblProLow 
         Height          =   255
         Left            =   1320
         TabIndex        =   31
         Top             =   840
         Width           =   1455
      End
      Begin VB.Label Label18 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "数量下限"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Left            =   120
         TabIndex        =   30
         Top             =   840
         Width           =   1020
      End
      Begin VB.Label Label12 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "数量上限"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Left            =   2880
         TabIndex        =   29
         Top             =   840
         Width           =   1020
      End
      Begin VB.Label Label11 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "有效期(天)"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Left            =   5520
         TabIndex        =   28
         Top             =   840
         Width           =   1290
      End
      Begin VB.Label Label10 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "警告期(天)"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Left            =   8640
         TabIndex        =   27
         Top             =   840
         Width           =   1290
      End
      Begin VB.Label Label2 
         Caption         =   "选择的产品是:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   3720
         TabIndex        =   2
         Top             =   360
         Width           =   1695
      End
   End
   Begin VB.Image Image4 
      Height          =   300
      Left            =   6720
      Picture         =   "FrmStoreinEdit.frx":0CD2
      Top             =   6840
      Width           =   300
   End
   Begin VB.Label LblCancel 
      BackStyle       =   0  'Transparent
      Caption         =   "取 消"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   7320
      MouseIcon       =   "FrmStoreinEdit.frx":10EE
      MousePointer    =   99  'Custom
      TabIndex        =   20
      Top             =   6840
      Width           =   855
   End
   Begin VB.Image Image3 
      Height          =   300
      Left            =   4320
      Picture         =   "FrmStoreinEdit.frx":13F8
      Top             =   6840
      Width           =   300
   End
   Begin VB.Label LblOK 
      BackStyle       =   0  'Transparent
      Caption         =   "确 定"
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   4920
      MouseIcon       =   "FrmStoreinEdit.frx":1814
      MousePointer    =   99  'Custom
      TabIndex        =   19
      Top             =   6840
      Width           =   735
   End
End
Attribute VB_Name = "FrmStoreinEdit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public OriStoreInType As String
Public OK As Integer









Private Sub CmbLocation_Click()
Adodc2.ConnectionString = "driver={SQL Server};server=" + Trim(Server) + ";uid=" + Trim(User) + ";pwd=" + Trim(Password) + ";database=ERP"
Adodc2.RecordSource = "select * from StoreRoom where StoreRoom='" + Trim(CmbStoreRoom.Text) + "' and Location='" + Trim(CmbLocation.Text) + "'"
Adodc2.Refresh
Set LblDescription.DataSource = Adodc2
If Adodc2.Recordset.RecordCount <> 0 Then
LblDescription.Caption = Adodc2.Recordset.Fields(3)
End If
End Sub

Private Sub CmbStoreRoom_Click()
If CmbLocation.Text <> "请选择库号" Then
CmbLocation.Enabled = True
CmbLocation.Clear
'装入CmbLocation的信息
CmbLocation.AddItem "请选择位号"
MyStoreIn.Load_Location (CmbStoreRoom.Text)
  i = 0
  Do While Arr_Item(i) <> ""
    CmbLocation.AddItem Arr_Item(i)
  i = i + 1
  Loop
  CmbLocation.ListIndex = 0
End If

End Sub

Private Sub DataGrid1_Click()
If Adodc1.Recordset.RecordCount <> 0 Then
TxItem.Text = Adodc1.Recordset.Fields(1)
LblProLow.Caption = Adodc1.Recordset.Fields("ProLow")
LblProHigh = Adodc1.Recordset.Fields("ProHigh")
LblValid = Adodc1.Recordset.Fields("Valid")
LblAlarmDays = Adodc1.Recordset.Fields("AlarmDays")
Frame3.Enabled = True

LblOK.Enabled = True
End If
End Sub

Private Sub Form_Load()
Adodc1.ConnectionString = "driver={SQL Server};server=" + Trim(Server) + ";uid=" + Trim(User) + ";pwd=" + Trim(Password) + ";database=ERP"
If OriStoreInType = "采购入库" Or OriStoreInType = "退料入库" Then
Adodc1.RecordSource = "select * from Item where Item.MB<>'M制造'"
Else
Adodc1.RecordSource = "select * from Item where Item.MB<>'B购买' and Item.MB<>'S外发' "
End If
Set DataGrid1.DataSource = Adodc1


'装入CmbStoreRoom的信息
CmbStoreRoom.AddItem "请选择库号"
MyStoreIn.Load_StoreRoom
  i = 0
  Do While Arr_Item(i) <> ""
    CmbStoreRoom.AddItem Arr_Item(i)
  i = i + 1
  Loop
  CmbStoreRoom.ListIndex = 0
CmbLocation.Enabled = False

OK = 1
End Sub



Private Sub LblCancel_Click()
Unload Me
End Sub
Private Function Check() As Boolean
If Trim(TxtStoreInID) = "" Then
    MsgBox "请输入入库ID"
    TxtStoreInID.SetFocus
    Check = False
    Exit Function
  End If
  If Trim(TxtQty) = "" Then
    MsgBox "请输入产品数量"
    TxtQty.SetFocus
    Check = False
    Exit Function
  End If
  If Trim(LblDescription.Caption) = "" Then
    MsgBox "请选择库位"
    CmbStoreRoom.SetFocus
    Check = False
    Exit Function
  End If
  If Trim(TxtFillinPerson.Text) = "" Then
    MsgBox "请输入经办人姓名"
    TxtFillinPerson.SetFocus
    Check = False
    Exit Function
  End If
   Check = True
End Function
Private Sub LblOK_Click()
 '判断要编辑信息是否完整
   If Check = False Then
    Exit Sub
   End If
   
   With MyStoreIn
.StoreInID = TxtStoreInID.Text
.StoreInType = LblStoreInType.Caption
.Item = TxItem.Text
.UnitPrice = TxtUnitPrice.Text
.Currency1 = TxtCurrency1.Text
.Qty = TxtQty.Text
.StoreRoom = CmbStoreRoom.Text
.Location = CmbLocation.Text
.FillinPerson = TxtFillinPerson.Text
.FillinTime = LblFillinTime.Caption
   
    
    If .In_DB(TxtStoreInID.Text) = True Then
                   MsgBox "入库ID重复,请重新设置"
                   TxtStoreInID.SetFocus
                   TxtStoreInID.SelStart = 0
                   TxtStoreInID.SelLength = Len(TxtStoreInID)
                   Exit Sub
    Else
                   If OK = 1 Then
                    MsgBox "确认后入库单将不能修改,请再检查一遍"
                    OK = 2
                    Exit Sub
                   Else
                    .Insert   '添加
                 If .In_DBStore(TxItem.Text, CmbStoreRoom.Text, CmbLocation.Text) = True Then
                    '如果在库存中已经有此产品,则修改产品量即可
                    .UpdateStore TxItem.Text, TxtQty.Text, CmbStoreRoom.Text, CmbLocation.Text
                 Else
                   .InStore  '添加进库存表
                 End If
                    MsgBox "入库成功"
                   End If
    End If

End With
Unload Me

End Sub










⌨️ 快捷键说明

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