-- 作者:裴保民
-- 发布时间:2018/4/28 8:06:00
-- 关于流程语句
Dim tbx As WinForm.TextBox = e.Form.controls("liuliangkahaoText1") Dim str As String = tbx.text Dim t As Table = Tables("流量卡资料") Dim bangding As Object =e.Form.Controls("shifoubangding") Dim gouqifou As Object =e.Form.Controls("shifoukeyixufei") Dim kehu As WinForm.TextBox = e.Form.Controls("kehuxingmingText") Dim idx As Integer=t.findrow("流量卡号 = \'" & str & "\'") Dim Result As DialogResult If tbx.text= Nothing Then MessageBox.Show("流量卡号不能为空!", "提示") e.Form.Controls("liuliangkahaoText1").Select Else If idx >=0 Then MessageBox.Show("流量卡已存在,流量卡不能入库!", "提示") tbx.Select Else Result = MessageBox.Show("是否添加数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If Result = DialogResult.Yes Then Tables("流量卡资料").Current("流量卡号") = e.Form.Controls("liuliangkahaoText1").Value If kehu.Value =Nothing Then Tables("流量卡资料").Current("是否绑定") = bangding.Checked = True Else Tables("流量卡资料").Current("是否绑定")= bangding.Checked = False End If
If e.Form.Controls("youxiaoqizhiDate").Value < Date.Today Then Tables("流量卡资料").Current("是否过期") = gouqifou.Checked = False Else Tables("流量卡资料").Current("是否过期") = gouqifou.Checked = True End If DataTables("流量卡资料").save DataTables("流量卡资料").Load e.Form.Controls("weibangdingkehuLabel").text = DataTables("流量卡资料").Compute("Count([是否绑定])", "是否绑定 = \'False\'") & " 张流量卡" e.Form.Controls("yibangdingkehuLabel").text = DataTables("流量卡资料").Compute("Count([是否绑定])", "是否绑定 = \'True\'") & " 张流量卡" e.Form.Controls("liuliangkezongshuLabel").text = DataTables("流量卡资料").Compute("Count([是否绑定])") & " 张流量卡" jinzhihangjianyidong=True xgjinzhihangjianyidong=True Else jinzhihangjianyidong=True xgjinzhihangjianyidong=True Tables("流量卡资料").Current.Reject() DataTables.Save Tables("流量卡资料").position = 0 End If vars("单击了") = False e.Form.Controls("liuliangkaruku").Enabled=False e.Form.Controls("shujudaohangGroupBox").Enabled=True e.Form.Controls("shujuchazhaoyubangdingGroupBox").Enabled=True e.Form.Controls("xiugaishuju").Enabled= True e.Form.Controls("tianjiashuju").Enabled=True e.Form.Controls("shanchushuju").Enabled= True e.Form.Controls("tianjiashuju").TopMost= True e.Form.Controls("quedingtianjia").TopMost=False e.Form.Controls("liuliangkahaoText").TopMost=True e.Form.Controls("liuliangkahaoText1").TopMost= False End If End If
这句话哪错了?
为什么“是否过期”和 是否选中“是否绑定”控件有关,而不是判断 e.Form.Controls("youxiaoqizhiDate").Value < Date.Today 的条件呢?
|