📄 monthstatistisframe.cs
字号:
//
// sqlDeleteCommand1
//
this.sqlDeleteCommand1.CommandText = @"DELETE FROM Month_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.sqlConnection;
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));
//
// sqlConnection
//
this.sqlConnection.ConnectionString = "workstation id=localhost;integrated security=SSPI;database=SystemODBC";
//
// sqlInsertCommand1
//
this.sqlInsertCommand1.CommandText = "INSERT INTO Month_statictis_Table(职工名称, 统计日期, 月份, 迟到次数, 未到次数, 请假次数, 备注) VALUES (@" +
"职工名称, @统计日期, @月份, @迟到次数, @未到次数, @请假次数, @备注); SELECT 编号, 职工名称, 统计日期, 月份, 迟到次数, 未到" +
"次数, 请假次数, 备注 FROM Month_statictis_Table WHERE (编号 = @@IDENTITY)";
this.sqlInsertCommand1.Connection = this.sqlConnection;
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@职工名称", System.Data.SqlDbType.VarChar, 50, "职工名称"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@统计日期", System.Data.SqlDbType.VarChar, 50, "统计日期"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@月份", System.Data.SqlDbType.VarChar, 50, "月份"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@迟到次数", System.Data.SqlDbType.VarChar, 50, "迟到次数"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@未到次数", System.Data.SqlDbType.VarChar, 50, "未到次数"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@请假次数", System.Data.SqlDbType.VarChar, 50, "请假次数"));
this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@备注", System.Data.SqlDbType.VarChar, 50, "备注"));
//
// sqlSelectCommand1
//
this.sqlSelectCommand1.CommandText = "SELECT 编号, 职工名称, 统计日期, 月份, 迟到次数, 未到次数, 请假次数, 备注 FROM Month_statictis_Table";
this.sqlSelectCommand1.Connection = this.sqlConnection;
//
// sqlUpdateCommand1
//
this.sqlUpdateCommand1.CommandText = @"UPDATE Month_statictis_Table SET 职工名称 = @职工名称, 统计日期 = @统计日期, 月份 = @月份, 迟到次数 = @迟到次数, 未到次数 = @未到次数, 请假次数 = @请假次数, 备注 = @备注 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); SELECT 编号, 职工名称, 统计日期, 月份, 迟到次数, 未到次数, 请假次数, 备注 FROM Month_statictis_Table WHERE (编号 = @编号)";
this.sqlUpdateCommand1.Connection = this.sqlConnection;
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@职工名称", System.Data.SqlDbType.VarChar, 50, "职工名称"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@统计日期", System.Data.SqlDbType.VarChar, 50, "统计日期"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@月份", System.Data.SqlDbType.VarChar, 50, "月份"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@迟到次数", System.Data.SqlDbType.VarChar, 50, "迟到次数"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@未到次数", System.Data.SqlDbType.VarChar, 50, "未到次数"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@请假次数", System.Data.SqlDbType.VarChar, 50, "请假次数"));
this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@备注", System.Data.SqlDbType.VarChar, 50, "备注"));
this.sqlUpdateCommand1.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.sqlUpdateCommand1.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.sqlUpdateCommand1.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.sqlUpdateCommand1.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.sqlUpdateCommand1.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.sqlUpdateCommand1.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.sqlUpdateCommand1.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.sqlUpdateCommand1.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.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@编号", System.Data.SqlDbType.Int, 4, "编号"));
//
// monthTableSet
//
this.monthTableSet.DataSetName = "MonthTableSet";
this.monthTableSet.Locale = new System.Globalization.CultureInfo("zh-CN");
//
// MonthStatistisFrame
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(762, 511);
this.Name = "MonthStatistisFrame";
this.Load += new System.EventHandler(this.MonthStatistisFrame_Load);
((System.ComponentModel.ISupportInitialize)(this.monthTableSet)).EndInit();
this.ResumeLayout(false);
} #endregion
#region 初始化事件...
private void MonthStatistisFrame_Load(object sender, System.EventArgs e)
{
try
{
string connectionStr="workstation id=localhost;Integrated Security=SSPI;database=SystemODBC;";
SqlConnection conn=new SqlConnection(connectionStr);
string selectStr="select * from Month_statictis_Table where 统计日期 between('"+this.starDate+"')and('"+this.endDate+"') and 职工名称='"+emp_Name+"'";
SqlDataAdapter sqldataAdapter=new SqlDataAdapter(selectStr,conn);
DataSet ds=new DataSet();
sqldataAdapter.Fill(ds);
MonthStatistic log=new MonthStatistic();
log.SetDataSource(ds.Tables[0]);
this.csreportView.ReportSource=log;
}
catch(Exception ele)
{
MessageBox.Show(this,ele.StackTrace.ToString(),"提示信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
} #endregion }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -