⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 monthstatictisframe.cs

📁 独立完成考勤管理软件加打卡系统(C#) 是打卡加管理系统软件 
💻 CS
📖 第 1 页 / 共 2 页
字号:
																																																							   new System.Data.Common.DataColumnMapping("迟到次数", "迟到次数"),
																																																							   new System.Data.Common.DataColumnMapping("未到次数", "未到次数"),
																																																							   new System.Data.Common.DataColumnMapping("请假次数", "请假次数"),
																																																							   new System.Data.Common.DataColumnMapping("备注", "备注")})});
			// 
			// sqlSelectCommand2
			// 
			this.sqlSelectCommand2.CommandText = "SELECT 编号, 职工名称, 统计日期, 月份, 迟到次数, 未到次数, 请假次数, 备注 FROM Month_statictis_Table WHERE " +
				"(职工名称 LIKE @Param10) AND (月份 LIKE @Param11) AND (统计日期 LIKE @Param12)";
			this.sqlSelectCommand2.Connection = this.sqlConnection2;
			this.sqlSelectCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Param10", System.Data.SqlDbType.VarChar, 50, "职工名称"));
			this.sqlSelectCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Param11", System.Data.SqlDbType.VarChar, 50, "月份"));
			this.sqlSelectCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Param12", System.Data.SqlDbType.VarChar, 50, "统计日期"));
			// 
			// sqlConnection2
			// 
			this.sqlConnection2.ConnectionString = "workstation id=localhost;integrated security=SSPI;database=SystemODBC";
			// 
			// sqlSelectCommand1
			// 
			this.sqlSelectCommand1.CommandText = "SELECT 编号, 职工名称, 统计日期, 月份, 迟到次数, 未到次数, 请假次数, 备注 FROM Month_statictis_Table";
			this.sqlSelectCommand1.Connection = this.sqlConnection1;
			// 
			// sqlInsertCommand1
			// 
			this.sqlInsertCommand1.CommandText = "INSERT INTO Month_statictis_Table(职工名称, 统计日期, 月份, 迟到次数, 未到次数, 请假次数, 备注) VALUES (@" +
				"职工名称, @统计日期, @月份, @迟到次数, @未到次数, @请假次数, @备注); SELECT 编号, 职工名称, 统计日期, 月份, 迟到次数, 未到" +
				"次数, 请假次数, 备注 FROM Month_statictis_Table WHERE (编号 = @@IDENTITY)";
			this.sqlInsertCommand1.Connection = this.sqlConnection1;
			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, "备注"));
			// 
			// 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.sqlConnection1;
			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, "编号"));
			// 
			// 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.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));
			// 
			// month
			// 
			this.month.DataSetName = "month";
			this.month.Locale = new System.Globalization.CultureInfo("zh-CN");
			// 
			// MonthStatictisFrame
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(746, 423);
			this.Name = "MonthStatictisFrame";
			this.Load += new System.EventHandler(this.MonthStatictisFrame_Load);
			((System.ComponentModel.ISupportInitialize)(this.statusZhuangTai)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.dataGrid)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.ds)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.dataSet)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.statusText)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.monthDataSet)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.month)).EndInit();
			this.ResumeLayout(false);

		}		#endregion		#region DataFunction
		private DataTable ExcuteSql(string strSql,string tableName)
		{
			DataSet dsSet=new DataSet();
			DataTable dsTable=new DataTable();
			try
			{
				dsSet=conn.ExcuteDataSetResult(strSql,tableName);
				dsTable=dsSet.Tables[0];
			}
			catch(Exception eles)
			{
				MessageBox.Show(this,eles.ToString(),"提示信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
			}
			return dsTable;
		}
		#endregion
		#region Init Event...
		private void MonthStatictisFrame_Load(object sender, System.EventArgs e)
		{
			try
			{
				this.sqlDataAdapter1.SelectCommand.Parameters[0].Value="%%";
				this.sqlDataAdapter1.SelectCommand.Parameters[1].Value="%%";
				this.sqlDataAdapter1.SelectCommand.Parameters[2].Value="%%";
				this.sqlDataAdapter1.Fill(this.month);
				this.sqlDataAdapter.Fill(this.month);
				base.ds=this.month;
				base.dataAdapter=this.sqlDataAdapter;
                MonthTable=this.month.Tables[0];
				base.dataGrid.DataSource=MonthTable;
				base.statusText.Text="记录:"+selectCount().Trim();
				base.cmOrders=(System.Windows.Forms.CurrencyManager) BindingContext[MonthTable];
			}
			catch(Exception ele)
			{
				MessageBox.Show(this,ele.ToString(),"提示信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
			}
		}		#endregion
		#region selectCount()		private String selectCount()		{            string count="select count(*) from Month_statictis_Table",tempStr="";			DataTable tempTable=new DataTable();			tempTable=ExcuteSql(count,"Month_statictis_Table");			for(int i=0;i<tempTable.Rows.Count;i++)			{                tempStr=tempTable.Rows[i][0].ToString().Trim();			}			return tempStr;		}		#endregion
		#region 查询事件...
		private void btnSearch_Click(object sender, System.EventArgs e)
		{
			try
			{
				this.sqlDataAdapter1.SelectCommand.Parameters[0].Value="%%";
				this.sqlDataAdapter1.SelectCommand.Parameters[1].Value="%%";
				this.sqlDataAdapter1.SelectCommand.Parameters[2].Value="%%";
				if(this.textSearchA.Text!="")
				{
					this.sqlDataAdapter1.SelectCommand.Parameters[0].Value="%"+this.textSearchA.Text+"%";
				}
				if(this.textSearchB.Text!="")
				{
					this.sqlDataAdapter1.SelectCommand.Parameters[1].Value="%"+this.textSearchB.Text+"%";
				}
				if(this.textSearchC.Text!="")
				{
					this.sqlDataAdapter1.SelectCommand.Parameters[2].Value="%"+this.textSearchC.Text+"%";
				}
				month.Month_statictis_Table.Clear();
				this.sqlDataAdapter1.Fill(month);
				base.ds=this.month;
				base.dataAdapter=this.sqlDataAdapter1;
				base.dataGrid.DataSource=month.Tables[0];
			}
			catch(Exception ele)
			{
				MessageBox.Show(ele.ToString());
			}
		}		#endregion	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -