以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 定时关闭 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=100899) |
-- 作者:刘林 -- 发布时间:2017/5/20 14:22:00 -- 定时关闭 timetick Dim c2 As String = e.Form.Controls("combobox2").text Dim dr As DataRow = DataTables("小学考试名称").sqlFind("考试名称 = \'" & c2 & "\'") If dr IsNot Nothing If dr("上分锁定") = True \'messagebox.show("请注意,该考试统分工作已结束,已不能再上分") e.Form.Close End If End If 如何做一个提示,如10秒钟后容窗口自动关闭。后台将小学考试名称的上分锁定=1时,打开了上分窗口的用户会自动关闭,如何设计这个提示和定时,这样用户更了解是什么情况。
|
-- 作者:有点蓝 -- 发布时间:2017/5/20 15:12:00 -- 窗口Afterload vars("tick") = 0 timetick if vars("tick") >= 10 then e.Form.Close return end if vars("tick") = vars("tick") +1 e.form.controls("Label1").Text =(10-vars("tick")) & "秒后窗口将关闭" \'窗口增加一个Label Dim c2 As String = e.Form.Controls("combobox2").text Dim dr As DataRow = DataTables("小学考试名称").sqlFind("考试名称 = \'" & c2 & "\'") If dr IsNot Nothing If dr("上分锁定") = True \'messagebox.show("请注意,该考试统分工作已结束,已不能再上分") e.Form.Close End If End If |
-- 作者:刘林 -- 发布时间:2017/5/20 15:35:00 -- dr("上分锁定")= true 才开始倒计时关闭,因为小学考试名称表是由上一级主管部门控制,现在这个是只要打开窗口,不管上分锁定没有都倒计时关闭 |
-- 作者:有点蓝 -- 发布时间:2017/5/20 15:50:00 -- 窗口Afterload
[此贴子已经被作者于2017/5/20 15:50:33编辑过]
|
-- 作者:刘林 -- 发布时间:2017/5/20 15:52:00 -- Dim c2 As String =e.sender.text If c2>"" Dim dt As DataTable = DataTables("成绩") Dim cmd As New SQLCommand cmd.connectionname = cmd.CommandText = "SE LE CT DISTINCT 考试名称,单位名称,学段 From {成绩} where 学段 = \'小学\' and 考试名称 in (Se lect 考试名称 From {小学考试名称} where 上分锁定 = 0 and 是否统一上分 = 1) And 单位名称 In (Sel ect 单位全称,所属片区 from {学校信息} where 所属片区 = \'" & lffp & "\'" dt = cmd.ExecuteReader() Dim cmb3 As WinForm.ComboBox = e.form.Controls("ComboBox3") cmb3.ComboList = dt.GetComboListString("单位名称") End If lffp="白合片区" 提示“白合片区“附近有错误 逻辑是:cmb3的下拉显示的单位只能是 成绩表中符合条件 学段=小学,考试名称符合小学考试名称.上分锁定=0 和是否统一上分=1 并且单位名称 =学校信息.单位全称且 学校信息.所属片区= lffp,请老师指教,谢谢 |
-- 作者:有点蓝 -- 发布时间:2017/5/20 15:56:00 -- .....And 单位名称 In (Sel ect 单位全称,所属片区 from {学校信息} where 所属片区 = \'" & lffp & "\')" |
-- 作者:刘林 -- 发布时间:2017/5/20 16:10:00 -- 提示:当没有用 EXISTS 引入子查询时,在选择列表中只能指定一个表达式。 上面错误是什么原因 另我外想到成绩表中考号的第2位有所属片区信息,用substring取是错了,sql取字符是怎么取? |
-- 作者:有点蓝 -- 发布时间:2017/5/20 16:20:00 -- .....And 单位名称 In (Sel ect 单位全称 from {学校信息} where 所属片区 = \'" & lffp & "\')" |
-- 作者:刘林 -- 发布时间:2017/5/20 16:34:00 -- cmd.CommandText = "SEL ECT DISTINCT 考试名称,单位名称,学段 From {成绩} where 学段 = \'小学\' and 考试名称 in (S elect 考试名称 From {小学考试名称} where 上分锁定 = 0 and 是否统一上分 = 1) And substring([考号],2,1) =\'4\'" 考号的第二位是片区代码,这样可以吗
|
-- 作者:有点蓝 -- 发布时间:2017/5/20 16:42:00 -- 没有问题,注意sql的substring的索引是从1开始的不是从0开始的就行了 |