Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共77 条记录, 每页显示 10 条, 页签: [1][2] [3] [4][5][6][7][8]
[浏览完整版]

标题:窗口筛选树统计问题

21楼
jhxb8821 发表于:2023/10/19 9:31:00
Select Case e.Col.Name 
    Case ""日" & 1 To 31"
        If e.text = "×" Then
            e.Style = "旷工"
        Else If e.text = "√"
        e.Style = "出勤"
        Else If e.text = "△"
            e.Style = "事假" 
        End If 
End Select

老师,红色的怎么修改?
22楼
有点蓝 发表于:2023/10/19 9:41:00
case只能一个个来

Select Case e.Col.Name 
    Case "日1","日2",.......
23楼
有点蓝 发表于:2023/10/19 9:42:00
如果只有这些列是日字开头的使用if

if e.Col.Name like "日*" then
If e.text = "×" Then
……
24楼
jhxb8821 发表于:2023/10/19 10:42:00
Dim d As Date = e.Form.Controls("DateTimePicker1").Value
MessageBox.Show(d.year)
If d <> Nothing Then
    Dim lvw As WinForm.ListView = e.Form.Controls("ListView1")
    Dim int As Integer = 0
    For Each r As WinForm.ListViewRow In lvw.Rows
        If r.Checked = True Then
            int = int + 1
        End If
    Next
    If Int = 0 Then
        MessageBox.show("你并没有选择任何人!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
    Else
        Dim Result As DialogResult '对话框结果
        Result = MessageBox.Show("你本次到岗人数为: " & int & "人,缺勤人数为: " & int & " 人,确定考勤吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
        If Result = DialogResult.Yes Then
            For Each r As WinForm.ListViewRow In lvw.Rows
                Dim dr As DataRow = DataTables("月考勤统计A").Find("年='" & d.Year & "' And 月='" & d.Month & "' And 姓名='" & r.Text & "'")
                If dr Is Nothing Then
                    dr = DataTables("月考勤统计A").AddNew
                    dr("年") = d.Year
                    dr("月") = d.Month
                    dr("姓名") = r.Text
                End If
                '原代码
                '    If r.Checked = True Then
                '       dr("日" & d.Day) = "√"
                '    Else
                '       dr("日" & d.Day) = "×"
                '    End If
                '新代码 完全正确
                If r.Checked = True Then 
                    Dim dn As String = e.Form.Controls("ComboBox1").Value
                    If dn = "出勤√" Then
                        dr("日" & d.Day) = "√"
                    Else If dn = "病假△" Then
                    dr("日" & d.Day) = "△"
                    Else If dn = "事假☆" Then
                    dr("日" & d.Day) = "☆"
                    Else If dn = "旷工×" Then
                    dr("日" & d.Day) = "×"
                    Else If dn = "休息/" Then
                    dr("日" & d.Day) = "/" 
                    Else If dn = "其他○" Then
                        dr("日" & d.Day) = "○"
                    End If
                     DataTables("人员信息表A").DataRow("是否登记") = True
                End If 
            Next
            DataTables("月考勤统计A").Save
        End If
    End If
Else
    MessageBox.show("考勤日期不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
老师,这里需要赋值,请修改一下红色代码
25楼
有点蓝 发表于:2023/10/19 10:50:00
dr("是否登记") = True
26楼
jhxb8821 发表于:2023/10/19 10:56:00
蓝老师,不是在同一个表赋值
27楼
有点蓝 发表于:2023/10/19 11:01:00
给哪一行赋值?
28楼
jhxb8821 发表于:2023/10/19 11:10:00
   窗口ListView中:If r.Checked = True Then 
   那么,  "人员信息表A"的"是否登记"逻辑列 = True
29楼
有点蓝 发表于:2023/10/19 11:24:00
使用find查找到"人员信息表A"的"是否登记"逻辑列 = True的行再赋值
30楼
jhxb8821 发表于:2023/10/19 13:15:00

Dim lvw As WinForm.ListView = e.Form.Controls("ListView1")

For Each r As WinForm.ListViewRow In lvw.Rows

    r.Checked = True

Next


蓝老师,这是全选代码,我想要已选代码

共77 条记录, 每页显示 10 条, 页签: [1][2] [3] [4][5][6][7][8]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .04297 s, 2 queries.