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

📄 main_rcyw_kccx.frm

📁 是基于C#语言的一个图书综合管理系统的开发案例,相当实用
💻 FRM
📖 第 1 页 / 共 2 页
字号:
            ColumnWidth     =   794.835
         EndProperty
      EndProperty
   End
   Begin VB.Frame Frame1 
      Height          =   630
      Left            =   60
      TabIndex        =   8
      Top             =   -15
      Width           =   5190
      Begin VB.ComboBox Combo2 
         BackColor       =   &H00FFFFFF&
         Height          =   300
         ItemData        =   "main_rcyw_kccx.frx":0CDF
         Left            =   1605
         List            =   "main_rcyw_kccx.frx":0CE1
         TabIndex        =   11
         Top             =   210
         Width           =   780
      End
      Begin VB.ComboBox Combo1 
         BackColor       =   &H00FFFFFF&
         Height          =   300
         Left            =   90
         TabIndex        =   10
         Top             =   210
         Width           =   1515
      End
      Begin VB.TextBox Text1 
         BackColor       =   &H00FFFFFF&
         Height          =   300
         Left            =   2385
         TabIndex        =   9
         Top             =   210
         Width           =   2715
      End
   End
   Begin MSAdodcLib.Adodc Adodc3 
      Height          =   330
      Left            =   0
      Top             =   0
      Visible         =   0   'False
      Width           =   1365
      _ExtentX        =   2408
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   1
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   3
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "DSN=NBooks"
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   "NBooks"
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "select * from xsb"
      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 MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   4350
      Top             =   2685
      Visible         =   0   'False
      Width           =   1785
      _ExtentX        =   3149
      _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 MSAdodcLib.Adodc Adodc2 
      Height          =   345
      Left            =   6390
      Top             =   2775
      Visible         =   0   'False
      Width           =   2055
      _ExtentX        =   3625
      _ExtentY        =   609
      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         =   "Adodc2"
      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.Label je 
      BackStyle       =   0  'Transparent
      ForeColor       =   &H000000FF&
      Height          =   180
      Left            =   4920
      TabIndex        =   5
      Top             =   3705
      Width           =   1755
   End
   Begin VB.Label sl 
      BackStyle       =   0  'Transparent
      ForeColor       =   &H00FF0000&
      Height          =   180
      Left            =   2655
      TabIndex        =   4
      Top             =   3705
      Width           =   1080
   End
   Begin VB.Label pz 
      BackStyle       =   0  'Transparent
      ForeColor       =   &H0000FF00&
      Height          =   180
      Left            =   945
      TabIndex        =   3
      Top             =   3705
      Width           =   780
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "库存品种:         库存数量:               库存金额:"
      ForeColor       =   &H00800000&
      Height          =   195
      Left            =   75
      TabIndex        =   2
      Top             =   3705
      Width           =   6765
   End
End
Attribute VB_Name = "main_rcyw_kccx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Myval As String
Private Sub Form_Load()
'自动识别路径
Adodc1.ConnectionString = "DSN=NBooks"
Adodc1.RecordSource = "select * from kcb"
Adodc1.Refresh
Adodc2.ConnectionString = "DSN=NBooks"
Adodc2.RecordSource = "select * from kcb"
Adodc2.Refresh

 Combo1.AddItem ("书号")
 Combo1.AddItem ("条形码")
 Combo1.AddItem ("书名")
 Combo1.AddItem ("作者")
 Combo1.AddItem ("出版社")
 Combo1.AddItem ("图书类别")
 Combo1.AddItem ("存放位置")
 Combo1.ListIndex = 0
 Combo2.AddItem ("like")
 Combo2.AddItem ("=")
 Combo2.ListIndex = 0
Select Case Combo2.text
  Case Is = "like"
   Adodc1.RecordSource = "select * from kcb where kcb." & Combo1.text & " " & " like +'" + Text1.text + "'+ '%'order by 书号"
   Adodc1.Refresh
   Adodc2.RecordSource = "select count(*)as 品种,sum(现存数量)as 合计数量,sum(金额)as 合计金额 from kcb  where kcb." & Combo1.text & " " & "like +'" + Text1.text + "'+ '%'"
   Adodc2.Refresh
  Case Is = "="
   Adodc1.RecordSource = "select * from kcb where kcb." & Combo1.text & " " & "= '" + Text1.text + "'order by 书号"
   Adodc1.Refresh
   Adodc2.RecordSource = "select count(*)as 品种,sum(现存数量)as 合计数量,sum(金额)as 合计金额 from kcb  where kcb." & Combo1.text & " " & "='" + Text1.text + "'"
   Adodc2.Refresh
 End Select
 With Adodc2.Recordset
  If .Fields(0) <> "" Then pz.Caption = .Fields(0) Else pz.Caption = "0"
  If .Fields(1) <> "" Then sl.Caption = .Fields(1) Else sl.Caption = "0"
  If .Fields(2) <> "" Then je.Caption = Format(.Fields(2), "0.00") Else je.Caption = "0.00"
 End With
 End Sub
Private Sub Form_Unload(Cancel As Integer)
 frm_main.Enabled = True
End Sub

Private Sub CmdFind_Click()  '查询
If Text1.text = "" Then
  MsgBox "请输入查询条件!", , "图书综合管理系统"
Else
 Select Case Combo2.text
  Case Is = "like"
   Adodc1.RecordSource = "select * from kcb where kcb." & Combo1.text & " " & " like +'%'+'" + Text1.text + "'+ '%'order by 书号"
   Adodc1.Refresh
   Adodc2.RecordSource = "select count(*)as 品种,sum(现存数量)as 合计数量,sum(金额)as 合计金额 from kcb  where kcb." & Combo1.text & " " & "like +'%'+'" + Text1.text + "'+ '%'"
   Adodc2.Refresh
  Case Is = "="
   Adodc1.RecordSource = "select * from kcb where kcb." & Combo1.text & " " & "= '" + Text1.text + "'order by 书号"
   Adodc1.Refresh
   Adodc2.RecordSource = "select count(*)as 品种,sum(现存数量)as 合计数量,sum(金额)as 合计金额 from kcb  where kcb." & Combo1.text & " " & "='" + Text1.text + "'"
   Adodc2.Refresh
 End Select
 With Adodc2.Recordset
  If .Fields(0) <> "" Then pz.Caption = .Fields(0) Else pz.Caption = "0"
  If .Fields(1) <> "" Then sl.Caption = .Fields(1) Else sl.Caption = "0"
  If .Fields(2) <> "" Then je.Caption = Format(.Fields(2), "0.00") Else je.Caption = "0.00"
 End With
End If
End Sub
Private Sub CmdPrint_Click()  '打印
 Select Case Combo2.text
  Case Is = "like"
    DataE1.rsCommand3.Open "select * from kcb where kcb." & Combo1.text & " " & " like +'%'+'" + Text1.text + "'+ '%'order by 书号"
  Case Is = "="
    DataE1.rsCommand3.Open "select * from kcb where kcb." & Combo1.text & " " & "= '" + Text1.text + "'order by 书号"
 End Select
 DR1_kccx.Show
End Sub
Private Sub CmdDelete_Click()  '删除
 Myval = MsgBox("是否真的删除该数据?", vbYesNo, "图书综合管理系统")
 'MsgBox 函数在对话框中显示消息,等待用户单击按钮,并返回一个 Integer 告诉用户单击哪一个按钮。
 If Myval = vbYes Then
  On Error Resume Next
  Adodc1.Recordset.Delete
  Adodc1.Recordset.Update
 End If
End Sub
Private Sub CmdEnd_Click()  '退出
 Unload Me
 frm_main.Enabled = True
End Sub

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then CmdFind.SetFocus   '按回车键CmdFind获得焦点
End Sub

⌨️ 快捷键说明

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