📄 daysearchframe.cs
字号:
#region Name Place
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Data;
#endregion
namespace WindowsApplication
{
public class DaySearchFrame : WindowsApplication.EmployeeLeaveManager.ParentFrame
{
#region Controls...
private System.ComponentModel.Container components = null;
#endregion
#region values Define
//private string selectStr="select * from Day_Statictis_Table";
#endregion
#region DataBase Values...
private ConnectionData conn=new ConnectionData();
private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter;
private System.Data.SqlClient.SqlCommand sqlSelectCommand1;
private System.Data.SqlClient.SqlCommand sqlInsertCommand1;
private System.Data.SqlClient.SqlCommand sqlUpdateCommand1;
private System.Data.SqlClient.SqlCommand sqlDeleteCommand1;
private System.Data.SqlClient.SqlConnection sqlConnection1;
private WindowsApplication.DayStaticSet dayStaticSet;
private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;
private System.Data.SqlClient.SqlCommand sqlSelectCommand2;
private System.Data.SqlClient.SqlConnection sqlConnection2;
private DataTable dayTable=new DataTable();
#endregion
#region Function...
public DaySearchFrame()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#endregion
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(DaySearchFrame));
this.sqlDataAdapter = new System.Data.SqlClient.SqlDataAdapter();
this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();
this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
this.dayStaticSet = new WindowsApplication.DayStaticSet();
this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();
this.sqlSelectCommand2 = new System.Data.SqlClient.SqlCommand();
this.sqlConnection2 = new System.Data.SqlClient.SqlConnection();
((System.ComponentModel.ISupportInitialize)(this.statusZhuangTai)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dataGrid)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ds)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dataSet)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusText)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dayStaticSet)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.Name = "label1";
this.label1.Text = "日考勤管理";
//
// tool
//
this.tool.Name = "tool";
//
// status
//
this.status.Name = "status";
//
// imageList
//
this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream")));
//
// dataGrid
//
this.dataGrid.Name = "dataGrid";
//
// label2
//
this.label2.Name = "label2";
//
// label3
//
this.label3.Location = new System.Drawing.Point(8, 96);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(80, 23);
this.label3.Text = "职工名称:";
//
// textSearchA
//
this.textSearchA.ForeColor = System.Drawing.Color.Black;
this.textSearchA.Location = new System.Drawing.Point(88, 96);
this.textSearchA.Name = "textSearchA";
//
// TextCheckBox
//
this.TextCheckBox.Location = new System.Drawing.Point(200, 96);
this.TextCheckBox.Name = "TextCheckBox";
this.TextCheckBox.Size = new System.Drawing.Size(88, 24);
this.TextCheckBox.Text = "统计日期:";
//
// textSearchB
//
this.textSearchB.ForeColor = System.Drawing.Color.Black;
this.textSearchB.Name = "textSearchB";
//
// label4
//
this.label4.Name = "label4";
this.label4.Text = "统计星期:";
//
// btnSearch
//
this.btnSearch.Name = "btnSearch";
this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click);
//
// textSearchC
//
this.textSearchC.ForeColor = System.Drawing.Color.Black;
this.textSearchC.Name = "textSearchC";
//
// sqlDataAdapter
//
this.sqlDataAdapter.DeleteCommand = this.sqlDeleteCommand1;
this.sqlDataAdapter.InsertCommand = this.sqlInsertCommand1;
this.sqlDataAdapter.SelectCommand = this.sqlSelectCommand1;
this.sqlDataAdapter.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "Day_Statictis_Table", new System.Data.Common.DataColumnMapping[] {
new System.Data.Common.DataColumnMapping("编号", "编号"),
new System.Data.Common.DataColumnMapping("职工名称", "职工名称"),
new System.Data.Common.DataColumnMapping("统计日期", "统计日期"),
new System.Data.Common.DataColumnMapping("统计星期", "统计星期"),
new System.Data.Common.DataColumnMapping("统计时间", "统计时间"),
new System.Data.Common.DataColumnMapping("未到次数", "未到次数"),
new System.Data.Common.DataColumnMapping("迟到次数", "迟到次数"),
new System.Data.Common.DataColumnMapping("备注", "备注")})});
this.sqlDataAdapter.UpdateCommand = this.sqlUpdateCommand1;
//
// sqlDeleteCommand1
//
this.sqlDeleteCommand1.CommandText = @"DELETE FROM Day_Statictis_Table WHERE (编号 = @Original_编号) AND (备注 = @Original_备注 OR @Original_备注 IS NULL AND 备注 IS NULL) AND (未到次数 = @Original_未到次数 OR @Original_未到次数 IS NULL AND 未到次数 IS NULL) AND (统计日期 = @Original_统计日期 OR @Original_统计日期 IS NULL AND 统计日期 IS NULL) AND (统计时间 = @Original_统计时间 OR @Original_统计时间 IS NULL AND 统计时间 IS NULL) AND (统计星期 = @Original_统计星期 OR @Original_统计星期 IS NULL AND 统计星期 IS NULL) AND (职工名称 = @Original_职工名称 OR @Original_职工名称 IS NULL AND 职工名称 IS NULL) AND (迟到次数 = @Original_迟到次数 OR @Original_迟到次数 IS NULL AND 迟到次数 IS NULL)";
this.sqlDeleteCommand1.Connection = this.sqlConnection1;
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_编号", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "编号", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_备注", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "备注", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_未到次数", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "未到次数", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_统计日期", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "统计日期", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_统计时间", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "统计时间", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_统计星期", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "统计星期", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_职工名称", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "职工名称", System.Data.DataRowVersion.Original, null));
this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_迟到次数", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "迟到次数", System.Data.DataRowVersion.Original, null));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -