protected void btnDel_Click(object sender, EventArgs e) { if (GetCheckBoxValue()) { var p = PolicyManageService.QueryPolicyIds(GetCondition()); if (hidIsAll.Value == "1") { int count = p.Count(item => item.Value == true); if (count != 0) { ShowMessage("删除政策失败,其中存在 " + count + " 条 已审核。全部取消审核才能删除!"); return; } } var list_ids = hidIsAll.Value == "0" ? hidIds.Value.Split(',').Select(Guid.Parse) : p.Select(item => item.Key); try { PolicyManageService.DeleteTeamPolicy(this.CurrentUser.UserName, list_ids.ToArray()); QueryTeamPolicy(pager.CurrentPageIndex); ClaerHidValue(); } catch (Exception ex) { ShowExceptionMessage(ex, "删除政策"); } } }
protected void grv_normal_RowCommand(object sender, GridViewCommandEventArgs e) { //确认审核 if (e.CommandName == "Audited") { PolicyManageService.Audit(PolicyType.Team, this.CurrentUser.UserName, Guid.Parse(e.CommandArgument.ToString())); QueryTeamPolicy(pager.CurrentPageIndex); } //取消审核 if (e.CommandName == "UnAudited") { PolicyManageService.CancelAudit(PolicyType.Team, this.CurrentUser.UserName, Guid.Parse(e.CommandArgument.ToString())); QueryTeamPolicy(pager.CurrentPageIndex); } //删除政策 if (e.CommandName == "del") { try { PolicyManageService.DeleteTeamPolicy(this.CurrentUser.UserName, Guid.Parse(e.CommandArgument.ToString())); QueryTeamPolicy(pager.CurrentPageIndex); } catch (Exception ex) { ShowExceptionMessage(ex, "删除政策"); } } }