If e.DataCol.Name = "材料编码" Thendim dr as datarow = e.datatable.find("材料编码='" & e.newvalue & "'","[_Identify]")
Dim b45 As Integer = Date.Today.Year
Dim c45 As Integer = Date.Today.Month
Dim dc01 As New Date(b45, c45, 1)
Dim dc02 As New Date(b45, c45, Date.DaysInMonth(b45, c45)) '获取本月的最后一天
Dim y01 As Integer = Date.Today.Year
Dim m01 As Integer = Date.Today.Month
Dim dt01 As New Date(y01, m01, 1)
Dim dt02 As New Date(y01, m01, Date.DaysInMonth(y01, m01)) '获取本月的最后一天
Dim dr02 As DataRow = e.DataRow
Dim dt03 As DataTable =DataTables("出入库明细")
dr("进仓数量_毛坯来料") = dt03.SQLCompute("sum(入库数量)", "单据日期 >= '" & dt01 & "' and 单据日期 <= '" & dt02 & "' and 成品编码 = '" & e.newvalue & "' And 单据类型= '入库'")
End If