Dim d As String = e.Form.Controls("ComboBox1").Value
Dim t As String = e.Form.Controls("label1").text
If t <> "Label1" Then
If d IsNot Nothing Then
If DataTables("mframe").find("[mid] = '" & t & "' and [period] = '" & d & "'") Is Nothing Then
Dim Cols1() As String = {"mid","mname","fruit","work","property","inteformula","checkcycle","mnumber","isuse","iskey","unit","gobest","isupdate","order"}
Dim Cols2() As String = {"mid","mname","fruit","work","property","inteformula","checkcycle","mnumber","isuse","iskey","unit","gobest","isupdate","order"}
Dim lst1 As New List(of DataRow)
Dim lst2 As New List(of DataRow)
Tables("mframe").sort = "order"
For Each dr As DataRow In DataTables("mframe").DataRows
If DataTables("mframe").Find("[mid] = '" & t & "'and [lage] = 1 ") IsNot Nothing Then
lst1.Add(dr)
Dim dr2 As DataRow = DataTables("mframe").AddNew()
lst2.Add(dr2)
End If
Next
For Each dr As DataRow In lst2
For i As Integer = 0 To Cols1.Length -1
lst2(Cols2(i)) = lst1(Cols1(i))
Next
dr("period") = d
Next
MessageBox.Show("'" & d & "'克隆成功!")
Else
MessageBox.Show("此时期已存在,无法重复生产!如克隆力龄,请单击下方按钮!")
End If
Else
MessageBox.Show("请选择所属时期!")
End If
Else
MessageBox.Show("请选择所属岗位!")
End If