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

📄 frmbookdengji.frm

📁 图书馆信息管理系统,具有文档和源代码.是毕业设计的好参考
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form FrmBookDengJi 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "新书入库"
   ClientHeight    =   4710
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   7425
   Icon            =   "FrmBookDengJi.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4710
   ScaleWidth      =   7425
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   6000
      Top             =   3840
      Visible         =   0   'False
      Width           =   1200
      _ExtentX        =   2117
      _ExtentY        =   582
      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       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.TextBox TxtMemo 
      Height          =   1455
      Left            =   960
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   4
      Top             =   3000
      Width           =   4695
   End
   Begin VB.TextBox TxtJinE 
      Height          =   375
      Left            =   960
      TabIndex        =   3
      Top             =   2520
      Width           =   4695
   End
   Begin VB.TextBox TxtZheKou 
      Height          =   375
      Left            =   960
      TabIndex        =   2
      Top             =   2040
      Width           =   4695
   End
   Begin VB.TextBox TxtDanJia 
      Height          =   375
      Left            =   960
      TabIndex        =   1
      Top             =   1560
      Width           =   4695
   End
   Begin VB.TextBox TxtShuLiang 
      Height          =   375
      Left            =   960
      TabIndex        =   0
      Top             =   1080
      Width           =   4695
   End
   Begin VB.TextBox TxtBook 
      Height          =   375
      Left            =   960
      Locked          =   -1  'True
      TabIndex        =   10
      Top             =   600
      Width           =   4695
   End
   Begin VB.TextBox TxtGYS 
      Height          =   375
      Left            =   960
      Locked          =   -1  'True
      TabIndex        =   8
      Top             =   120
      Width           =   4695
   End
   Begin VB.CommandButton CmdCancel 
      Caption         =   "取消(&C)"
      Height          =   375
      Left            =   6000
      TabIndex        =   6
      Top             =   960
      Width           =   1095
   End
   Begin VB.CommandButton CmdOK 
      Caption         =   "入帐(&D)"
      Height          =   375
      Left            =   6000
      TabIndex        =   5
      Top             =   240
      Width           =   1095
   End
   Begin VB.Label Label7 
      AutoSize        =   -1  'True
      Caption         =   "备注:"
      Height          =   180
      Left            =   300
      TabIndex        =   15
      Top             =   3120
      Width           =   540
   End
   Begin VB.Label Label6 
      AutoSize        =   -1  'True
      Caption         =   "金额:"
      Height          =   180
      Left            =   300
      TabIndex        =   14
      Top             =   2640
      Width           =   540
   End
   Begin VB.Label Label5 
      AutoSize        =   -1  'True
      Caption         =   "折扣:"
      Height          =   180
      Left            =   300
      TabIndex        =   13
      Top             =   2160
      Width           =   540
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      Caption         =   "单价:"
      Height          =   180
      Left            =   300
      TabIndex        =   12
      Top             =   1680
      Width           =   540
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "数量:"
      Height          =   180
      Left            =   300
      TabIndex        =   11
      Top             =   1200
      Width           =   540
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "品种:"
      Height          =   180
      Left            =   300
      TabIndex        =   9
      Top             =   720
      Width           =   540
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "供应商:"
      Height          =   180
      Left            =   120
      TabIndex        =   7
      Top             =   240
      Width           =   720
   End
End
Attribute VB_Name = "FrmBookDengJi"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdCancel_Click()
Unload Me
End Sub

Private Sub CmdOK_Click()
On Error GoTo errEnd
Dim QD As Integer

If TxtShuLiang.Text = "" Then
    MsgBox "请填写进书的数量.", vbOKOnly + vbExclamation, "新书入库"
    TxtShuLiang.SetFocus
    Exit Sub
End If
If TxtDanJia.Text = "" Then
    MsgBox "请填写进书的单价.", vbOKOnly + vbExclamation, "新书入库"
    TxtDanJia.SetFocus
    Exit Sub
End If
If TxtZheKou.Text = "" Then
    MsgBox "请填写进书的折扣,没有折扣请填 1 .", vbOKOnly + vbExclamation, "新书入库"
    TxtZheKou.SetFocus
    Exit Sub
End If
If CInt(TxtZheKou.Text) > 1 Or CInt(TxtZheKou.Text) <= 0 Then
    MsgBox "进书折扣填写错误,请在  0 与 1  之间选择.", vbOKOnly + vbExclamation, "新书入库"
    TxtZheKou.SetFocus
    Exit Sub
End If
If TxtJinE.Text = "" Then
    MsgBox "请填写进书实际支付的金额.", vbOKOnly + vbExclamation, "新书入库"
    TxtJinE.SetFocus
    Exit Sub
End If
If TxtMemo.Text = "" Then TxtMemo.Text = "无"

QD = MsgBox("确定入帐吗?", vbOKCancel + vbQuestion, "确认入帐")
If QD = vbCancel Then
    'Unload Me
    Exit Sub
End If
Screen.MousePointer = 11

BeginTrans

Adodc1.CommandType = adCmdTable
Adodc1.RecordSource = "进书记录"
Adodc1.Refresh

Adodc1.Recordset.AddNew
Adodc1.Recordset!供应商编号 = GongYingShangID
Adodc1.Recordset!图书编号 = TuShuBianHao
Adodc1.Recordset!数量 = CInt(TxtShuLiang.Text)
Adodc1.Recordset!单价 = TxtDanJia.Text
Adodc1.Recordset!折扣 = TxtZheKou.Text
Adodc1.Recordset!金额 = TxtJinE.Text
Adodc1.Recordset!进书日期 = Now()
Adodc1.Recordset!备注 = TxtMemo.Text
Adodc1.Recordset.Update

Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from [Book] where [图书编号]=""" & TuShuBianHao & """"
Adodc1.Refresh

If Adodc1.Recordset.RecordCount = 0 Then
    Rollback
    Screen.MousePointer = vbDefault
    MsgBox "图书资料丢失,请与程序员联系!", vbOKOnly + vbExclamation, "新书入库"
    Exit Sub
End If

Adodc1.Recordset.MoveFirst
Adodc1.Recordset!库存量 = Adodc1.Recordset!库存量 + CInt(TxtShuLiang.Text)
Adodc1.Recordset.Update

Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from [图书进价表] where [图书编号]=""" & TuShuBianHao & """"
Adodc1.Refresh

If Adodc1.Recordset.RecordCount > 0 Then
    Adodc1.Recordset!进价 = TxtDanJia.Text
    Adodc1.Recordset!进书日期 = Now()
    Adodc1.Recordset.Update
Else
    Adodc1.Recordset.AddNew
    Adodc1.Recordset!图书编号 = TuShuBianHao
    Adodc1.Recordset!进价 = TxtDanJia.Text
    Adodc1.Recordset!进书日期 = Now()
    Adodc1.Recordset.Update
End If

CommitTrans

Screen.MousePointer = vbDefault
MsgBox "本次入帐操作成功!", vbOKOnly + vbInformation, "操作成功"
Unload Me

Exit Sub
errEnd:
    Rollback
    Screen.MousePointer = vbDefault
    MsgBox "更新数据库失败!无法完成入库操作!", vbOKOnly + vbExclamation, "更新失败"
End Sub

Private Sub Form_Activate()
TxtGYS.Text = GongYingShang
TxtBook.Text = ShuMing
End Sub

Private Sub Form_Load()
Dim dbName As String
Dim connSTR As String

On Error GoTo errEnd

ChDir App.Path
dbName = App.Path
If Right(dbName, 1) <> "\" Then dbName = dbName + "\"
dbName = dbName + "DataBase\WFSSDataBase.mdb"

connSTR = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbName & ";Persist Security Info=False"
Adodc1.ConnectionString = connSTR

Exit Sub

errEnd:
    MsgBox "连接数据库失败!", vbOKOnly + vbExclamation, "打开数据库出错"
    End
End Sub

Private Sub TxtDanJia_KeyUp(KeyCode As Integer, Shift As Integer)
If Not (KeyCode >= 48 And KeyCode <= 57) Then
    If Not (KeyCode >= 96 And KeyCode <= 105) Then
        If KeyCode <> 13 And KeyCode <> 190 And KeyCode <> 110 And KeyCode <> 8 And KeyCode <> 46 Then
            MsgBox "图书单价填写错误!", vbOKOnly + vbExclamation, "填写错误"
            TxtDanJia.Text = ""
            TxtDanJia.SetFocus
        End If
    End If
End If
End Sub

Private Sub TxtJinE_GotFocus()
If TxtZheKou.Text <> "" Then
    If TxtZheKou.Text <= 0 Or TxtZheKou.Text > 1 Then
        MsgBox "图书折扣填写错误,请在 0 与 1 之间选择!", vbOKOnly + vbExclamation, "填写错误"
        TxtZheKou.SetFocus
        Exit Sub
    End If
End If
If TxtShuLiang.Text <> "" And TxtDanJia.Text <> "" And TxtZheKou.Text <> "" Then
    TxtJinE.Text = TxtShuLiang.Text * TxtDanJia.Text * TxtZheKou.Text
End If
End Sub

Private Sub TxtJinE_KeyUp(KeyCode As Integer, Shift As Integer)
If Not (KeyCode >= 48 And KeyCode <= 57) Then
    If Not (KeyCode >= 96 And KeyCode <= 105) Then
        If KeyCode <> 13 And KeyCode <> 190 And KeyCode <> 110 And KeyCode <> 8 And KeyCode <> 46 Then
            MsgBox "进货金额填写错误!", vbOKOnly + vbExclamation, "填写错误"
            TxtJinE.Text = ""
            TxtJinE.SetFocus
        End If
    End If
End If
End Sub

Private Sub TxtShuLiang_KeyUp(KeyCode As Integer, Shift As Integer)
If Not (KeyCode >= 48 And KeyCode <= 57) Then
    If Not (KeyCode >= 96 And KeyCode <= 105) Then
        If KeyCode <> 13 And KeyCode <> 8 And KeyCode <> 46 Then
            MsgBox "图书数量填写错误!", vbOKOnly + vbExclamation, "填写错误"
            TxtShuLiang.Text = ""
            TxtShuLiang.SetFocus
        End If
    End If
End If
End Sub

Private Sub TxtZheKou_KeyUp(KeyCode As Integer, Shift As Integer)
If Not (KeyCode >= 48 And KeyCode <= 57) Then
    If Not (KeyCode >= 96 And KeyCode <= 105) Then
        If KeyCode <> 13 And KeyCode <> 190 And KeyCode <> 110 And KeyCode <> 8 And KeyCode <> 46 Then
            MsgBox "图书折扣填写错误!", vbOKOnly + vbExclamation, "填写错误"
            TxtZheKou.Text = ""
            TxtZheKou.SetFocus
        End If
    End If
End If
End Sub

⌨️ 快捷键说明

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