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.DeleteNormalPolicy(this.CurrentUser.UserName, list_ids.ToArray()); QueryNormalPolicy(pager.CurrentPageIndex); ClaerHidValue(); } catch (Exception ex) { ShowExceptionMessage(ex, "删除政策"); } } }
protected void grv_normal_RowCommand(object sender, GridViewCommandEventArgs e) { //确认审核 if (e.CommandName == "Audited") { PolicyManageService.Audit(PolicyType.Normal, this.CurrentUser.UserName, Guid.Parse(e.CommandArgument.ToString())); QueryNormalPolicy(pager.CurrentPageIndex); } //取消审核 if (e.CommandName == "UnAudited") { PolicyManageService.CancelAudit(PolicyType.Normal, this.CurrentUser.UserName, Guid.Parse(e.CommandArgument.ToString())); QueryNormalPolicy(pager.CurrentPageIndex); } //删除政策 if (e.CommandName == "del") { try { PolicyManageService.DeleteNormalPolicy(this.CurrentUser.UserName, Guid.Parse(e.CommandArgument.ToString())); QueryNormalPolicy(pager.CurrentPageIndex); } catch (Exception ex) { ShowExceptionMessage(ex, "删除政策"); } } }