Foxtable(狐表)用户栏目专家坐堂 → [求助]窗口输入保存时部份字段内容未保存


  共有3275人关注过本帖树形打印复制链接

主题:[求助]窗口输入保存时部份字段内容未保存

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


加好友 发短信
等级:版主 帖子:5246 积分:33163 威望:0 精华:8 注册:2013/1/17 21:28:00
  发帖心情 Post By:2014/9/27 11:37:00 [显示全部帖子]

If DataTables("表A").HasChanges Then
    If Tables("表A").Rows.Count > 0  Then
        Dim Colnames As String() = {"第一列","第二列","第三列","第四列"}
        Dim Issave As Boolean = True
        For Each ColName As String In Colnames
            If Tables("表A").Current.IsNull(ColName) Then
                Issave = False
                MessageBox.Show("当前记录还未输入完成,请完成输入")
                Return

            End If
        Next
       
        ........
       
        If Issave Then
            If MessageBox.show("是否保存当前数据?","提示",MessageBoxButtons.YesNo) = DialogResult.Yes  Then
                For Each r As Row In Tables("表A").Rows
                    r.Locked = True
                Next
                DataTables("表A").Save()
            End If
        End If
       
    End If


 回到顶部
帅哥哟,离线,有人找我吗?
lsy
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:5246 积分:33163 威望:0 精华:8 注册:2013/1/17 21:28:00
  发帖心情 Post By:2014/9/27 12:02:00 [显示全部帖子]

If DataTables("生产记录表").HasChanges Then
    If Tables("生产记录表").Rows.Count > 0  Then
        Dim Colnames As String() = {"生产日期","班次","机台号","产品型号","产品批号","原料型号","原料批号"}
        For Each ColName As String In Colnames
            If Tables("生产记录表").Current.IsNull(ColName) Then
                MessageBox.Show("当前记录还未输入完成,请完成输入")
                Return
            End If
        Next
        Dim dr As Row = Tables("生产记录表").Current
        Dim STR As String = Tables("生产记录表").Current("产品型号")
        Dim Intq As Integer = 2
        Dim Int As Integer = dr("不良数量")
        Dim Intsum As Integer = dr("开调机数")+dr("样品数量")+dr("留样样品")+dr("茶色异物")+dr("黑色异物")+dr("气体划伤")+dr("溶合线")+dr("金属异物")+dr("气泡")+dr("油污")+dr("其它")
        Dim Intm As Integer = dr("机台模数")
        Dim Intc As  Double= (dr("良品数量")+dr("不良数量"))/Intq
        If Int <> Intsum Then
            MessageBox.Show("不良数量与相应的不良项目合计不一致,请确认!","警告",MessageBoxButtons.OK)
            Return
        Else
            If  Intm <> Intc Then
                MessageBox.Show("生产模数与良品数和不良数之和不一致,请确认!","警告",MessageBoxButtons.OK)
                Return
            End If
        End If
        If MessageBox.show("是否保存当前数据?","提示",MessageBoxButtons.YesNo) = DialogResult.Yes  Then
            For Each r As Row In Tables("生产记录表").Rows
                r.Locked = True
            Next
            DataTables("生产记录表").Save()
        End If
    End If
End If

 回到顶部