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

📄 empdel.aspx.cs

📁 专业的办公oa代码下载 c#语言编写 三层结构
💻 CS
字号:
using System;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using qminoa.BLL;
using qminoa.Common;
using qminoa.DA;

namespace qminoa.Webs.MR
{
	public class EmpDel : qminoa.Webs.PageBase
	{
		protected System.Web.UI.WebControls.Label lblEmpNum;
		protected System.Web.UI.WebControls.HyperLink HyperLink2;
		protected System.Web.UI.WebControls.DataGrid dgdEmpStop;
		protected System.Web.UI.WebControls.Label lblErr;
	
		private void Page_Load(object sender, System.EventArgs e)
		{
			this.PageBegin("人员管理",true);
			if(!Page.IsPostBack)
				DataBind();
		}

		public DataTable EmpTB
		{
			get
			{
				return (new EmpSystem()).GetEmpTBStoped();
			}
		}

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{    
			this.dgdEmpStop.EditCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler(this.dgdEmpStop_EditCommand);
			this.dgdEmpStop.ItemDataBound += new System.Web.UI.WebControls.DataGridItemEventHandler(this.dgdEmpStop_ItemDataBound);
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion

		private void dgdEmpStop_EditCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
		{
			if(this.EmpRightCode  == 4)
			{
				int index = e.Item.ItemIndex;
				int empID = Convert.ToInt16(dgdEmpStop.DataKeys[index].ToString(),10);
				MrBaseInf EmpAccess = new MrBaseInf();
				if(EmpAccess.StopEmpLogin(empID,1))
				{
					dgdEmpStop.DataBind();
					this.WriteOptLog("复活帐号"+empID.ToString());
					JScript.Alert("复活用户帐号操作成功!");
				}
				else
					JScript.Alert("复活用户帐号操作失败!");
			}
			else
				JScript.Alert("您没有权限进行此操作!");
		}

		private void dgdEmpStop_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
		{
			ListItemType itemType = e.Item.ItemType;
			e.Item.Attributes["onmouseover"] = "javascript:this.style.backgroundColor='#fff7ce';cursor='hand';" ;
			if (itemType == ListItemType.Item )
			{
				e.Item.Attributes["onmouseout"] = "javascript:this.style.backgroundColor='#dedfde';";
			}
			else if( itemType == ListItemType.AlternatingItem)
			{
				e.Item.Attributes["onmouseout"] = "javascript:this.style.backgroundColor='#ffffff';";
			}
		}
	}
}

⌨️ 快捷键说明

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