EmpDel.aspx.cs
上传用户:autodoor
上传日期:2022-08-04
资源大小:9973k
文件大小:3k
- 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';";
- }
- }
- }
- }