If e.DataCol.name ="注册电话掩码" Then
If e.NewValue = "" Then
systemready = False
e.DataRow(e.DataCol.name.SubString(0,e.DataCol.name.length-4)) = ""
systemready = True
ElseIf e.newvalue.contains("*") Then
Dim dr As DataRow = DataTables("客户资料表").Find("客户ID='" & e.DataRow("客户ID") & "'")
If dr IsNot Nothing Then
Dim dh As String
For Each dc As DataCol In DataTables("客户资料表").DataCols
If dc.Name.EndsWith("掩码") Then
If dr(dc.Name) = e.NewValue Then
dh = dr(dc.Name.Replace("掩码",""))
Exit For
End If
End If
Next
If dh > "" Then
Dim r_tele As New System.Text.RegularExpressions.Regex("^1[0-9]{10}$")
If r_tele.IsMatch(dh) = False Then
msgbox("电话号码不正确")
e.cancel = True
End If
If e.Cancel = False Then
systemready = False
e.DataRow(e.DataCol.name.SubString(0,e.DataCol.name.length-2)) = dh
'e.NewValue = e.NewValue.SubString(0, 3) & "*****" & e.NewValue.SubString(8,3)
systemready = True
End If
Else
e.Cancel = True
End If
Else
e.Cancel = True
End If
Else
msgbox("不能这样修改")
e.cancel = True
End If
End If