以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  系统升级至最新版本后,经常出错  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=142599)

--  作者:whx007
--  发布时间:2019/11/1 5:59:00
--  系统升级至最新版本后,经常出错


图片点击可在新窗口打开查看此主题相关图片如下:qq截图20191031235403.png
图片点击可在新窗口打开查看

最近升级到最新版本系统后总是出错,如上图,在1,2输入完成信息后,再执行第三个的时候出现以下图示错误,发布前发布后都有此问题,未升级前无此问题,我不知道哪里出了问题请老师帮忙指点,谢谢!

图片点击可在新窗口打开查看此主题相关图片如下:qq截图20191031234859.png
图片点击可在新窗口打开查看

[此贴子已经被作者于2019/11/1 6:01:54编辑过]

--  作者:有点蓝
--  发布时间:2019/11/1 8:39:00
--  
这些控件都有什么事件?代码发上来看看
--  作者:whx007
--  发布时间:2019/11/1 15:05:00
--  

Model控件ValueChanged

Dim cpxh As String = e.Form.Controls("Dropbox2").value
If cpxh = "" Then
    Tables("库存表").Filter = ""
    e.Form.Controls("库存数量").Text ="未知"
Else
    Tables("库存表").Filter=" [产品型号] = \'" & cpxh & "\'"
    Dim r As Row = Tables("库存表").current
    If r Is Nothing Then
        e.Form.Controls("库存数量").Text = "未知"
    Else
        e.Form.Controls("库存数量").Text = r("实时库存_数量")
        If r("实时库存_数量") = 0 Then
            MessageBox.Show("Out of stock!", "Error")
        End If
    End If
End If

 

If cpxh = "" Then
    Tables("销售主界面_Table3").Filter = ""
    e.Form.Controls("未提数量").Text = "未知"
Else
    Tables("销售主界面_Table3").Filter = " [产品型号] = \'" & cpxh & "\'"
    Dim sum As Double = 0
    If Tables("销售主界面_Table3").Current Is Nothing Then
        e.Form.Controls("未提数量").Text = 0
    Else
        For Each r1 As Row In Tables("销售主界面_Table3").Rows
            sum + = r1("未提数量")
        Next
        e.Form.Controls("未提数量").Text = sum
    End If
End If

Dim dr As DataRow = DataTables("产品入库表").sqlfind("产品型号 = \'" & cpxh & "\'","日期 Desc")
Dim pbx As WinForm.PictureBox = e.Form.Controls("PictureBox1")
If dr Is Nothing Then
    e.Form.Controls("产品类别").Text ="未知"
    e.Form.Controls("产品规格").Text ="未知"
    e.Form.Controls("单价成本").Text ="未知"
    pbx.ImageFile = ""
ElseIf dr IsNot Nothing Then
    e.Form.Controls("产品类别").Text =dr("产品类别")
    e.Form.Controls("产品规格").text =dr("产品规格")
    e.Form.Controls("textbox5").text =dr("销售单价")
    e.Form.Controls("单价成本").Text =dr("单价成本")
    pbx.ImageFile =ProjectPath &  "Attachments\\" & dr("备注")
End If

 

Quantiyi控件TextChanged:

If e.Form.Controls("NumericComboBox2").Text IsNot Nothing Then
    e.Form.Controls("NumericComboBox1").Text = e.Form.Controls("NumericComboBox2").Text
End If

 

Quantiyi控件ValueChanged

If e.Form.Controls("库存数量").Text <> "未知" Then
    If e.Sender.Text = "" Then
        MessageBox.Show("The quantity cannot be empty,please enter!(数量不能为空,请输入!)", "Error message(错误提示)")
ElseIf e.Form.Controls("库存数量").Text - e.Sender.Text < 0 Then
        MessageBox.Show("The quantity of this product is not enough in stock!(该产品库存数量不足本次销售!)", "Error message(错误提示)")
    \'ElseIf e.Form.Controls("库存数量").Text - e.Form.Controls("未提数量").Text <= 0 Then
        \'MessageBox.Show("This product has not mention the number,and stock number of less than the sales!(该产品有未提数量,且库存数量不足本次销售!)", "Error message")
  End If
End If

 

Price控件是自动获得数据

[此贴子已经被作者于2019/11/1 15:05:54编辑过]

--  作者:有点蓝
--  发布时间:2019/11/1 15:18:00
--  
这些控件有没有绑定列?如果有绑定,看看:http://www.foxtable.com/webhelp/topics/2436.htm


--  作者:whx007
--  发布时间:2019/11/1 20:33:00
--  

只有最上面的两个控件是绑定列,即NO.和Date,但是这两个控件都没有事件代码。其他控件都没有绑定列


--  作者:有点蓝
--  发布时间:2019/11/1 20:35:00
--  
新建项目做个例子发上来看看
--  作者:whx007
--  发布时间:2019/11/2 4:33:00
--  

测试方法:

1.输入名称及电话

2.选择产品型号,价格自动获得

3.填入数量,在这一步不是每次都出现这个错误,多测试几个订单就会出错。

4.add order

5.add product

6.保存

[此贴子已经被作者于2019/11/8 14:46:02编辑过]

--  作者:有点蓝
--  发布时间:2019/11/2 9:11:00
--  
保存按钮
……
Dim khmc As WinForm.DropDownBox = e.Form.Controls("DropBox3")
Dim khdh As WinForm.DropDownBox = e.Form.Controls("DropBox1")
Dim zk As WinForm.TextBox = e.Form.Controls("textbox3")
Dim cpxh As WinForm.DropDownBox = e.Form.Controls("DropBox2")
Dim sl As WinForm.NumericComboBox = e.Form.Controls("NumericComboBox2")
Dim dj As WinForm.TextBox = e.Form.Controls("textbox5")
Dim sfje As WinForm.TextBox = e.Form.Controls("textbox9")
Dim ytsl As WinForm.NumericComboBox = e.Form.Controls("NumericComboBox1")
Dim bz As WinForm.TextBox = e.Form.Controls("textbox4")
Dim zffs As WinForm.ComboBox = e.Form.Controls("ComboBox1")
khmc.Text = ""
khdh.Text = ""
cpxh.Text = ""
sl.value = Nothing
dj.Text = ""
sfje.Text = ""
zk.Text = "0"
ytsl.value = Nothing
bz.Text = ""
zffs.Text = "Cash"
……

NumericComboBox处理空值的时候,使用value ,不要设置text

--  作者:whx007
--  发布时间:2019/11/4 15:46:00
--  

你好,蓝老师。按照你的改了以后,偶尔还是会有同样的问题,只是出错频率很小。今天出现一次了。还得麻烦你再帮忙看看,谢谢!

 

为什么以前的老版本不会有这个问题,现在还不能退回原来的低版本。

[此贴子已经被作者于2019/11/4 16:12:27编辑过]

--  作者:有点蓝
--  发布时间:2019/11/4 16:21:00
--  
那就在检查是不是还有其他地方有:某某控件.value = ""的用法,全部改为:某某控件.value = nothing