/// <summary> /// 删除选中项 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnDelAll_Click(object sender, EventArgs e) { string ids = string.Empty; for (int i = 0; i < gvMeetingSummary.Rows.Count; i++) { CheckBox cbSel = this.gvMeetingSummary.Rows[i].FindControl("cbAllCb") as CheckBox; if (cbSel.Checked == true) { HiddenField hfMSID = this.gvMeetingSummary.Rows[i].FindControl("hfMSID") as HiddenField; ids += hfMSID.Value + ","; } } if (ids.Length > 0) { ids = ids.Substring(0, ids.Length - 1); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('请选择要删除的项!')</script>"); return; } MeetingSummaryManager.DelMeetingSummary(ids); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('删除成功')</script>"); Bind(); }
/// <summary> /// GridView生成事件时激发 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void gvMeetingSummary_RowCommand(object sender, GridViewCommandEventArgs e) { string name = e.CommandName; //更新 if (name == "Up") { Response.Redirect("UpdateMeeting.aspx?MSID=" + e.CommandArgument.ToString()); } //删除 else if (name == "Del") { MeetingSummaryManager.DelMeetingSummary(e.CommandArgument.ToString()); } //查看详情 else if (name == "Det") { Response.Redirect("MeetingDetails.aspx?MSID=" + e.CommandArgument.ToString()); } }
/// <summary> /// GridView生成事件时激发 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void gvMeetingSummary_RowCommand(object sender, GridViewCommandEventArgs e) { string name = e.CommandName; //更新 if (name == "Up") { Response.Redirect("UpdateMeeting.aspx?MSID=" + e.CommandArgument.ToString()); } //删除 else if (name == "Del") { MeetingSummaryManager.DelMeetingSummary(e.CommandArgument.ToString()); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('删除成功')</script>"); Bind(); } //查看详情 else if (name == "Det") { Response.Redirect("MeetingDetails.aspx?MSID=" + e.CommandArgument.ToString()); } }