showattenddetail.aspx.cs
来自「人事管理系统」· CS 代码 · 共 48 行
CS
48 行
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class Attendance_ShowAttendDetail : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
lblStartTime.Text = DateTime.Now.AddMonths(-1).Date.ToString();
lblEndTime.Text = DateTime.Now.AddDays(1).Date.ToString();
string strsql = "select * from 员工考勤表 where 员工编号='" + Request.QueryString["id"].ToString().Trim() + "' and 日期 >= '" + lblStartTime.Text.ToString() + "' and 日期 <= '" + lblEndTime.Text.ToString() + "'";
SqlDataReader dr;
SqlConnection conn = db.mysqll();
conn.Open();
SqlCommand cmd = new SqlCommand(strsql ,conn);
dr = cmd.ExecuteReader();
if (dr.Read())
{
lblName.Text = dr["员工姓名"].ToString();
dr.Close();
SqlDataAdapter da;
DataSet myds = new DataSet();
da = new SqlDataAdapter(strsql,conn);
da.Fill(myds, "考勤编号");
grdResult.DataSource = myds.Tables ["考勤编号"];
grdResult.DataBind();
}
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?