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

📄 j_kusz.frm

📁 一个企业进销存的系统 用ASP.NET作成 大家一起学习
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Height          =   375
         Left            =   3600
         TabIndex        =   11
         Top             =   1200
         Width           =   1095
      End
      Begin VB.Label Label5 
         BackColor       =   &H80000013&
         Caption         =   "联系电话:"
         Height          =   375
         Left            =   120
         TabIndex        =   9
         Top             =   1320
         Width           =   1095
      End
      Begin VB.Label Label4 
         BackColor       =   &H80000013&
         Caption         =   "邮政编码:"
         Height          =   375
         Left            =   3600
         TabIndex        =   7
         Top             =   720
         Width           =   1215
      End
      Begin VB.Label Label3 
         BackColor       =   &H80000013&
         Caption         =   "地 址:"
         Height          =   375
         Left            =   480
         TabIndex        =   5
         Top             =   720
         Width           =   735
      End
      Begin VB.Label Label2 
         BackColor       =   &H80000013&
         Caption         =   "会员名称:"
         Height          =   255
         Left            =   3600
         TabIndex        =   3
         Top             =   240
         Width           =   1095
      End
      Begin VB.Label Label1 
         BackColor       =   &H80000013&
         Caption         =   "会员编号:"
         Height          =   255
         Left            =   240
         TabIndex        =   1
         Top             =   240
         Width           =   975
      End
   End
End
Attribute VB_Name = "J_kusz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public txtSQL As String
Dim intCount As Integer
Dim mrc As ADODB.Recordset
Dim MsgText As String

Private Sub Command1_Click()
Frame1.Enabled = True
End Sub

Private Sub Command2_Click()
If Frame1.Enabled = False Then
MsgBox "请单击添加用户按钮", vbOKOnly
Exit Sub
End If
If Trim(Text1.Text) = "" Then
MsgBox "会员编号不能为空", vbOKOnly + vbExclamation, "提示"
Text1.SetFocus
Exit Sub
Else
txtSQL = "select * from g_khxinxi"
Set mrc = ExecuteSQL(txtSQL, MsgText)
While (mrc.EOF = False)
If Trim(mrc.Fields(0)) = Trim(Text1.Text) Then
MsgBox "会员类别编号重复", vbOKOnly
Text1.Text = ""
Text1.SetFocus
Exit Sub
Else
mrc.MoveNext
End If
Wend
mrc.AddNew
mrc.Fields(0) = Trim(Text1.Text)
mrc.Fields(1) = Trim(Text2.Text)
mrc.Fields(2) = Trim(Text3.Text)
mrc.Fields(3) = Trim(Text4.Text)
mrc.Fields(4) = Trim(Text5.Text)
mrc.Fields(5) = Trim(Text6.Text)
mrc.Fields(6) = Trim(Text7.Text)
mrc.Fields(7) = Trim(Text8.Text)
mrc.Fields(8) = Trim(Text9.Text)
mrc.Fields(9) = Trim(Text10.Text)
mrc.Fields(10) = Trim(Text11.Text)
mrc.Fields(11) = Trim(Text12.Text)
mrc.Fields(12) = Trim(Text13.Text)
mrc.Update
mrc.Close
MsgBox "客户信息添加成功", vbOKOnly
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
xlist.Refresh
ShowData
Frame1.Enabled = False
End If
End Sub

Private Sub Command3_Click()
Dim strr As String
If xlist.Row < 1 Then
MsgBox "数据库为空,没有删除的数据", vbOKOnly
Exit Sub
End If

strr = MsgBox("真的要删除会员编号为 " & Trim(xlist.TextMatrix(xlist.Row, 1)) & "的会员吗?", vbOKCancel + vbExclamation, "提示")
If strr = vbOK Then
intCount = xlist.Row
txtSQL = "delete  from g_khxinxi where dm='" & Trim(xlist.TextMatrix(intCount, 1)) & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
End If
ShowData
End Sub

Public Sub Command4_Click()
Dim strr As String
strr = MsgBox("真的要修改会员编号为 " & Trim(xlist.TextMatrix(xlist.Row, 1)) & "的纪录吗?", vbOKCancel + vbExclamation, "提示")
If strr = vbOK Then
intCount = xlist.Row
txtSQL = "select * from g_khxinxi where dm='" & Trim(xlist.TextMatrix(intCount, 1)) & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
Text1.Text = Trim(xlist.TextMatrix(intCount, 1))
Text2.Text = Trim(xlist.TextMatrix(intCount, 2))
Text3.Text = Trim(xlist.TextMatrix(intCount, 3))
Text4.Text = Trim(xlist.TextMatrix(intCount, 4))
Text5.Text = Trim(xlist.TextMatrix(intCount, 5))
Text6.Text = Trim(xlist.TextMatrix(intCount, 6))
Text7.Text = Trim(xlist.TextMatrix(intCount, 7))
Text8.Text = Trim(xlist.TextMatrix(intCount, 8))
Text9.Text = Trim(xlist.TextMatrix(intCount, 9))
Text10.Text = Trim(xlist.TextMatrix(intCount, 10))
Text11.Text = Trim(xlist.TextMatrix(intCount, 11))
Text12.Text = Trim(xlist.TextMatrix(intCount, 12))
Text13.Text = Trim(xlist.TextMatrix(intCount, 13))
Text14.Text = Trim(xlist.TextMatrix(intCount, 14))
Frame1.Enabled = True
Text1.Enabled = False
Command5.Enabled = True
End If
End Sub

Private Sub Command5_Click()
 mrc.Fields(0) = Text1.Text
 mrc.Fields(1) = Text2.Text
 mrc.Fields(2) = Text3.Text
 mrc.Fields(3) = Text4.Text
 mrc.Fields(4) = Text5.Text
 mrc.Fields(5) = Text6.Text
 mrc.Fields(6) = Text7.Text
  mrc.Fields(7) = Text8.Text
 mrc.Fields(8) = Text9.Text
 mrc.Fields(9) = Text10.Text
 mrc.Fields(10) = Text11.Text
 mrc.Fields(11) = Text12.Text
 mrc.Fields(12) = Text13.Text
 mrc.Fields(13) = Text14.Text
 mrc.Update
 xlist.Refresh
 mrc.Close
 MsgBox "修改成功", vbOKOnly
 Command5.Enabled = False
 Unload Me
 
End Sub

Private Sub Form_Load()
Command5.Enabled = False
Frame1.Enabled = False
ShowTitle
ShowData
End Sub
Private Sub ShowTitle()
Dim i As Integer
With xlist
.Cols = 15
.TextMatrix(0, 1) = "会员编号"
.TextMatrix(0, 2) = "会员名称"
.TextMatrix(0, 3) = "地址"
.TextMatrix(0, 4) = "邮政编码"
.TextMatrix(0, 5) = "联系电话"
.TextMatrix(0, 6) = "公司主页"
.TextMatrix(0, 7) = "联系人"
.TextMatrix(0, 8) = "联系人电子邮件"
.TextMatrix(0, 9) = "税号"
.TextMatrix(0, 10) = "银行帐号"
.TextMatrix(0, 11) = "开户银行"
.TextMatrix(0, 12) = "会员类别编号"
.TextMatrix(0, 13) = "累计消费金额"
.TextMatrix(0, 14) = "备注信息"

.FixedRows = 1
For i = 0 To 14
.ColAlignment(i) = 0
Next i
'表头项居中
        .FillStyle = flexFillRepeat
        .Col = 0
        .Row = 0
        .RowSel = 1
        .ColSel = .Cols - 1
        .CellAlignment = 4
        
        .ColWidth(0) = 1000
        .ColWidth(1) = 1000
        .ColWidth(2) = 1000
        .ColWidth(3) = 1000
        .ColWidth(4) = 1000
        .ColWidth(5) = 1000
        .ColWidth(6) = 1000
        .ColWidth(7) = 1000
        .ColWidth(8) = 3000
        .ColWidth(9) = 1000
        .ColWidth(10) = 1000
        .ColWidth(11) = 2000
        .ColWidth(12) = 2000
        .ColWidth(13) = 2000
        
        .Row = 1
        End With
End Sub
 Private Sub ShowData()
    
    Dim j As Integer
    Dim i As Integer
    Dim MsgText As String
    txtSQL = "select * from g_khxinxi"
    Set mrc = ExecuteSQL(txtSQL, MsgText)
        With xlist
        .Rows = 1
        
        Do While Not mrc.EOF
            .Rows = .Rows + 1
            For i = 1 To mrc.Fields.Count
                Select Case mrc.Fields(i - 1).Type
                    Case adDBDate
                        .TextMatrix(.Rows - 1, i) = Format(mrc.Fields(i - 1) & "", "yyyy-mm-dd")
                    Case Else
                        .TextMatrix(.Rows - 1, i) = mrc.Fields(i - 1) & ""
                End Select
            Next i
            mrc.MoveNext
        Loop
        
          
    End With
    mrc.Close
    End Sub

⌨️ 快捷键说明

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