admin 管理员组

文章数量: 887021


2023年12月18日发(作者:html网站视频下载)

1. 考勤记录查询

Imports System

Imports

Imports

Partial Class addkaoqin

Inherits

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As rgs)

Handles

Dim conn As SqlConnection

Dim constr As String

constr = "server = localhost;database = user;uid=sa;pwd=4302816"

conn = New SqlConnection(constr)

()

Dim sql As String = "select * from user where ttime='" + +

"'"

Dim cmd As New SqlCommand(sql, conn)

Dim dr As SqlDataReader = eReader()

If () = True Then

("时间不对!")

Else

Dim count As Integer

e()

Dim sql1 As String = "insert into user(员工ID,名字,考勤时间,考勤类型)

values ('" & & "','" &

& "','" & & "','" & & "')"

Dim cmd1 As New SqlCommand(sql1, conn)

count = eNonQuery()

If count = 1 Then

("考勤记录添加成功!")

Else

("考勤记录添加失败!")

End If

End If

()

End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As rgs)

Handles

End Sub

Protected Sub Button3_Click(ByVal sender As Object, ByVal e As rgs)

Handles

Command = "select * from kaoqin where 员工ID='" +

+ "' or 姓名='" + + "' or 考勤时间='" +

+ "' or 考勤类别='" + + "'"

End Sub

Protected Sub GridView1_PageIndexChanging(ByVal sender As Object, ByVal e As

ewPageEventArgs) Handles

dexChanging

dex = eIndex

nd()

End Sub

End Class

2. 工资管理界面代码

Imports System

Imports

Imports

Partial Class gongzi

Inherits

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As rgs)

Handles

Dim conn As SqlConnection

Dim constr As String

constr = "server = QT-;database = user;uid=sa;pwd=4302816"

conn = New SqlConnection(constr)

()

Dim sql As String = "select * from gongzi where 姓?名?='" +

+ "'"

Dim cmd As New SqlCommand(sql, conn)

Dim dr As SqlDataReader = eReader()

If () = True Then

("名字不对!")

Else

Dim count As Integer

e()

Dim sql1 As String = "insert into user(姓?名?,性?别Àe,工¡è资Á¨º)

values ('" & & "','" &

& "','" & & "')"

Dim cmd1 As New SqlCommand(sql1, conn)

count = eNonQuery()

If count = 1 Then

("工资添加成功!")

Else

("工资添加失败!")

End If

End If

()

End Sub

Protected Sub Button3_Click(ByVal sender As Object, ByVal e As rgs)

Handles

Command = "select * from gongzi where 姓名='" +

+ "'"

End Sub

Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e

As rgs) Handles edIndexChanged

End Sub

End Class

3. 管理员模块代码

Imports System

Imports

Imports

Partial Class adduser

Inherits

Protected Sub TextBox2_TextChanged(ByVal sender As Object, ByVal e As

rgs) Handles anged

End Sub

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As rgs)

Handles

If Session("TextBox1") = "" Then

ct("")

Else

Dim conn As SqlConnection

Dim constr As String

constr = "server = localhost;database = Admin;uid=sa;pwd=4302816"

conn = New SqlConnection(constr)

()

Dim sql As String = "select * from user where tid='" +

+ "'"

Dim cmd As New SqlCommand(sql, conn)

Dim dr As SqlDataReader = eReader()

If () = True Then

("此顾客已经存在!")

Else

Dim count As Integer

e()

Dim sql1 As String = "insert into user(员工ID,名字,性别,部门,联络 ) values ('" & & "','" &

& "','" & & "','" & & "','" &

& "')"

Dim cmd1 As New SqlCommand(sql1, conn)

count = eNonQuery()

If count = 1 Then

(顾客添加成功!")

Else

("顾客添加失败!")

End If

End If

()

End If

End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As rgs)

Handles

End Sub

End Class


本文标签: 考勤 添加 代码 名字