Foxtable(狐表)用户栏目专家坐堂 → 请问老师,我哪里设置错误了,为什么不显示相关内容~~


  共有8226人关注过本帖平板打印复制链接

主题:请问老师,我哪里设置错误了,为什么不显示相关内容~~

帅哥哟,离线,有人找我吗?
wealthwind
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:660 积分:3965 威望:0 精华:0 注册:2014/3/16 20:34:00
  发帖心情 Post By:2014/5/19 18:22:00 [只看该作者]

老师,这里有点问题额,新增在“个案任务提醒”的文件编号,与“个案申请”的文件编号,不统一,所以在提醒窗口中无法打开相应的窗口~~

 

其中“个案申请”的表的代码是

BeforeSaveDataRow

 


Dim dr As DataRow = e.DataRow
Dim pf As String
If dr.RowState <> DataRowState.Added Then '如果不是新增行
    Return '那么返回
ElseIf dr.IsNull("日期") Then '如果没有输入日期
    e.Cancel = True '取消保存此行
    MessageBox.Show("必须输入日期!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Return
Else
    pf = Format(dr("日期"),"yyMM") '否则获得编号的前缀,两位年,两位月
End If

'对任务栏表进行操作
Dim dt As DataTable = DataTables("个案任务提醒")
Dim msg As String
If e.DataRow.isnull("裁决")=False Then
    msg  = "已结案"
Else If e.DataRow.isnull("终审")=False Then
    msg = "待裁决"
Else If e.DataRow.isnull("批准") =False Then
    msg  = "待终审"
Else If e.DataRow.Isnull("审核") = False Then
    msg  = "待批准"
Else
    msg  = "待审核"
End If
dt.DeleteFor("文件名称='" & e.DataRow("文件名称") & "'")
Dim ndr As DataRow = dt.AddNew
ndr("编号") = e.DataRow("编号")
ndr("文件名称") = e.DataRow("文件名称")
ndr("状态") = msg
Dim us As String = ""
For Each user As UserInfo In users
    us &= user.Name & ","
Next
ndr("用户") = us.TrimEnd(",")
dt.Save

If dr.RowState = DataRowState.Added Then '如果不是新增行


Dim cmd1 As New SQLCommand
Dim cmd2 As New SQLCommand
Dim Key As Integer
Dim nm As String = e.DataTable.name
cmd1.C '设置数据源名称
cmd2.C
cmd1.commandText = "Select Count(*) From [编号] Where [前缀] = '" & pf & "' And 表名 = '" & nm & "'"
If cmd1.ExecuteScalar = 0 Then '如果编号表不存在前缀的行,那么增加一行
    cmd1.commandtext = "Insert Into 编号 (表名, 前缀, 顺序号) Values('" & nm & "','" & pf & "',1)"
    cmd1.ExecuteNonQuery
End If
cmd1.commandText = "Select [顺序号] From [编号] Where [前缀] = '" & pf & "' And 表名 = '" & nm & "'"
Do
    Key = cmd1.ExecuteScalar() '从后台获得顺序号
    cmd2.commandText = "Update [编号] Set [顺序号] = " & (Key + 1) & " Where [顺序号] = " & Key & " And [前缀] = '" & pf & "' And 表名 = '" & nm & "'"
    If cmd2.ExecuteNonQuery() > 0 Then '更新顺序号
        Exit Do '更新成功则退出循环
    End If
Loop
e.DataRow("编号") = pf & "-" & Format(Key,"0000")
End If

 

 

请问老师,哪里还未设置好呢??


此主题相关图片如下:360截图20140519182100250.jpg
按此在新窗口浏览图片

此主题相关图片如下:360截图20140519182112593.jpg
按此在新窗口浏览图片

 回到顶部
总数 90 1 2 3 4 5 6 7 8 9 下一页