有点蓝老师还是不对?如何修改下面这段代码?
Dim dr As DataRow = e.DataRow
Select e.DataCol.Name
Case "工程名称"
If dr.IsNull("工程名称") = False AndAlso dr.IsNull("会议名称") = False Then
Dim opath As String = ProjectPath & "Attachments\用户工程\" & e.oldvalue & "\" & dr("会议名称")
Dim npath As String = ProjectPath & "Attachments\用户工程\" & e.newvalue & "\" & dr("会议名称")
If FileSys.DirectoryExists(opath) = False Then '如果目录不存在
FileSys.CreateDirectory(npath) '创建目录
Else
FileSys.RenameDirectory(opath,npath)
End If
Else
MessageBox.Show("工程名称及会议名称不能为空!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.Cancel = True
End If
Case "会议名称"
If dr.IsNull("工程名称") = False AndAlso dr.IsNull("会议名称") = False Then
Dim opath As String = ProjectPath & "Attachments\用户工程\" & dr("工程名称") & "\" & e.OldValue
Dim npath As String = ProjectPath & "Attachments\用户工程\" & dr("工程名称") & "\" & e.NewValue
If FileSys.DirectoryExists(opath) = False Then '如果目录不存在
FileSys.CreateDirectory(npath) '创建目录
Else
FileSys.RenameDirectory(opath,npath)
End If
Else
MessageBox.Show("工程名称及会议名称不能为空!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.Cancel = True
End If
End Select
此主题相关图片如下:99.png

[此贴子已经被作者于2018/4/9 23:47:34编辑过]