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

📄 maininfo.frm

📁 本套软件适用于手机等用户、培训机构等单位的教学管理软件。
💻 FRM
📖 第 1 页 / 共 5 页
字号:
Adodc3.Recordset.Fields("Add_Remark").Value = Trim(Text27.Text)
'
'Adodc3.Recordset.Fields("Photo").Value = CommonDialog1.FileTitle
'Label30.Caption = App.Path + "\photo\" + CommonDialog1.FileTitle
'If CommonDialog1.FileName <> "" Then
'FileCopy CommonDialog1.FileName, Label30.Caption
'End If
'Adodc3.Recordset.EditMode
Adodc3.Recordset.Update
Adodc3.Refresh
MsgBox "修改成功!", vbOKOnly + vbExclamation, "修改联系人"
End Sub



Private Sub DataGrid2_Click()
'str1 = Adodc4.Recordset.Fields("ID")
'Adodc4.RecordSource = "select distinct * from PersonlInfo where ID=" + "'" & str1 & "'"

'Adodc4.CommandType = adCmdText
'Adodc4.Refresh
If Adodc3.Recordset.RecordCount > 0 Then
'Adodc3.Recordset.MoveLast
Text1.Text = Trim(Adodc3.Recordset.Fields("Name").Value)
Text2.Text = Trim(Adodc3.Recordset.Fields("Mobile_Tel").Value)
Text3.Text = Trim(Adodc3.Recordset.Fields("Family_Add").Value)
'Text4.Text = Trim(Adodc3.Recordset.Fields("Name").Value)
Text5.Text = Trim(Adodc3.Recordset.Fields("Family_Tel").Value)
Text6.Text = Trim(Adodc3.Recordset.Fields("Company_Tel").Value)
Text7.Text = Trim(Adodc3.Recordset.Fields("Smart_Tel").Value)
Text8.Text = Trim(Adodc3.Recordset.Fields("QQ_Num").Value)
Text9.Text = Trim(Adodc3.Recordset.Fields("MSN_Num").Value)
Text10.Text = Trim(Adodc3.Recordset.Fields("Company_Name").Value)
Text11.Text = Trim(Adodc3.Recordset.Fields("Company_Add").Value)
Text12.Text = Trim(Adodc3.Recordset.Fields("Company_Fax").Value)
Text13.Text = Trim(Adodc3.Recordset.Fields("Company_Tel").Value) '办公电话
Text14.Text = Trim(Adodc3.Recordset.Fields("Com_Homepage").Value)
Text15.Text = Trim(Adodc3.Recordset.Fields("Company_Post").Value)
Text16.Text = Trim(Adodc3.Recordset.Fields("Email").Value)
Text17.Text = Trim(Adodc3.Recordset.Fields("Per_Homepage").Value)
Text18.Text = Trim(Adodc3.Recordset.Fields("Loving").Value)
Text19.Text = Trim(Adodc3.Recordset.Fields("Remark").Value)
Text20.Text = Trim(Adodc3.Recordset.Fields("Company_Name").Value)
Text21.Text = Trim(Adodc3.Recordset.Fields("Company_Add").Value)
'Text22.Text = Trim(Adodc3.Recordset.Fields("Email").Value)
Text23.Text = Trim(Adodc3.Recordset.Fields("Name").Value)
'Text24.Text = Trim(Adodc3.Recordset.Fields("So_Call").Value)
Text25.Text = Trim(Adodc3.Recordset.Fields("Family_Post").Value)
Text26.Text = Trim(Adodc3.Recordset.Fields("Standby_Tel").Value)
Text27.Text = Trim(Adodc3.Recordset.Fields("Add_Remark").Value)

Combo1.Text = Trim(Adodc3.Recordset.Fields("Sex").Value)
Combo2.Text = Trim(Adodc3.Recordset.Fields("Group_Name").Value)
Combo3.Text = Trim(Adodc3.Recordset.Fields("Blood_Type").Value)
Combo4.Text = Trim(Adodc3.Recordset.Fields("Star").Value)
Combo5.Text = Trim(Adodc3.Recordset.Fields("Dept_Name").Value)
Combo6.Text = Trim(Adodc3.Recordset.Fields("Dept_Duty").Value)
Combo8.Text = Trim(Adodc3.Recordset.Fields("Sheng_Xiao").Value)
Combo9.Text = Trim(Adodc3.Recordset.Fields("Dept_Name").Value)
Combo10.Text = Trim(Adodc3.Recordset.Fields("Dept_Duty").Value)
Combo11.Text = Trim(Adodc3.Recordset.Fields("Belong_Industry").Value)
DTPicker1.Value = Trim(Adodc3.Recordset.Fields("Birth").Value)
strPhoto = Trim(Adodc3.Recordset.Fields("Photo").Value)
Label24.Caption = strPhoto
If strPhoto <> "" Then
If FS.FileExists(App.Path + "\photo\" + strPhoto) = True Then
Image1.Picture = LoadPicture(App.Path + "\photo\" + strPhoto)
Exit Sub
End If
Else:   Image1.Picture = LoadPicture(App.Path + "\picture\Nophoto.jpg")
End If

'MsgBox ("qw")
'If (strcombo = Trim(Adodc3.Recordset.Fields("Sex").Value)) <> "" Then
'For i = 1 To Combo2.ListCount Step 1
'If Combo2.List(i) = strcombo Then
'Combo2.ListIndex = 4
'Exit For
'End If
'Next i
'End If



If strkey = "所有联系人" Or strkey = "" Then
Adodc3.RecordSource = "select * from PersonlInfo "
Else
Adodc3.RecordSource = "select distinct * from PersonlInfo where group_Name=" + "'" & strkey & "'" + "or Name=" + "'" & strkey & "'"
End If
Adodc3.Refresh
End If

End Sub



Private Sub DeleteGro_Click()
deletgoup.Show
End Sub



Private Sub DeleteRow_Click()
deletgoup.Show
End Sub

Private Sub EditRow_Click()
changgroup.Show
End Sub



Private Sub Form_Load()
i = 0
strkey = ""
Combo1.ListIndex = 0
Command1.Enabled = False
Command2.Enabled = False
Frame1.Visible = True
Frame3.Visible = False
Frame5.Visible = False

Call RefreshTree
Adodc4.CommandType = adCmdText
Adodc4.RecordSource = "select distinct * from PersonlInfo"
Adodc4.Refresh
StatusBar1.Panels(2).Text = "当前记录数" + Str(Adodc3.Recordset.RecordCount) + "条/ 记录总数" + Str(Adodc4.Recordset.RecordCount) + "条"

If Adodc3.Recordset.RecordCount > 0 Then
Adodc3.Recordset.MoveFirst
End If
End Sub

Private Sub Image1_Click()
 CommonDialog1.DialogTitle = "选择该联系人的照片"
    CommonDialog1.Filter = "所有图形文件|*.bmp;*.dib;*.gif;*.jpg;*.ico|位图文件(*.bmp;*.dib)|*.bmp;*.dib|GIF文件(*.gif)|*.gif|JPEG文件(*.jpg)|*.jpg|图标文件(*.ico)|*.ico"
    CommonDialog1.ShowOpen
    If CommonDialog1.FileName = "" Then Exit Sub
    Image1.Picture = LoadPicture(CommonDialog1.FileName)
    'mstrFileName = CommonDialog1.FileName
    Exit Sub
End Sub




Private Sub Image3_Click()
 CommonDialog1.DialogTitle = "选择该联系人的照片"
    CommonDialog1.Filter = "所有图形文件|*.bmp;*.dib;*.gif;*.jpg;*.ico|位图文件(*.bmp;*.dib)|*.bmp;*.dib|GIF文件(*.gif)|*.gif|JPEG文件(*.jpg)|*.jpg|图标文件(*.ico)|*.ico"
    CommonDialog1.ShowOpen
    If CommonDialog1.FileName = "" Then Exit Sub
    Image1.Picture = LoadPicture(CommonDialog1.FileName)
    'mstrFileName = CommonDialog1.FileName
    Exit Sub
End Sub

Private Sub Image4_Click()
If Trim(Adodc3.Recordset.Fields("Photo").Value) = "" And Trim(CommonDialog1.FileTitle) = "" Then
MsgBox "没有照片 ", vbOKOnly + vbExclamation, "移除照片"
Exit Sub
End If

If Trim(CommonDialog1.FileTitle) = "" And Trim(Adodc3.Recordset.Fields("Photo").Value) <> "" Then
If MsgBox("是否要移除照片 ?", vbYesNo + vbQuestion, "移除照片") = vbYes Then
If FS.FileExists(App.Path + "\photo\" + Trim(Adodc3.Recordset.Fields("Photo").Value)) = True Then
Kill App.Path + "\photo\" + Adodc3.Recordset.Fields("Photo").Value
End If
Adodc3.Recordset.Fields("Photo").Value = ""
Adodc3.Recordset.Update
Adodc3.Refresh
Image1.Picture = LoadPicture(App.Path + "\picture\Nophoto.jpg")
Exit Sub
End If

ElseIf Trim(CommonDialog1.FileTitle) <> "" And Trim(Adodc3.Recordset.Fields("Photo").Value) <> "" Then
If MsgBox("是否要移除照片 ?", vbYesNo + vbQuestion, "移除照片") = vbYes Then
If FS.FileExists(App.Path + "\photo\" + Trim(Adodc3.Recordset.Fields("Photo").Value)) = True Then
Kill App.Path + "\photo\" + Adodc3.Recordset.Fields("Photo").Value
End If
Adodc3.Recordset.Fields("Photo").Value = ""
Adodc3.Recordset.Update
Adodc3.Refresh
Image1.Picture = LoadPicture(App.Path + "\picture\Nophoto.jpg")
Exit Sub
End If
Else
Image1.Picture = LoadPicture(App.Path + "\picture\Nophoto.jpg")
End If
End Sub

Private Sub Image5_Click()
'Open App.Path + "\photo\" + Adodc3.Recordset.Fields("Photo").Value For Random As #1
'i = Shell(App.Path + "\photo\" + Adodc3.Recordset.Fields("Photo").Value, 1)
'i = Shell(App.Path + "\photo\Nophoto.jpg", 1)

'Image1.Picture = LoadPicture(App.Path + "\photo\Nophoto.jpg")
End Sub



Private Sub Image6_Click()
If CommonDialog1.FileTitle <> "" Then
Adodc3.Recordset.Fields("Photo").Value = CommonDialog1.FileTitle
Label30.Caption = App.Path + "\photo\" + CommonDialog1.FileTitle
'If CommonDialog1.FileName <> "" Then
FileCopy CommonDialog1.FileName, Label30.Caption
MsgBox "保存成功 ", vbOKOnly + vbExclamation, "保存照片"
End If
'Adodc3.Recordset.EditMode
Adodc3.Recordset.Update
Adodc3.Refresh
End Sub

Private Sub Screen_Click()
i = Shell(App.Path + "\picture\最小的抓图软件.exe", 1)
End Sub

Private Sub TabStrip1_Click()
Select Case TabStrip1.SelectedItem.Key
Case "ComnInfo" '常用信息
Frame1.Visible = True
Frame3.Visible = False
Frame5.Visible = False
Case "ComInfo"  ' 单位信息
Frame1.Visible = False
Frame3.Visible = True
Frame5.Visible = False
Case "PersonInfo"   '个人信息
Frame1.Visible = False
Frame3.Visible = False
Frame5.Visible = True
End Select
End Sub

Private Sub Text_Click()
Dim i
i = Shell("c:\\windows\system32\notepad.exe", 1)
End Sub



Private Sub Text1_Change()
Text23.Text = Text1.Text
End Sub

Private Sub Text10_Change()
Text20.Text = Text10.Text
End Sub

Private Sub Text11_Change()
Text21.Text = Text11.Text
End Sub

Private Sub Text13_Change()
Text6.Text = Text13.Text
End Sub

Private Sub Text20_Change()
Text10.Text = Text20.Text
End Sub

Private Sub Text21_Change()
Text11.Text = Text21.Text
End Sub

Private Sub Text23_Change()
Text1.Text = Text23.Text
End Sub

Private Sub Text4_Change()
strSQL = ""
strSQL = "or Name like " + "'%" + Trim(Text4.Text) + "%'"
strSQL = strSQL + "or Sex like " + "'%" + Trim(Text4.Text) + "%'"
strSQL = strSQL + "or Birth like " + "'%" + Trim(Text4.Text) + "%'"
strSQL = strSQL + "or Sheng_Xiao like " + "'%" + Trim(Text4.Text) + "%'"
strSQL = strSQL + "or Family_Tel like " + "'%" + Trim(Text4.Text) + "%'"
strSQL = strSQL + "or Mobile_Tel like " + "'%" + Trim(Text4.Text) + "%'"
strSQL = strSQL + "or Smart_Tel like " + "'%" + Trim(Text4.Text) + "%'"
strSQL = strSQL + "or Company_Tel like " + "'%" + Trim(Text4.Text) + "%'"
strSQL = strSQL + "or Family_Add like " + "'%" + Trim(Text4.Text) + "%'"
strSQL = strSQL + "or Company_Add like " + "'%" + Trim(Text4.Text) + "%'"
strSQL = strSQL + "or Company_Name like " + "'%" + Trim(Text4.Text) + "%'"
strSQL = strSQL + "or Company_Post like " + "'%" + Trim(Text4.Text) + "%'"
strSQL = strSQL + "or QQ_Num like " + "'%" + Trim(Text4.Text) + "%'"
strSQL = strSQL + "or MSN_Num like " + "'%" + Trim(Text4.Text) + "%'"
strSQL = strSQL + "or Per_Homepage like " + "'%" + Trim(Text4.Text) + "%'"
strSQL = strSQL + "or Star like " + "'%" + Trim(Text4.Text) + "%'"
strSQL = strSQL + "or Blood_Type like " + "'%" + Trim(Text4.Text) + "%'"
strSQL = strSQL + "or Loving like " + "'%" + Trim(Text4.Text) + "%'"
strSQL = strSQL + "or Remark like " + "'%" + Trim(Text4.Text) + "%'"
strSQL = strSQL + "or Email like " + "'%" + Trim(Text4.Text) + "%'"


Adodc3.RecordSource = "select distinct * from PersonlInfo where group_Name=" + "'" & Text4.Text & "'" + strSQL
Adodc3.CommandType = adCmdText
Adodc3.Refresh
'adodc3.Recordset=
End Sub

Private Sub Text6_Change()
Text13.Text = Text6.Text
End Sub

Private Sub Timer1_Timer()
StatusBar1.Panels(4).Text = Now
End Sub



Private Sub Toolbar_Click()
TreeView1.Nodes.Clear
Call RefreshTree
End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "NewAdd" '新建联系人
Command1.Enabled = True
Command2.Enabled = False
Call ClearAll   '函数调用
Case "Change" '修改联系人
Command2.Enabled = True
Command1.Enabled = False
Call DataGrid2_Click
Case "Delete"   '删除联系人
Command2.Enabled = False
Command1.Enabled = False
If MsgBox("是否要删联系人 " + Adodc3.Recordset.Fields("Name").Value, vbYesNo + vbQuestion, "删除联系人") = vbYes Then

If Trim(Adodc3.Recordset.Fields("Photo").Value) <> "" Then
If FS.FileExists(App.Path + "\photo\" + Adodc3.Recordset.Fields("Photo").Value) = True Then

 Kill App.Path + "\photo\" + Adodc3.Recordset.Fields("Photo").Value
Image1.Picture = LoadPicture(App.Path + "\picture\Nophoto.jpg")
End If
End If
Adodc3.Recordset.Delete
End If

Case "NewGroup"
addgroup.Show
Case "EditGroup"
changgroup.Show
Case "DeleteGroup"
deletgoup.Show
Case "Refresh"
TreeView1.Nodes.Clear
Call RefreshTree
Case "Detailed"
grouping.Show
End Select

End Sub

Private Sub TreeView1_Click()
'adodc3 是 PersonlInfo

strkey = Trim(TreeView1.SelectedItem.Key)
If strkey = "所有联系人" Then
Adodc3.RecordSource = "select * from PersonlInfo "
Else
Adodc3.RecordSource = "select * from PersonlInfo where group_Name=" + "'" & strkey & "'" + "or Name=" + "'" & strkey & "'"
End If
Adodc3.CommandType = adCmdText
Adodc3.Refresh
If Adodc3.Recordset.RecordCount > 0 Then
Adodc3.Recordset.MoveLast
Text1.Text = Trim(Adodc3.Recordset.Fields("Name").Value)
Text2.Text = Trim(Adodc3.Recordset.Fields("Mobile_Tel").Value)
Text3.Text = Trim(Adodc3.Recordset.Fields("Family_Add").Value)
'Text4.Text = Trim(Adodc3.Recordset.Fields("Name").Value)
Text5.Text = Trim(Adodc3.Recordset.Fields("Family_Tel").Value)
Text6.Text = Trim(Adodc3.Recordset.Fields("Company_Tel").Value)
Text7.Text = Trim(Adodc3.Recordset.Fields("Smart_Tel").Value)
Text8.

⌨️ 快捷键说明

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