Foxtable(狐表)用户栏目专家坐堂 → 实时刷新


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

主题:实时刷新

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


加好友 发短信
等级:八尾狐 帖子:1953 积分:15015 威望:0 精华:0 注册:2016/4/28 9:58:00
实时刷新  发帖心情 Post By:2017/10/3 22:27:00 [显示全部帖子]

Dim e As RequestEventArgs = args(0)
Dim wb As New WeUI
If e.PostValues.Count = 0 Then '分组统计设置
    wb.AddPageTitle("","pageheader","自测考试报名","请依次选填,入学年为学级")
    wb.AddForm("","form1","zcks.htm")
    With wb.AddInputGroup("form1","ipg1","")
        .AddSelect("学期","学       期","17秋|18春").attribute ="style='color:blue'"
        .AddSelect("xd","学       段","初中|小学").attribute ="style='color:blue'"
        .AddSelect("xj","学       级",DataTables("级").SQLGetComboListString("级")).attribute ="style='color:blue'"
        .AddSelect("bj","班       级",DataTables("班").SQLGetComboListString("班","","序")).attribute ="style='color:blue'"
        .AddSelect("km","科       目",DataTables("科目").SQLGetComboListString("科目")).attribute ="style='color:blue'"
        .AddInput("ksmc","考试名称","text").attribute ="style='color:blue'"
        Dim In1 =.addinput("rq","考试日期","date")
        In1.value=Date.Today
        In1.attribute ="style='color:blue'"
        With.AddInput("amf","A  卷满分","number")
        .Min = "0"
        .Max = "120"
        .Step="1"
        .value="100"
        .attribute ="style='color:blue'"
    End With
    With.AddInput("az","A  卷折率","number")
    .Min = "0"
    .Max = "1"
    .Step="0.01"
    .value="1"
    .attribute ="style='color:blue'"
End With
With.AddInput("bmf","B  卷满分","number")
.Min = "0"
.Max = "60"
.Step="1"
.value="0"
.attribute ="style='color:blue'"

End With
With.AddInput("bz","B  卷折率","number")
.Min = "0"
.Max = "1"
.Step="0.01"
.value="1"
.attribute ="style='color:blue'"
End With

End With
With wb.AddButtonGroup("form1","btg1",False)
    .Add("btn1", "确定", "submit")
    .add("btn1","上分", "submit","tf.htm")
    .Add("btn1", "返回","","jwzrdefault.htm")
End With

Else '显示统计结果
    Dim bjhc As String = trim(e.PostValues("xd") & e.PostValues("xj") & e.PostValues("bj"))
    wb.AppendCookie("xq",e.PostValues("学期"))
    wb.AppendCookie("bj",bjhc)
    wb.AppendCookie("km",e.PostValues("km"))
    wb.AppendCookie("ksmc",e.PostValues("ksmc"))
    wb.AddPageTitle("","pageheader","学生成绩表册",e.postvalues("学期") & ">" & bjhc & ">" & e.postvalues("km") & ">" & e.PostValues("ksmc"))
    ' wb.AddForm("","form1","")
    Dim dr As DataRow = DataTables("用户").sqlfind("身份证号 = '" & e.Cookies("username") & "'")
    Dim xss As List(Of DataRow)
    xss = DataTables("学生信息").sqlSelect("学校名称 = '" & dr("group") & "' And 班级 = '" & bjhc & "' and left(状态,2) ='在读'")
    For Each xs As DataRow In xss
        Dim pr As DataRow
        pr =DataTables("自测成绩").sqlfind("学期= '"& e.PostValues("学期") & "' and 学校名称 = '" & dr("group") & "' and 班级 = '" & bjhc & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 身份证号 = '" & xs("身份证件号") & "'")
        If pr Is Nothing
            pr = DataTables("自测成绩").addnew()
        End If
        pr("学校名称")= dr("group")
        pr("考试名称")= e.PostValues("ksmc")
        pr("科目") =e.PostValues("km")
        pr("班级") = xs("班级")
        pr("姓名")=xs("学生姓名")
        pr("身份证号")=xs("身份证件号")
        pr("学期") = e.PostValues("学期")
        pr("考试日期")= e.postvalues("rq")
        pr("A卷满分")=val(e.postvalues("amf"))
        pr("B卷满分")=val(e.postvalues("bmf"))
        pr("A卷折率")=val(e.postvalues("az"))
        pr("B卷折率")=val(e.postvalues("bz"))
        pr("教师身份证")= e.Cookies("username")
        pr.save()
    Next
    wb.AddToast("","t1", "正在上传",1) '定义提示
    wb.AddForm("","form1","cjsave.htm").attribute= """
    With wb.AddButtonGroup("form1","btg1", False)  '水平排列
        .Add("btn6", "保存","submit")
        .Add("btn7", "返回","button","tfsz.htm")'.Attribute = ""
    End With
    Dim xss1 As List(Of DataRow)  =DataTables("自测成绩").sqlselect("学期= '"& e.PostValues("学期") & "' And 班级 = '" & bjhc & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'","","总分 desc,姓名")
    wb.InsertHTML("form1", "<Table border=1 cellspacing=0 style='width:100%;text-align:center;'><tr><td style='text-align:center;font-size: 15pt;strong'>姓名</td><td style='text-align:center;font-size: 15pt'>A卷</td><td style='text-align:center;font-size: 15pt'>B卷</td><td style='text-align:center;font-size: 15pt'>总分</td></tr>")
    For Each xs1 As DataRow In xss1
        wb.insertHtml("form1", "<tr><td style='width:25%;font-size:15pt' >" & xs1("姓名") & "</td><td style='width:25%'><input style='width:95%;font-size: 15pt; border:none;text-align:center;' type='number' max= '" & xs1("A卷满分") & "'  min ='0' name='txt1_" & xs1("_Identify") & "' value='" & iif(xs1("A卷")>0, xs1("A卷"),"") & "' /></td><td style='width:25%'><input style='width:95%;font-size:15pt;border:none;text-align:center;' type= 'number' max= '" & xs1("B卷满分") & "'  name='txt2_" & xs1("_Identify") & "'  value='" & iif(xs1("B卷")>0,xs1("B卷"),"") & "' /></td><td style='width:25%;font-size:15pt' >" & xs1("总分") & "</td></tr>")
    Next
    Dim pja As Double = DataTables("自测成绩").SQLCompute("avg(A卷)","学期= '"& e.PostValues("学期") & "' And 班级 = '" & bjhc & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "' and 总分>0")
    Dim pjb As Double = DataTables("自测成绩").SQLCompute("avg(B卷)","学期= '"& e.PostValues("学期") & "' And 班级 = '" & bjhc & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'and 总分>0")
    Dim pjzf As Double = DataTables("自测成绩").SQLCompute("avg(总分)","学期= '"& e.PostValues("学期") & "' And 班级 = '" & bjhc & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'and 总分>0")
    wb.insertHtml("form1", "<tr><td style='width:25%;font-size:15pt' >平均分</td><td style='width:25%;font-size:15pt' >" & Format(pja,"0.00") & "</td><td style='width:25%;font-size:15pt' >" & Format(pjb,"0.00") & "</td><td style='width:25%;font-size:15pt' >" & Format(pjzf,"0.00") & "</td></tr>")
    wb.insertHtml("form1", "</Table>")
End If
e.WriteString(wb.Build)

 

 

 

Dim e As RequestEventArgs = args(0)
Dim wb As New WeUI
Dim bjhc As String = trim(e.PostValues("xd") & e.PostValues("xj") & e.PostValues("bj"))
wb.AddPageTitle("","pageheader","学生成绩保存")
wb.AddForm("","form1","")
Dim dr As DataRow = DataTables("用户").sqlfind("身份证号 = '" & e.Cookies("username") & "'")
For Each key As String In e.Values.Keys
  Dim jlh As String = key.split("_")(1)
    Dim fdr As DataRow = DataTables("自测成绩").sqlfind("_Identify = '" & jlh & "'")
    fdr("A卷") = val(e.values("txt1_" & jlh))
    fdr("B卷") = val(e.values("txt2_" & jlh))
    fdr("总分")= val(e.values("txt1_" & jlh)) +val(e.values("txt2_" & jlh))
    fdr.save()
Next
With wb.AddButtonGroup("form1","btg1", False)  '水平排列
    .Add("btn6", "保存","submit")
    .Add("btn7", "返回","button").Attribute = ""
End With
wb.AppendHTML("<script src='./lib/order.js'></script>")
e.WriteString(wb.Build)

 

 

老师,你好,上面代码经过测试终于基本达到我想要的结果,现在有一个问题:用这个方式传给cjsave.htm保存,返回后表格数据中的总分以及表尾的平均分不刷新,我想上传数据后立即在zcks.htm中刷新上传后的结果,并可继续录入成绩,这该怎么修改。谢谢


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


加好友 发短信
等级:八尾狐 帖子:1953 积分:15015 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2017/10/4 10:48:00 [显示全部帖子]

请老师帮看一下


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


加好友 发短信
等级:八尾狐 帖子:1953 积分:15015 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2017/10/4 14:15:00 [显示全部帖子]

这个我知道,我现在就是想如何改进实现,保存后就能重新生成网页,而不用返回


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


加好友 发短信
等级:八尾狐 帖子:1953 积分:15015 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2017/10/6 9:46:00 [显示全部帖子]

录分设置:

Dim e As RequestEventArgs = args(0)
Dim wb As New WeUI
wb.AddPageTitle("","pageheader","自测考试录入","请依次选填")
wb.AddForm("","form1","cjbiao.htm")
With wb.AddInputGroup("form1","ipg1","")
    .AddSelect("学期","学期",DataTables("自测成绩").SQLGetComboListString("学期","教师身份证= '" & e.Cookies("username") & "'","考试日期 desc"))
    .AddSelect("bj","班级",DataTables("自测成绩").SQLGetComboListString("班级","教师身份证= '" & e.Cookies("username") & "'","考试日期 desc"))
    .AddSelect("km","科目",DataTables("自测成绩").SQLGetComboListString("科目","教师身份证= '" & e.Cookies("username") & "'","考试日期 desc"))
    .Addselect("ksmc","考试名称",DataTables("自测成绩").SQLGetComboListString("考试名称","教师身份证= '" & e.Cookies("username") & "'","考试日期 desc"))
End With
With wb.AddButtonGroup("form1","btg1",False)
    .Add("btn1", "确定", "submit")
    .Add("btn1", "返回","","jwzrdefault.htm")
End With
e.WriteString(wb.Build)

 

 

录分表、统计表

Dim e As RequestEventArgs = args(0)
Dim wb As New WeUI

wb.AddPageTitle("","pageheader","学生成绩表册",e.postvalues("学期") & ">" & e.postvalues("bj") & ">" & e.postvalues("km") & ">" & e.PostValues("ksmc"))
wb.AddToast("","t1", "正在上传",1) '定义提示
wb.AddForm("","form1","cjsave.htm").attribute= """
With wb.AddButtonGroup("form1","btg1", False)  '水平排列
    .Add("btn6", "保存","submit")
    .Add("btn7", "返回","button","tfsz.htm")'.Attribute = ""
End With
Dim dr As DataRow = DataTables("用户").sqlfind("身份证号 = '" & e.Cookies("username") & "'")
Dim bjf As DataRow =DataTables("自测成绩").sqlfind("学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'")

If bjf IsNot Nothing
If bjf("B卷满分")>0
    Dim xss As List(Of DataRow)  =DataTables("自测成绩").sqlselect("学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'","","折总 desc,姓名")
    For n As Integer = 0 To xss.Count - 1 '遍历所有行
        If n > 0 AndAlso xss(n)("折总") = xss(n-1)("折总") Then '如果总分和上一行相同
            xss(n)("折序") = xss(n-1)("折序") '则排名等于上一行
        Else
            xss(n)("折序") = n + 1 '设置排名
        End If
    Next
    wb.InsertHTML("form1", "<Table border=1 cellspacing=0 style='width:100%;text-align:center;'><tr><td style='text-align:center;font-size: 15pt;strong'>姓名</td><td style='text-align:center;font-size: 15pt'>A卷</td><td style='text-align:center;font-size: 15pt'>B卷</td><td style='text-align:center;font-size: 15pt'>折总</td><td style='text-align:center;font-size: 15pt'>折序</td></tr>")
    For Each xs As DataRow In xss
        wb.insertHtml("form1", "<tr><td style='width:20%;font-size:15pt' >" & xs("姓名") & "</td><td style='width:20%'><input style='width:95%;font-size: 15pt; border:none;text-align:center;' type='number'  name='txt1_" & xs("_Identify") & "' max= '" & xs("A卷满分") & "'  min ='0' value='" & iif(xs("A卷")>0, xs("A卷"),"") & "' /></td><td style='width:20%'><input style='width:95%;font-size:15pt;border:none;text-align:center;' type= 'number'  name='txt2_" & xs("_Identify") & "' max= '" & xs("B卷满分") & "'  min ='0' value='" & iif(xs("B卷")>0,xs("B卷"),"") & "' /></td><td style='width:20%;font-size:15pt' >" & iif(xs("折总")>0, xs("折总"),"") & "</td></td><td style='width:20%;font-size:15pt' >" & iif(xs("折序")>0, xs("折序"),"") & "</td></tr>")
    Next
    Dim pja As Double = DataTables("自测成绩").SQLCompute("avg(A卷)","学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "' and 总分>0")
    Dim pjb As Double = DataTables("自测成绩").SQLCompute("avg(B卷)","学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'and 总分>0")
    Dim pjzf As Double = DataTables("自测成绩").SQLCompute("avg(折总)","学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'and 总分>0")
    wb.insertHtml("form1", "<tr><td style='width:20%;font-size:15pt' >平均分</td><td style='width:20%;font-size:15pt' >" & Format(pja,"0.00") & "</td><td style='width:20%;font-size:15pt' >" & Format(pjb,"0.00") & "</td><td style='width:20%;font-size:15pt' >" & Format(pjzf,"0.00") & "</td></td><td style='width:20%;font-size:15pt' ></td></tr>")
    wb.insertHtml("form1", "</Table>")
Else
    Dim xss As List(Of DataRow)  =DataTables("自测成绩").sqlselect("学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'","","总分 desc,姓名")
    For n As Integer = 0 To xss.Count - 1 '遍历所有行
        If n > 0 AndAlso xss(n)("总分") = xss(n-1)("总分") Then '如果总分和上一行相同
            xss(n)("总序") = xss(n-1)("总序") '则排名等于上一行
        Else
            xss(n)("总序") = n + 1 '设置排名
        End If
    Next
    wb.InsertHTML("form1", "<Table border=1 cellspacing=0 style='width:100%;text-align:center;'><tr><td style='text-align:center;font-size: 15pt;strong'>姓名</td><td style='text-align:center;font-size: 15pt'>A卷</td><td style='text-align:center;font-size: 15pt'>总分</td><td style='text-align:center;font-size: 15pt'>总序</td></tr>")
    For Each xs As DataRow In xss
        wb.insertHtml("form1", "<tr><td style='width:20%;font-size:15pt' >" & xs("姓名") & "</td><td style='width:20%'><input style='width:95%;font-size: 15pt; border:none;text-align:center;' type='number'  name='txt1_" & xs("_Identify") & "' max= '" & xs("A卷满分") & "'  min ='0' value='" & iif(xs("A卷")>0, xs("A卷"),"") & "' /><td style='width:20%;font-size:15pt' >" & iif(xs("总分")>0, xs("总分"),"") & "</td></td><td style='width:20%;font-size:15pt'>" & iif(xs("总序")>0, xs("总序"),"") & "</td></tr>")
    Next
    Dim pja As Double = DataTables("自测成绩").SQLCompute("avg(A卷)","学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "' and 折总>0")
    ''Dim pjb As Double = DataTables("自测成绩").SQLCompute("avg(B卷)","学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'and 折总>0")
    Dim pjzf As Double = DataTables("自测成绩").SQLCompute("avg(折总)","学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'and 折总>0")
    wb.insertHtml("form1", "<tr><td style='width:25%;font-size:15pt' >平均分</td><td style='width:25%;font-size:15pt' >" & Format(pja,"0.00") & "</td><td style='width:25%;font-size:15pt' >" & Format(pjzf,"0.00") & "</td></td></td><td style='width:25%;font-size:15pt' ></td></tr>")
    wb.insertHtml("form1", "</Table>")
End If
End If
e.WriteString(wb.Build)

 

 

录分保存

Dim e As RequestEventArgs = args(0)
Dim wb As New WeUI
Dim bjhc As String = trim(e.PostValues("xd") & e.PostValues("xj") & e.PostValues("bj"))
wb.AddPageTitle("","pageheader","学生成绩保存")
wb.AddForm("","form1","")
Dim dr As DataRow = DataTables("用户").sqlfind("身份证号 = '" & e.Cookies("username") & "'")
For Each key As String In e.Values.Keys
  Dim jlh As String = key.split("_")(1)
    Dim fdr As DataRow = DataTables("自测成绩").sqlfind("_Identify = '" & jlh & "'")
    fdr("A卷") = val(e.values("txt1_" & jlh))
    fdr("B卷") = val(e.values("txt2_" & jlh))
    fdr("折总")=val(e.values("txt1_" & jlh))*val(fdr("A卷折率"))+ val(e.values("txt2_" & jlh))*val(fdr("B卷折率"))
    fdr("总分")= val(e.values("txt1_" & jlh)) +val(e.values("txt2_" & jlh))
    fdr.save()
Next
With wb.AddButtonGroup("form1","btg1", False)  '水平排列
    .Add("btn6", "保存","submit")
    .Add("btn7", "返回","button").Attribute = ""
End With
wb.AppendHTML("<script src='./lib/order.js'></script>")
e.WriteString(wb.Build)

 

请问老师,上面三个代码如何save这一段并在第二段中实现保存后刷新cjbiao,这样可保存后就刷新统计数据并继续录入,谢谢


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


加好友 发短信
等级:八尾狐 帖子:1953 积分:15015 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2017/10/6 12:55:00 [显示全部帖子]

老师,看了没懂起,js不懂,请帮忙写下示范,谢谢


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


加好友 发短信
等级:八尾狐 帖子:1953 积分:15015 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2017/10/6 18:43:00 [显示全部帖子]

 

cjbiao.htm

Dim e As RequestEventArgs = args(0)
Dim wb As New WeUI

wb.AddPageTitle("","pageheader","学生成绩表册",e.postvalues("学期") & ">" & e.postvalues("bj") & ">" & e.postvalues("km") & ">" & e.PostValues("ksmc"))
wb.AddToast("","t1", "正在上传",1) '定义提示
wb.AddForm("","form1","cjsave.htm")'.attribute= """
With wb.AddButtonGroup("form1","btg1", False)  '水平排列
    .Add("btn6", "保存","submit")'.Attribute= ""
    .Add("btn6", "统计","button").Attribute=""
    .Add("btn7", "返回","button","tfsz.htm")'.Attribute = ""
End With
With wb.AddDialog("","dlg1", "提示","保存成功,是否继续录入") '增加订单成功提示框
    .AddButton("btnYes","是").Attribute = ""
    .AddButton("btnNo","否").Kind = 1
End With
With wb.AddDialog("","dlg2", "错误","") '增加订单失败提示框
    .AddButton("btnOK","确定")
End With
Dim dr As DataRow = DataTables("用户").sqlfind("身份证号 = '" & e.Cookies("username") & "'")
Dim bjf As DataRow =DataTables("自测成绩").sqlfind("学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'")
If bjf IsNot Nothing
    If bjf("B卷满分")>0
        Dim xss As List(Of DataRow)  =DataTables("自测成绩").sqlselect("学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'","","折总 desc,姓名")
        For n As Integer = 0 To xss.Count - 1 '遍历所有行
            If n > 0 AndAlso xss(n)("折总") = xss(n-1)("折总") Then '如果总分和上一行相同
                xss(n)("折序") = xss(n-1)("折序") '则排名等于上一行
            Else
                xss(n)("折序") = n + 1 '设置排名
            End If
        Next
        wb.InsertHTML("form1", "<Table border=1 cellspacing=0 style='width:100%;text-align:center;'><tr><td style='text-align:center;font-size: 15pt;strong'>姓名</td><td style='text-align:center;font-size: 15pt'>A卷</td><td style='text-align:center;font-size: 15pt'>B卷</td><td style='text-align:center;font-size: 15pt'>折总</td><td style='text-align:center;font-size: 15pt'>折序</td></tr>")
        For Each xs As DataRow In xss
            wb.insertHtml("form1", "<tr><td style='width:20%;font-size:15pt' >" & xs("姓名") & "</td><td style='width:20%'><input style='width:95%;font-size: 15pt; border:none;text-align:center;' type='number'  name='txt1_" & xs("_Identify") & "' max= '" & xs("A卷满分") & "'  min ='0' value='" & iif(xs("A卷")>0, xs("A卷"),"") & "' /></td><td style='width:20%'><input style='width:95%;font-size:15pt;border:none;text-align:center;' type= 'number'  name='txt2_" & xs("_Identify") & "' max= '" & xs("B卷满分") & "'  min ='0' value='" & iif(xs("B卷")>0,xs("B卷"),"") & "' /></td><td style='width:20%;font-size:15pt' >" & iif(xs("折总")>0, xs("折总"),"") & "</td></td><td style='width:20%;font-size:15pt' >" & iif(xs("折序")>0, xs("折序"),"") & "</td></tr>")
        Next
        Dim pja As Double = DataTables("自测成绩").SQLCompute("avg(A卷)","学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "' and 总分>0")
        Dim pjb As Double = DataTables("自测成绩").SQLCompute("avg(B卷)","学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'and 总分>0")
        Dim pjzf As Double = DataTables("自测成绩").SQLCompute("avg(折总)","学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'and 总分>0")
        wb.insertHtml("form1", "<tr><td style='width:20%;font-size:15pt' >平均分</td><td style='width:20%;font-size:15pt' >" & Format(pja,"0.00") & "</td><td style='width:20%;font-size:15pt' >" & Format(pjb,"0.00") & "</td><td style='width:20%;font-size:15pt' >" & Format(pjzf,"0.00") & "</td></td><td style='width:20%;font-size:15pt' ></td></tr>")
        wb.insertHtml("form1", "</Table>")
    Else
        Dim xss As List(Of DataRow)  =DataTables("自测成绩").sqlselect("学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'","","总分 desc,姓名")
        For n As Integer = 0 To xss.Count - 1 '遍历所有行
            If n > 0 AndAlso xss(n)("总分") = xss(n-1)("总分") Then '如果总分和上一行相同
                xss(n)("总序") = xss(n-1)("总序") '则排名等于上一行
            Else
                xss(n)("总序") = n + 1 '设置排名
            End If
        Next
        wb.InsertHTML("form1", "<Table border=1 cellspacing=0 style='width:100%;text-align:center;'><tr><td style='text-align:center;font-size: 15pt;strong'>姓名</td><td style='text-align:center;font-size: 15pt'>A卷</td><td style='text-align:center;font-size: 15pt'>总分</td><td style='text-align:center;font-size: 15pt'>总序</td></tr>")
        For Each xs As DataRow In xss
            wb.insertHtml("form1", "<tr><td style='width:20%;font-size:15pt' >" & xs("姓名") & "</td><td style='width:20%'><input style='width:95%;font-size: 15pt; border:none;text-align:center;' type='number'  name='txt1_" & xs("_Identify") & "' max= '" & xs("A卷满分") & "'  min ='0' value='" & iif(xs("A卷")>0, xs("A卷"),"") & "' /><td style='width:20%;font-size:15pt' >" & iif(xs("总分")>0, xs("总分"),"") & "</td></td><td style='width:20%;font-size:15pt'>" & iif(xs("总序")>0, xs("总序"),"") & "</td></tr>")
        Next
        Dim pja As Double = DataTables("自测成绩").SQLCompute("avg(A卷)","学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "' and 折总>0")
        ''Dim pjb As Double = DataTables("自测成绩").SQLCompute("avg(B卷)","学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'and 折总>0")
        Dim pjzf As Double = DataTables("自测成绩").SQLCompute("avg(折总)","学期= '"& e.PostValues("学期") & "' And 班级 = '" & e.postvalues("bj") & "' And 考试名称 ='" & e.PostValues("ksmc") & "' and 科目 = '" & e.PostValues("km") & "' and 教师身份证 = '" & e.Cookies("username") & "'and 折总>0")
        wb.insertHtml("form1", "<tr><td style='width:25%;font-size:15pt' >平均分</td><td style='width:25%;font-size:15pt' >" & Format(pja,"0.00") & "</td><td style='width:25%;font-size:15pt' >" & Format(pjzf,"0.00") & "</td></td></td><td style='width:25%;font-size:15pt' ></td></tr>")
        wb.insertHtml("form1", "</Table>")
    End If
End If
wb.AppendHTML("<script src='./lib/ajaxform.js'></script>")
e.WriteString(wb.Build)

 

 

cjsave.htm

 

Dim e As RequestEventArgs = args(0)
Dim wb As New WeUI
Dim bjhc As String = trim(e.PostValues("xd") & e.PostValues("xj") & e.PostValues("bj"))
wb.AddPageTitle("","pageheader","学生成绩保存")
wb.AddForm("","form1","")
Dim dr As DataRow = DataTables("用户").sqlfind("身份证号 = '" & e.Cookies("username") & "'")
For Each key As String In e.Values.Keys
  Dim jlh As String = key.split("_")(1)
    Dim fdr As DataRow = DataTables("自测成绩").sqlfind("_Identify = '" & jlh & "'")
    fdr("A卷") = val(e.values("txt1_" & jlh))
    fdr("B卷") = val(e.values("txt2_" & jlh))
    fdr("折总")=val(e.values("txt1_" & jlh))*val(fdr("A卷折率"))+ val(e.values("txt2_" & jlh))*val(fdr("B卷折率"))
    fdr("总分")= val(e.values("txt1_" & jlh)) +val(e.values("txt2_" & jlh))
    fdr.save()
Next
With wb.AddButtonGroup("form1","btg1", False)  '水平排列
  ''  .Add("btn6", "保存","submit")
    .Add("btn7", "返回","button").Attribute = ""
End With
wb.AppendHTML("<script src='./lib/order.js'></script>")
e.WriteString(wb.Build)

 

老师你好,我按照你的指导做了测试还是不行呢,我就加了一个.Add("btn6", "统计","button").Attribute="",用来保存后手动返回cjbiao再手动刷新成绩表,这样就多了两个步骤,还是想只要保存后就恻刷新,就问如何改,js写了也不行呢。请老师帮指导,谢谢

 

 


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


加好友 发短信
等级:八尾狐 帖子:1953 积分:15015 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2017/10/6 18:44:00 [显示全部帖子]


 .Add("btn6", "统计","button").Attribute=""

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


加好友 发短信
等级:八尾狐 帖子:1953 积分:15015 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2017/10/6 18:44:00 [显示全部帖子]


 [.Add("btn6", "统计","button").Attribute=""]

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


加好友 发短信
等级:八尾狐 帖子:1953 积分:15015 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2017/10/6 18:45:00 [显示全部帖子]


 .Add("btn6", "统计","button").Attribute=""

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


加好友 发短信
等级:八尾狐 帖子:1953 积分:15015 威望:0 精华:0 注册:2016/4/28 9:58:00
  发帖心情 Post By:2017/10/6 18:45:00 [显示全部帖子]

location.reload

 回到顶部
总数 11 1 2 下一页