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

📄 renewstaff.cs

📁 工资结算系统 拥有权限控制 临时工资表 自动导入导出Excel 以及邮件群发功能
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.OleDb;

namespace HrSalary.employee
{
	/// <summary>
	/// ResumeWorker 的摘要说明。
	/// </summary>
	public class RenewStaff : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Button button1;
		private System.Windows.Forms.Button button2;
		/// <summary>
		/// 必需的设计器变量。
		 private DataGrid dg = null;
		 private OleDbConnection dbCon = null;
		 int style;

		/// </summary>
	  
		private System.ComponentModel.Container components = null;

		public RenewStaff(DataGrid dg,int t)
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();
			this.dg=dg;
			this.style=t;

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.label1 = new System.Windows.Forms.Label();
			this.button1 = new System.Windows.Forms.Button();
			this.button2 = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// label1
			// 
			this.label1.BackColor = System.Drawing.Color.White;
			this.label1.Font = new System.Drawing.Font("华文中宋", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
			this.label1.ForeColor = System.Drawing.Color.Blue;
			this.label1.Location = new System.Drawing.Point(0, 8);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(208, 56);
			this.label1.TabIndex = 0;
			this.label1.Text = "确实要恢复此信息吗?";
			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			// 
			// button1
			// 
			this.button1.BackColor = System.Drawing.Color.Transparent;
			this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.button1.ForeColor = System.Drawing.Color.Blue;
			this.button1.Location = new System.Drawing.Point(40, 72);
			this.button1.Name = "button1";
			this.button1.Size = new System.Drawing.Size(48, 23);
			this.button1.TabIndex = 1;
			this.button1.Text = "是";
			this.button1.Click += new System.EventHandler(this.button1_Click);
			// 
			// button2
			// 
			this.button2.BackColor = System.Drawing.Color.LightGray;
			this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
			this.button2.ForeColor = System.Drawing.Color.Blue;
			this.button2.Location = new System.Drawing.Point(112, 72);
			this.button2.Name = "button2";
			this.button2.Size = new System.Drawing.Size(48, 23);
			this.button2.TabIndex = 2;
			this.button2.Text = "否";
			this.button2.Click += new System.EventHandler(this.button2_Click);
			// 
			// RenewStaff
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.BackColor = System.Drawing.Color.AliceBlue;
			this.ClientSize = new System.Drawing.Size(200, 105);
			this.Controls.Add(this.button2);
			this.Controls.Add(this.button1);
			this.Controls.Add(this.label1);
			this.Name = "RenewStaff";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
			this.Text = "恢复删除信息";
			this.ResumeLayout(false);

		}
		#endregion

		private void button1_Click(object sender, System.EventArgs e)
		{			
			long empid = long.Parse(this.dg[this.dg.CurrentRowIndex,0].ToString());
			try
			{
				if(dbCon==null) dbCon = MainForm.getConnection();
				OleDbCommand cmd = dbCon.CreateCommand();
				cmd.CommandText = "update employee set 状态=0 where 状态=1 and 编号="+empid;
				int result = cmd.ExecuteNonQuery();
				if(result==1)
				{  
					try
					{					
					string sql1 = "select 编号,姓名,Email,银行卡号 from employee where 状态=1 ";
					((employee.StaffQuery)this.Owner).showData(sql1);
					}
					catch(Exception ee)
					{
						MessageBox.Show("Resumeworker:this"+this.ToString()+"\n"+ee.ToString());
					}
					this.Close();
				}
				cmd.Dispose();
			}
			catch(Exception ee)
			{
				MessageBox.Show(ee.ToString());
			}
		}
		
		private void button2_Click(object sender, System.EventArgs e)
		{
		   this.Close();
		}
	}
}

⌨️ 快捷键说明

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