'BeginTrans()
'这儿操作数据库。
记录部件1.SaveData()
采购计划打分详细.SaveData()
'判断事务执行结果
if CommitTrans()=false then
showerror(GetTransMessage())
end if
dim A = 0
dim dt=采购计划打分详细.DataTable
'保存前询问“这些年度采购计划是否已经在会上讨论过?”
if ShowQuestion("这些年度采购计划是否已经在会上讨论过?") then
for each dr in dt.Rows
if isnull(dr["总分"]) or isnull(dr["审批情况"]) then
A = 1
exit for
end if
next
else
for each dr in dt.Rows
if isnull(dr["总分"]) then
A = 2
exit for
end if
next
end if
if A = 1 then
ShowInformation("请将【审批情况】、【总分】填写完整")
dim b=采购计划打分详细.AddColumnStyleByExpression("审批情况","[审批情况] is null",True)
b.Appearance.ForeColor=Color.FromArgb(-65536)
dim c=采购计划打分详细.AddColumnStyleByExpression("总分","[总分] is null",True)
c.Appearance.ForeColor=Color.FromArgb(-65536)
else if A = 2 then
ShowInformation("请将【总分】填写完整")
dim d=采购计划打分详细.AddColumnStyleByExpression("总分","[总分] is null",True)
d.Appearance.ForeColor=Color.FromArgb(-65536)
else
me.Output1 = "Y"
ShowInformation("保存成功")
me.Close()
end if