?? empdel.aspx.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 + -