Select Case e.StripItem.Name
'主客户新增
Case "主客户新增"
Tables("T_客户表").AddNew() '打开代码
e.StripItem.Enabled = False
Case "主客户保存"
If Tables("T_客户表").Current IsNot Nothing Then
vars("a") = True
Dim drs As List(Of DataRow)
drs = DataTables("T_子客户").Select("[客户名称] = '" & Tables("T_客户表").Current("客户名称") & "' ")
For Each dr As DataRow In drs
dr.Save()
Next
Tables("T_客户表").Current.Save()
Syscmd.Row.UnLock()
e.Form.Strips("主菜单").Items("主客户新增").Enabled = True
End If
Case "主客户修改"
Syscmd.Row.UnLock()
Case "主客户删除"
Dim Result As DialogResult
Result = MessageBox.Show("你确定要删除吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.Yes And Tables("T_客户表").Current("资金结余") =0 Then
Syscmd.Row.Delete()
Else
MessageBox.Show("不允许删除","提示",MessageBoxButtons.OK)
End If
'子客户新增
Case "子客户新增"
Tables("T_客户表.T_子客户").AddNew() '新增代码
e.StripItem.Enabled = False
Case "子客户保存"
Tables("T_客户表.T_子客户").Current.save()'保存代码
Syscmd.Row.Lock()
e.Form.Strips("主菜单").Items("子客户新增").enabled = True
Case "子客户修改"
Syscmd.Row.UnLock()
e.Form.Strips("主菜单").Items("子客户新增").enabled = False
Case "子客户删除"
MessageBox.Show("不允许删除","提示",MessageBoxButtons.OK)
End Select