/// <summary> /// 删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void LinkButton1_Command(object sender, CommandEventArgs e) { int num = 0; switch (e.CommandName) { case "delete": int roleGroupId = Convert.ToInt32(e.CommandArgument); num = roleGroupBll.DeleteRoleGroup(roleGroupId); if (num > 0) { this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('删除成功!');location.href='ShowRoleList.aspx'", true); } else { this.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('删除失败!');location.href='ShowRoleList.aspx'", true); } break; case "Edit": Response.Redirect("AddRoleGrop.aspx?RoleID=" + Convert.ToInt32(e.CommandArgument.ToString().Trim()) + "&name=" + e.CommandName.ToString().Trim()); break; case "IsKai": string Id = e.CommandArgument.ToString().Trim(); int Check = (roleGroupBll.GetRoleGroupById(Id)).SCheck; int SCheck = Check == 1?0:1; roleGroupBll.UPdateRoleGroupSCheck(Id, SCheck); this.dataBin(); break; default: break; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString.Count > 0) { RoleGroupBLL roleGroupBll = new RoleGroupBLL(); string Id = Request.QueryString["Id"].ToString().Trim(); int Check = Convert.ToInt32(Request.QueryString["IsKai"]); int IsKai = Check == 1 ? 0 : 1; if (roleGroupBll.UPdateRoleGroupSCheck(Id, IsKai)) { Response.Redirect("ShowRoleList.aspx"); } } } }