当前位置:首页 > 企业客户关系管理系统的设计与实现 - 图文
内蒙古大学工程硕士学位论文
Private Sub Refresh_Customer() Dim TmpSource As String
If CurArea.AreaId <= 0 And Check1.Value = 0 Then lblSel = 0 Exit Sub End If
'计算全部单位总数
total_num = MyCust.CountCustomer(0) lblTotal = Trim(Str(total_num))
TmpSource = \单位名称,a.AreaName as 地域名称,\ + \客户类型,t1.TypeName AS 所属行业,c.Address as 通信地址,\_
+ \邮政编码,a.AreaId,c.EmpId,e.EmpName AS 销售人员 \ + \
+ \ + \ '未选择地域
If Check1.Value = 1 Then '全部类别
If Len(Trim(dco_CType.Text)) = 0 Then
TmpSource = TmpSource + \ '选择类别 Else
TmpSource = TmpSource + \ + Trim(dco_CType.BoundText) + \ End If Else
If CurArea.AreaType = 4 Then '市 '全部类别
If Len(Trim(dco_CType.Text)) = 0 Then
TmpSource = TmpSource + \
39
内蒙古大学工程硕士学位论文
+ Trim(Str(CurArea.AreaId)) + \ Else
TmpSource = TmpSource + \ + Trim(Str(CurArea.AreaId)) + \ + Trim(dco_CType.BoundText) _ + \ End If Else '省
If Len(Trim(dco_CType.Text)) = 0 Then
TmpSource = TmpSource + \
+ Trim(Str(CurArea.AreaId)) + \ + Trim(Str(CurArea.AreaId)) + \ Else
TmpSource = TmpSource + \
+ Trim(Str(CurArea.AreaId)) + \ + Trim(Str(CurArea.AreaId)) + \ + Trim(dco_CType.BoundText) _ + \ End If End If End If
Adodc1.ConnectionString = Conn Adodc1.RecordSource = TmpSource Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
lblSel = Trim(Str(Adodc1.Recordset.RecordCount)) DataGrid1.Columns(0).Width = 0 End Sub
Private Sub Check1_Click() If Check1.Value = 1 Then ComboArea.Enabled = False ComboArea.Text = \全部地域\ Else
ComboArea.Text = MyArea.GetName(CurArea.UpperId) + \ \
40
内蒙古大学工程硕士学位论文
ComboArea.Enabled = True End If
Refresh_Customer End Sub
Private Sub Cmd_Add_Click() '设置添加信息
FrmCustomerEdit.Modify = False FrmCustomerEdit.ComboArea.Text = \ FrmCustomerEdit.Show 1 Refresh_Customer End Sub
Private Sub Cmd_AddCt_Click() If Adodc1.Recordset.BOF = True Then MsgBox \请选择记录\ Exit Sub End If
FrmContactEdit.Modify = False
FrmContactEdit.OriCustId = Adodc1.Recordset.Fields(0)
FrmContactEdit.lbl_CustName = Trim(Adodc1.Recordset.Fields(1)) FrmContactEdit.ComboSex.ListIndex = 1 FrmContactEdit.Show 1 End Sub
Private Sub Cmd_Back_Click() Unload Me End Sub
Private Sub Cmd_Del_Click()
If Adodc1.Recordset.BOF = True Then MsgBox \请选择记录\ Exit Sub End If
'是否存在此客户的商业机会
If MyChance.HaveCustomer(Adodc1.Recordset.Fields(0)) = True Then MsgBox \商业机会中存在此客户信息,不能删除!\
41
内蒙古大学工程硕士学位论文
Exit Sub End If '确认删除
If MsgBox(\是否确定要删除客户信息,删除时同时删除客户联系人信息\请确认\ Exit Sub End If '删除客户信息
Call MyCust.Delete(Adodc1.Recordset.Fields(0)) '删除对应的联系人信息
Call MyContact.DeleteByCustId(Adodc1.Recordset.Fields(0)) Refresh_Customer End Sub
Private Sub Cmd_Modi_Click() Dim TmpAreaId As Long
If Adodc1.Recordset.BOF = True Then MsgBox \请选择记录\ Exit Sub End If '客户单位
FrmCustomerEdit.OriCustId = Adodc1.Recordset.Fields(0) FrmCustomerEdit.txtName = Trim(Adodc1.Recordset.Fields(1)) '地域
FrmCustomerEdit.ComboArea.Text = Trim(Adodc1.Recordset.Fields(2)) '类别
FrmCustomerEdit.dco_CType.Text = Trim(Adodc1.Recordset.Fields(3)) '所属行业
FrmCustomerEdit.dco_BType.Text = Trim(Adodc1.Recordset.Fields(4)) '通信地址
FrmCustomerEdit.txtAddr = Trim(Adodc1.Recordset.Fields(5)) '邮政编码
FrmCustomerEdit.txtCode = Trim(Adodc1.Recordset.Fields(6)) '销售人员
42
共分享92篇相关文档