第一段代码:
If e.DataCol.name="审核通过" Then
If e.DataRow("审核通过") AndAlso Forms("需求主体").Opened AndAlso Forms("需求主体").Controls("CheckBox1").Checked Then
If r.IsNull("邮件通知")
str &= "邮件通知,"
End If
If r.IsNull("研发邮箱") Then
str &= "研发邮箱"
End If
If str >""
MessageBox.show("请检查," & str.Trim(",") & "不能为空","博达软件管理系统",MessageBoxButtons.OK,MessageBoxIcon.Warning)
e.DataRow("审核通过") = "false"
End If
If r.IsNull("邮件通知") = False And r.IsNull("研发邮箱") = False Then
If MessageBox.show("请核实已审核的需求","博达软件管理系统",MessageBoxButtons.OKCancel,MessageBoxIcon.Question)=DialogResult.OK Then
Forms("发送mail").open
Dim m As New MailSender
m.Host = "mail.bdcom.com.cn"
m.Account = "version@bdcom.com.cn"
m.Password = "version"
m.From = "version@bdcom.com.cn"
m.To = 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
e.DataRow("审核通过时间") = Date.now
m.Title = "博达软件管理系统= = = = = = =" & "需求编号:" & r("需求编号") & "-----此需求已审核(处于紧急状态),请研发和测试尽快处理"
m.C & r("需求编号") & " 客户:" & r("客户") & " 博达机型:" & r("博达机型") & vbcrlf & "需求提交时间:" & r("需求提交时间") & " 审核通过时间:" & r("审核通过时间") & " 版本期望交期:" & r("期望交期") & vbcrlf & "show version:" & r("show_version") & vbcrlf & "需求描述:" & r("需求描述")
m.SendAsync()
Forms("发送mail").close
For Each cdr As DataRow In r.DataRow.GetChildRows("需求明细表")
cdr("状态") = "审核通过"
cdr("审核通过时间") = r("审核通过时间")
cdr("状态直白") = "需求审核通过"
Next
If r.DataRow.GetChildRows("临时版本跟踪表").Count = 0 Then
Dim dr As DataRow = DataTables("临时版本跟踪表").AddNew()
dr("需求编号") = r("需求编号")
End If
MessageBox.show("需求编号:" & r("需求编号") & "------>" & "此紧急需求已审核通过并mail通知了相关研发测试人员!","博达软件管理系统")
e.DataRow("log") = User.Name & " 于" & Date.Now & " 对" & e.DataRow("需求编号") & "勾选了" & "审核通过" & " _紧急" & e.DataRow("紧急")
Select Case e.DataCol.Name
Case "审核通过"
Tables("需求主表").Filter = "审核通过 = False And 审核不通过 = False"
End Select
Else
e.DataRow("审核通过") = False
End If
End If
End If
End If