Dim dw As String = e.Form.Controls("入库单位").Value
Dim kw As String = e.Form.Controls("入库区域").Value
If dw IsNot Nothing Then
For Each r As Row In Tables("条码批量入库_Table1").Rows
Dim ar As Row = Tables("T_SampleList").addnew
ar("样品编号") = r("样品编号")
If e.Form.Controls("CheckBox1").Checked = False Then
ar("单位代码经手人") = e.Form.Controls("单位代码经").Value
ar("经手人") = e.Form.Controls("经手人姓名").Value
If e.Form.Controls("单位经").Value = Nothing Then
ar("转出单位") = e.Form.Controls("部门经").Value
ar("转出库位") = e.Form.Controls("部门经").Value
Else
ar("转出单位") = e.Form.Controls("单位经").Value
ar("转出库位") = e.Form.Controls("单位经").Value
End If
Else
ar("转出单位") = "客服部"
ar("转出库位") = "客服部"
Dim fr As DataRow = DataTables("T_Report").SQLFind("报告编号 = '" & r("样品编号") & "'")
If fr IsNot Nothing Then
ar("经手人") = fr("客服人员")
End If
End If
ar("当前保管人") = e.Form.Controls("保管人姓名").Value
ar("当前单位") = e.Form.Controls("单位保").value
ar("日期") = e.Form.Controls("DateTimePicker1").Value
ar("备注") = "入库"
ar("当前库位") = dw
ar("单位代码保管人") = e.Form.Controls("单位代码保").Value
Dim nr As DataRow = DataTables("T_Sample").SQLFind("报告编号 = '" & r("样品编号") & "'")
If nr IsNot Nothing Then
nr(kw) = dw
nr("入库登记日期") = Date.Today
nr.save
Else
Dim dr As DataRow = DataTables("T_Report").SQLFind("报告编号 = '"& r("样品编号") &"'")
Dim Lr As DataRow = DataTables("T_Sample").addnew
Lr("报告编号") = dr("报告编号")
Lr("样品名称") = dr("样品名称")
Lr("样品编号") = dr("样品编号")
Lr("待处理区") = True
Lr("送样日期") = dr("收样日期")
Lr("客服人员") = dr("客服人员")
Lr("区域") = dr("区域")
Lr("是否抽检") = dr("是否抽检")
Lr("存储方式") = dr("储存条件")
Lr("预计销毁日期") = dr("预计销毁日期")
Lr(kw) = dw
Lr("入库登记日期") = Date.Today
Lr.save
End If
ar.Save
Next
Else
MessageBox.Show("入库单位不能为空,请填写之后再操作,谢谢","温馨提示")
Return
End If
e.Form.close