form19.frm
来自「一个商业软件的源码」· FRM 代码 · 共 2,131 行 · 第 1/5 页
FRM
2,131 行
End If
End Select
End Sub
Private Sub CurtButton7_Click()
Dim i As Integer
If CurtButton7.Caption = "保存(&S)" Then
CurtButton5.Enabled = True
CurtButton7.Caption = "编辑(&E)"
DataGrid1.Enabled = True
Call sj("true")
CurtButton9.Enabled = False
Call tlock(True)
'If Text1(5).Text <> "" And Text1(6).Text <> "" Then
'Else
'MsgBox "客户中文名和英文名均不能为空", vbOKOnly
'Call CurtButton9_Click
'Exit Sub
'End If
'If Image2.Visible = True Then
'MsgBox "客户中文名已存在", vbOKOnly
'Call CurtButton9_Click
'Exit Sub
'End If
'If Image4.Visible = True Then
'MsgBox "客户英文名已存在", vbOKOnly
'Call CurtButton9_Click
'Exit Sub
'End If
'If Image1.Visible = True And Image4.Visible = True Then
'MsgBox "客户英文名已存在", vbOKOnly
'Call CurtButton9_Click
'Exit Sub
'End If
'If Image2.Visible = True And Image3.Visible = True Then
'MsgBox "客户中文名已存在", vbOKOnly
'Call CurtButton9_Click
'Exit Sub
'End If
'If Image2.Visible = True And Image4.Visible = True Then
'MsgBox "客户中文名,英文名均已存在", vbOKOnly
'Call CurtButton9_Click
'Exit Sub
'End If
Adodc2.RecordSource = "select * from vkehu where" & "(" & "销售=" & "'" & users & "'" & ")" & "and" & "(" & " 客户类型='新客户'" & ")"
Adodc2.Refresh
uhbb = Adodc2.Recordset.RecordCount
If Text1(3).Text <> "新客户" Then
Else
If uhbb < bbxl Then
Else
If xg = "true" Then
xg = "false"
Else
MsgBox "新客户报备已满!"
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
DataList1.Visible = False
MonthView1.Visible = False
Call CurtButton9_Click
Exit Sub
End If
End If
End If
If Text1(5).Text <> "" And Text1(6).Text <> "" Then
Else
MsgBox " 客户中文名或英文名不能为空"
Call CurtButton9_Click
Hook Me.hwnd
Exit Sub
End If
Adodc1.Recordset.UpdateBatch
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Hook Me.hwnd
bjzt = False
DataList1.Visible = False
MonthView1.Visible = False
Else
CurtButton7.Caption = "保存(&S)"
Call sj("false")
CurtButton9.Enabled = True
Call tlock(False)
If Text1(3).Text = "新客户" Then
For i = 1 To 6
Text1(i).Locked = True
Next i
xg = "true"
Else
xg = "false"
End If
UnHook Me.hwnd
DataGrid1.Enabled = False
Call fqxfy(True)
bjzt = True
End If
End Sub
Private Sub CurtButton8_Click()
TABA = "dbo.vkehu"
frmselect.Show
End Sub
Private Sub CurtButton9_Click()
Adodc1.Recordset.CancelBatch
Hook Me.hwnd
CurtButton7.Caption = "编辑(&E)"
CurtButton7.Enabled = True
Text1(0).Refresh
bjzt = False
Call fqxfy(False)
DataList1.Visible = False
MonthView1.Visible = False
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Adodc1.Refresh
CurtButton9.Enabled = False
DataGrid1.Enabled = True
Call tlock(True)
End Sub
Private Sub DataList1_Click()
Text1(ks).Text = DataList1.Text
DataGrid1.Columns(ks) = DataList1.Text
DataList1.Visible = False
If ks = 12 Then
CurtButton7.Enabled = True
End If
End Sub
Private Sub Form_Load()
uhbb = 0
Call bj
Call csh(qx)
Form1.Refresh
'qx = "user"
'users = "kevin"
Set ck = Form1
dts = DataGrid1.VisibleRows
Set dt = DataGrid1
Set ad = Adodc1
Hook Me.hwnd
'Call dataopen
Call ckqd
Select Case qx
Case "admin"
Adodc1.ConnectionString = cnn.ConnectionString
Adodc1.RecordSource = "select * from dbo.vkehu "
Adodc1.Refresh
If Adodc1.Recordset.RecordCount <> 0 Then
jls = Adodc1.Recordset.RecordCount
Else
jls = 0
End If
StatusBar1.Panels(4).Text = "系统中目前总共有" & jls & "家客户!"
Case "user"
Adodc1.ConnectionString = cnn.ConnectionString
Adodc1.RecordSource = "select * from dbo.vkehu where 销售 = " & " '" & users & "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount <> 0 Then
jls = Adodc1.Recordset.RecordCount
Else
jls = 0
End If
Adodc1.Refresh
End Select
Set DataGrid1.DataSource = Adodc1
Dim i As Integer
Dim J As Integer
i = Text1.Count - 1
For J = 0 To i
Set Text1(J).DataSource = Adodc1
Text1(J).DataField = Adodc1.Recordset.Fields(J).name
Next J
Adodc2.ConnectionString = cnn.ConnectionString
Call tree
StatusBar1.Panels(4).Text = "您目前已有" & jls & " 家客户!"
Adodc2.RecordSource = "select * from dbo.bbxe"
Adodc2.Refresh
bbxl = Adodc2.Recordset.Fields(0).Value
End Sub
Private Sub Form_Resize()
CoolBar1.Width = Form1.ScaleWidth
CoolBar1.Left = 0
Call bj
End Sub
Public Function tlock(t As Boolean)
Dim i As Integer
Dim J As Integer
i = Text1.Count - 1
If t = True Then
For J = 0 To i
Text1(J).Locked = True
Next J
Else
For J = 0 To i
Text1(J).Locked = False
Next J
End If
Text1(2).Locked = True
End Function
Public Function tree()
Dim nodx As Node
Set nodx = TreeView1.Nodes.Add(, , "kh", "客户")
Set nodx = TreeView1.Nodes.Add("kh", tvwChild, "xs", "销售")
Set nodx = TreeView1.Nodes.Add("kh", tvwChild, "dq", "客户所在城市")
Set nodx = TreeView1.Nodes.Add("kh", tvwChild, "zt", "客户状态")
Set nodx = TreeView1.Nodes.Add("kh", tvwChild, "lx", "客户类型")
Set nodx = TreeView1.Nodes.Add("kh", tvwChild, "xz", "企业性质")
Call addtree
End Function
Private Sub Form_Unload(Cancel As Integer)
If CurtButton7.Caption = "保存(&S)" Then
MsgBox "您的修改还未保存,请先保存。"
Cancel = 1
Else
Cancel = 0
End If
End Sub
Private Sub Frame1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Text1(0).Locked = True Then
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
If Adodc1.Recordset.RecordCount <> 0 Then
CurtButton7.Enabled = True
Else
CurtButton7.Enabled = False
End If
End If
End Sub
Private Sub Frame2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim u As String
If Button = 2 Then
u = InputBox("请输入调试码", "调试", , X, Y)
If u = "delect" Then
CurtButton11.Visible = True
End If
If u = "kevin" Then
CurtButton12.Visible = True
End If
End If
End Sub
Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
Text1(ks).Text = MonthView1.Value
MonthView1.Visible = False
End Sub
Private Sub mun_add_Click()
Call CurtButton5_Click
End Sub
Private Sub mun_bbku_Click()
Form17.Show
End Sub
Private Sub mun_bj_Click()
Call CurtButton7_Click
End Sub
Private Sub mun_cy_Click()
Form5.Show
End Sub
Private Sub mun_edit_Click()
mun_add.Enabled = CurtButton5.Enabled
mun_fq.Enabled = CurtButton6.Enabled
mun_bj.Enabled = CurtButton7.Enabled
mun_qx.Enabled = CurtButton9.Enabled
End Sub
Private Sub mun_exit_Click()
If CurtButton7.Caption = "保存(&S)" Then
MsgBox "您的修改还未保存,请先保存。"
Else
End
End If
End Sub
Private Sub mun_fq_Click()
Call CurtButton6_Click
End Sub
Private Sub mun_gy_Click()
frmAbout.Show
End Sub
Private Sub mun_qx_Click()
Call CurtButton9_Click
End Sub
Private Sub mun_yhgl_Click()
Form6.Show
End Sub
Private Sub muncrsj_Click()
Form7.Show
End Sub
Private Sub Text1_Change(Index As Integer)
If Text1(5).Locked = False Then
Select Case Index
Case 5
Image1.Visible = False
Image2.Visible = False
Timer1.Enabled = True
Case 6
Image3.Visible = False
Image4.Visible = False
Timer2.Enabled = True
End Select
End If
End Sub
Private Sub Text1_Click(Index As Integer)
If Text1(1).Locked = False Then
Select Case Index
Case 0
Adodc2.RecordSource = "select * from dbo.kuzt"
Adodc2.Refresh
Set DataList1.RowSource = Adodc2
DataList1.ListField = "客户状态"
DataList1.Top = Text1(Index).Top + Text1(Index).Height
DataList1.Width = Text1(Index).Width
DataList1.Left = Text1(Index).Left
DataList1.Visible = True
ks = Index
Case 3
Adodc2.RecordSource = "select * from dbo.khlx"
Adodc2.Refresh
Set DataList1.RowSource = Adodc2
DataList1.ListField = "客户类型"
DataList1.Top = Text1(Index).Top + Text1(Index).Height
DataList1.Width = Text1(Index).Width
DataList1.Left = Text1(Index).Left
DataList1.Visible = True
ks = Index
Case 12
If Text1(3).Text = "关联企业" Then
If qx <> "admin" Then
Adodc2.RecordSource = "select * from dbo.vkehu where 销售=" & "'" & users & "'"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount <> 0 Then
Set DataList1.RowSource = Adodc2
DataList1.ListField = "客户中文名称"
DataList1.Top = Text1(Index).Top + Text1(Index).Height
DataList1.Width = Text1(Index).Width
DataList1.Left = Text1(Index).Left
DataList1.Visible = True
ks = Index
End If
End If
End If
Case 10
Adodc2.RecordSource = "select * from dbo.khqy"
Adodc2.Refresh
Set DataList1.RowSource = Adodc2
DataList1.ListField = "所在区域"
DataList1.Top = Text1(Index).Top + Text1(Index).Height
DataList1.Width = Text1(Index).Width
DataList1.Left = Text1(Index).Left
DataList1.Visible = True
ks = Index
Case 19
Adodc2.RecordSource = "select * from dbo.qyxz"
Adodc2.Refresh
Set DataList1.RowSource = Adodc2
DataList1.ListField = "企业性质"
DataList1.Top = Text1(Index).Top - DataList1.Height
DataList1.Width = Text1(Index).Width
DataList1.Left = Text1(Index).Left
DataList1.Visible = True
ks = Index
End Select
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?