Dim e As RequestEventArgs = args(0)
Dim UserInfo As Win.YPD.UserInfo = args(1)
Dim wb As new weui
e.Resp '设置网页编码为gb2312
Dim cmd As new SQLCommand
Dim s_获取参数 As String = e.GetValues("cshd").Trim()
Dim s_获取参数值 As String = e.GetValues("cshdz")
dim s_唯一值 as string = e.GetValues("id")
Dim s_公式备注 As String
Dim s_sql As String
Dim dt As DataTable
Dim dt_gs As DataTable
Dim dt_xm As DataTable
messagebox.show(s_获取参数.Trim())
messagebox.show(e.GetValues("cshd").Trim())
SYS.CreateFoxConnection("工资核算系统")
cmd.C
cmd.CommandText = "s elect 项目名称,公式脚本,核算类型,是否停用 f rom 表a where 是否停用 = 0 and 项目名称 in(s elect name f rom syscolumns where id=OBJECT_ID('表B')) and ((s elect 公式脚本 f rom 表a where 项目名称='"& s_获取参数.Trim() &"') like '%'+项目名称+'%') "
messagebox.show(cmd.CommandText)
dt_gs = cmd.ExecuteReader
cmd.CommandText = "s elect 项目名称,公式脚本,核算类型,是否停用 f rom 表a where 是否停用 = 0 and 项目名称 in(s elect name f rom syscolumns where id=OBJECT_ID('表B')) order by _SortKey "
dt_xm = cmd.ExecuteReader
'核算公式组成
For Each dr_gs As DataRow In dt_gs.DataRows
s_sql &=dr_gs("项目名称") & ","
Next
'dim sss as string = s_sql.Trim(",")
messagebox.show(s_sql)
'问题出在这里
cmd.CommandText ="s elect "& s_sql.Trim(",") &" f rom 表B where 核算月份 =(S elect MAX(核算月份) f rom 表B) And 工号 = '" & UserInfo.UserID & "' and _Identify ='"& s_唯一值.Trim() &"' "
messagebox.show(4)
dt = cmd.ExecuteReader
messagebox.show(3)
Dim dr_xm As DataRow = dt_xm.find("项目名称 = '"& s_获取参数.Trim() &"' and 核算类型 = '核算公式' and 是否停用 = 0")
If dr_xm IsNot Nothing Then
s_公式备注 = dr_xm("公式脚本").Replace("IsNull(","").Replace(",0)","")
End If
messagebox.show(4)
'output.show(s_公式备注)
'第一步,添加多行文本框:显示基本技能工资构成明细
wb.AddForm("","form1","hsgsmx.htm")
With wb.AddInputGroup("form1","ipg2",s_获取参数.Trim()& ":" & s_获取参数值)
with .AddTextArea("hsgsmx",5)
.Placeholder = s_公式备注
.Readonly = True
End With
End With
messagebox.show(5)
Dim dr_cc As List(of DataRow) = dt_xm.Select("是否停用 = 0 and 核算类型 = '核算公式'")
Dim Names As new List(of String)
For Each dr1 As DataRow In dr_cc
Names.Add(dr1("项目名称"))
Next
messagebox.show(6)
With wb.AddListGroup("form1", "ipg3", s_获取参数.Trim()&"构成明细")
For Each dr As DataRow In dt.DataRows
Dim i As Integer
i+=1
For Each dc As DataCol In dt.DataCols
If Names.Contains(dc.name) = True Then
'messagebox.show(dc.name)
if dc.name <> s_获取参数 then
.Add(i,dc.name, dr(dc.name),"hsgsmx.htm?cshd="& dc.name &"&cshdz="&dr(dc.name)&"&id="&e.GetValues("id")&"").Badge = "详细"
end if
'output.show(dc.name & ":" & dr(dc.name))
Else
.Add(i,dc.name, dr(dc.name))
End If
Next
Next
End With
messagebox.show(7)
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "返回明细", "submit","gzyl.htm")
End With
e.WriteString(wb.Build) '生成网页