提交按钮代码如下,想点击提交后,自动把BUG研发查询修改系统菜单的TopicBar1的统计数量cnt刷新一下。请看红色的代码有问题吗?
Dim r As Row = Tables("BUG研发表").Current
Dim str As String =""
If r.IsNull("出错模块") OrElse r("出错模块") = "请选择出错模块" Then
str &= "出错模块,"
End If
If r.IsNull("出错原因") OrElse r("出错原因") = "对出错BUG进行分析,定位问题找出原因,书写格式为:" & vbcrlf & "1:" & vbcrlf & "2:" & vbcrlf & "3:" & vbcrlf & " ." & vbcrlf & " ." & vbcrlf & " ." Then
str &= "出错原因,"
End If
If r.IsNull("解决模块") OrElse r("解决模块") = "请选择解决模块" Then
str &= "解决模块,"
End If
If r.IsNull("模块版本") OrElse r("模块版本") = "请输入模块版本号" Then
str &= "模块版本,"
End If
If r.IsNull("解决版本") OrElse r("解决版本") = "请选择解决环境" Then
str &= "解决版本,"
End If
If r.IsNull("更新标题") OrElse r("更新标题") = "请输入BUG更新标题,简明扼要凸显重点" Then
str &= "更新标题,"
End If
If r.IsNull("具体修改") OrElse r("具体修改") = "请输入具体修改的message,书写格式为:" & vbcrlf & "1:" & vbcrlf & "2:" & vbcrlf & "3:" & vbcrlf & " ." & vbcrlf & " ." & vbcrlf & " ." Then
str &= "具体修改"
End If
If str >""
MessageBox.show("请检查," & str.Trim(",") & "不能为空","点击提交时请确认",MessageBoxButtons.OK,MessageBoxIcon.Question)
r("已保存") = False
Return
End If
If r("已提交") = True Then
MessageBox.show("此BUG修改已经提交过了," & r("提交人") & "正在验证,请静静等待验证结果" & "不要在点提交按钮了","博达BUG综合管理系统",MessageBoxButtons.OK,MessageBoxIcon.error)
Return
ElseIf r.Isnull("出错模块")=False AndAlso r.Isnull("出错原因")=False AndAlso r.Isnull("解决模块")=False AndAlso r.Isnull("模块版本")=False AndAlso r.Isnull("解决版本")=False AndAlso r.Isnull("更新标题")=False AndAlso r.Isnull("具体修改")=False
If MessageBox.show("请确认此BUG已修正的信息是否提交到测试人员" & r("提交人") & "?","提交前请确认",MessageBoxButtons.OKCancel,MessageBoxIcon.Question)=DialogResult.OK Then
'Forms("发送mail").open
'Dim m As New MailSender
'm.Host = "mail.bdcom.com.cn"
'm.Account = "BUG@bdcom.com.cn"
'm.Password = "bdcom101liujy"
'm.From = "BUG@bdcom.com.cn" '
'm.AddReceiver(r("提交人邮箱").Replace(vbcrlf, ",").Replace(chr(13), ",").Replace(chr(10), ","))
'If r.IsNull("模块维护人邮箱") = False Then
'm.AddReceiver(r("模块维护人邮箱").Replace(vbcrlf, ",").Replace(chr(13), ",").Replace(chr(10), ","))
'End If
'If r.IsNull("测试经理") = False Then
'm.AddReceiver(r("测试经理").Replace(vbcrlf, ",").Replace(chr(13), ",").Replace(chr(10), ","))
'End If
'If r.IsNull("研发经理") = False Then
'm.AddReceiver(r("研发经理").Replace(vbcrlf, ",").Replace(chr(13), ",").Replace(chr(10), ","))
'End If
'If r.IsNull("研发组长邮箱") = False Then
'm.AddReceiver(r("研发组长邮箱").Replace(vbcrlf, ",").Replace(chr(13), ",").Replace(chr(10), ","))
'End If
'If r.IsNull("测试组长邮箱") = False Then
'm.AddReceiver(r("测试组长邮箱").Replace(vbcrlf, ",").Replace(chr(13), ",").Replace(chr(10), ","))
'End If
'm.Title = "博达BUG综合管理系统= = = =" & "BUG编号:" & r("BUG_ID") & "-----此BUG已修正,请测试人员" & r("提交人") & "(" & r("测试分机号") & ")" & "尽快验证." & "研发" & r("模块维护人") & "期待你的验证结果!"
'm.C & r("BUG_ID") & vbcrlf & "测试机型:" & r("测试机型") & vbcrlf & "出错模块:" & r("出错模块") & vbcrlf & "出错原因:" & r("出错原因") & vbcrlf & "解决模块:" & r("解决模块") & vbcrlf & "模块版本:" & r("模块版本") & vbcrlf & "解决版本:" & r("解决版本") & vbcrlf & "更新标题:" & r("更新标题") & vbcrlf & "具体修改:" & r("具体修改") & vbcrlf & "测试建议:" & r("测试建议")
'm.Send
'Forms("发送mail").close
r("已保存") = True
r("已提交") = True
r("状态") = "已更新"
r.save
Dim wd As WinForm.Form = Forms("BUG研发查询修改系统")
If wd.opened = True Then
Dim Page As WinForm.TopicPage
Dim cnt1 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '待解决' and 模块维护人邮箱 = '" & user.name & "'")
Dim cnt2 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '已更新' and 模块维护人邮箱 = '" & user.name & "'")
Dim cnt3 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '已解决' and 模块维护人邮箱 = '" & user.name & "'")
Dim cnt4 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","状态 = '未解决' and 模块维护人邮箱 = '" & user.name & "'")
Dim cnt5 As Integer = DataTables("BUG研发表").SQLCompute("Count(BUG_ID)","模块维护人邮箱 = '" & user.name & "'")
page = Forms("BUG研发查询修改系统").Controls("TopicBar1").Pages.Add("BUG状态分类统计","BUG状态分类统计")
Page.Links.Add("待解决BUG","待解决BUG(" & cnt1 & ")" )
Page.Links.Add("已更新BUG","已更新BUG(" & cnt2 & ")" )
Page.Links.Add("已解决BUG","已解决BUG(" & cnt3 & ")" )
Page.Links.Add("未解决BUG","未解决BUG(" & cnt4 & ")" )
Page.Links.Add("所有的BUG","所有的BUG(" & cnt5 & ")" )
End If
r.Locked = True
For Each cdr As DataRow In DataTables("BUG录入表").Select("BUG_ID = '" & r("BUG_ID") & "'")
cdr("状态") = r("状态")
Next
MessageBox.show("BUG编号:" & r("BUG_ID") & "此BUG已修正信息mail通知了测试提交人员" & r("提交人") & ",请耐心等待验证结果!","博达BUG综合管理系统")
Forms("BUG解决明细").close
Forms("BUG查询系统").Close
End If
End If
DataTables("BUG研发表").save