📄 queryallcheckform.cs
字号:
//文件名:QueryAllCheckForm.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 QueryAllCheckForm : Form
{
public QueryAllCheckForm()
{
InitializeComponent();
}
public string MyCompany;
private void QueryAllCheckForm_Load(object sender, EventArgs e)
{
for (int i = 2006; i < 2100; i++)
{
this.年份ToolStripComboBox.Items.Add(i.ToString());
}
for (int i = 1; i < 13; i++)
{
this.月份ToolStripComboBox.Items.Add(i.ToString());
}
}
private void 查询ToolStripButton_Click(object sender, EventArgs e)
{
try
{
this.考勤记录TableAdapter.FillBy1(this.myPersonnelDataSet.考勤记录, new System.Nullable<int>(((int)(System.Convert.ChangeType(this.年份ToolStripComboBox.Text, typeof(int))))), new System.Nullable<int>(((int)(System.Convert.ChangeType(this.月份ToolStripComboBox.Text, typeof(int))))));
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}
}
private void 打印ToolStripButton_Click(object sender, EventArgs e)
{
//if (this.myPersonnelDataSet.考勤记录.Rows.Count < 1)
//{
// return;
//}
////导出Excel表格数据文件
//ApplicationClass MyExcel;
//Workbooks MyWorkBooks;
//Workbook MyWorkBook;
//Worksheet MyWorkSheet;
//Range MyRange;
//Object[,] MyData = new Object[500, 35];
//int i, j;
//MyExcel = new ApplicationClass();
//MyExcel.Visible = true;
//if (MyExcel == null)
//{
// MessageBox.Show("Excel程序无法启动!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
// return;
//}
//MyWorkBooks = MyExcel.Workbooks;
//MyWorkBook = MyWorkBooks.Add(Missing.Value);
//MyWorkSheet = (Worksheet)MyWorkBook.Worksheets[1];
//MyRange = MyWorkSheet.get_Range("A5", "AF5");
//MyData[0, 0] = "员工姓名";
//for (i = 1; i < 32; i++)
//{
// MyData[0, i] = i.ToString();
//}
//j = 1;
////输出数据库记录
//foreach (DataRow MyRow in this.myPersonnelDataSet.考勤记录.Rows)
//{
// for (i = 2; i <34; i++)
// {
// MyData[j, i-2] = MyRow[i].ToString();
// }
// j++;
//}
//MyRange = MyRange.get_Resize(this.myPersonnelDataSet.考勤记录.Rows.Count + 1, 32);
//MyRange.Value2 = MyData;
//MyRange.EntireColumn.AutoFit();
//MyWorkSheet.Cells[2, 2] = this.MyCompany + "员工考勤表";
//MyWorkSheet.Cells[4, 1] = "考勤日期:" + this.年份ToolStripComboBox.Text + "年" + this.月份ToolStripComboBox.Text + "月";
//MyWorkSheet.Cells[this.myPersonnelDataSet.考勤记录.Rows.Count + 7, 1] = "考勤符号说明:出勤 /, 迟到>, 早退<, 产假√,事假#,病假+,婚假△,旷工×";
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -