QueryCheckForm.cs
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
//文件名:QueryCheckForm.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using Microsoft.Office.Interop.Excel;
using System.Reflection;
using Microsoft.Office.Core;
namespace MyPersonnel
{
public partial class QueryCheckForm : Form
{
public QueryCheckForm()
{
InitializeComponent();
}
public string MyCompany;
private string My员工姓名;
private System.Data.DataTable MyQueryTable;
private void 查询个人年度考勤ToolStripButton_Click(object sender, EventArgs e)
{
String MySQLConnectionString = global::MyPersonnel.Properties.Settings.Default.MyPersonnelConnectionString;
SqlConnection MyConnection = new SqlConnection(MySQLConnectionString);
MyConnection.Open();
MyQueryTable = new System.Data.DataTable();
string MySQL = "SELECT 员工姓名,考勤月份, [1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13], [14], [15], [16], [17], [18], [19], [20], [21], [22], [23], [24], [25], [26], [27], [28], [29], [30], [31] FROM 考勤记录 WHERE (员工编号 LIKE '" + this.员工编号ToolStripTextBox.Text + "') AND (考勤年份='"+ this.考勤年份ToolStripComboBox.Text +"') ORDER BY 考勤月份";
SqlDataAdapter MyAdapter = new SqlDataAdapter(MySQL, MyConnection);
MyAdapter.Fill(MyQueryTable);
this.My员工姓名 = MyQueryTable.Rows[1][0].ToString();
this.Text = "查询个人年度考勤-" + this.My员工姓名;
if (MyConnection.State == ConnectionState.Open)
{
MyConnection.Close();
}
this.考勤记录DataGridView.DataSource = MyQueryTable;
}
private void QueryCheckForm_Load(object sender, EventArgs e)
{
// TODO: 这行代码将数据加载到表“myPersonnelDataSet.考勤记录”中。您可以根据需要移动或移除它。
this.考勤记录TableAdapter.Fill(this.myPersonnelDataSet.考勤记录);
this.myPersonnelDataSet.考勤记录.Rows.Clear();
for (int i = 2006; i < 2100; i++)
{
this.考勤年份ToolStripComboBox.Items.Add(i.ToString() );
}
}
private void 考勤记录BindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.考勤记录BindingSource.EndEdit();
this.考勤记录TableAdapter.Update(this.myPersonnelDataSet.考勤记录);
}
后面还有 53 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
