protected void gvlist_RowCommand(object sender, GridViewCommandEventArgs e) { XYECOM.Business.Auditing audBLL = new Auditing(); int row = Convert.ToInt32(e.CommandArgument); Int64 id = Convert.ToInt64(this.gvlist.DataKeys[row][0].ToString()); LinkButton lb = (LinkButton)this.gvlist.Rows[row].Cells[7].Controls[0]; LinkButton LB = (LinkButton)this.gvlist.Rows[row].Cells[6].Controls[0]; XYECOM.Business.News ne = new XYECOM.Business.News(); if (e.CommandName == "ChangeAuditing") { if (lb.Text == "通过审核") { audBLL.UpdatesAuditing(id, "n_news", XYECOM.Model.AuditingState.NoPass); } else if (lb.Text == "未通过审核") { audBLL.UpdatesAuditing(id, "n_news", XYECOM.Model.AuditingState.Passed); } } if (e.CommandName == "ChangeCommand") { if (LB.Text == "推荐") { ne.UpdateForCommand(id, false); } else if (LB.Text == "不推荐") { ne.UpdateForCommand(id, true); } } BindData(); }
protected void btnIsPass_Click(object sender, EventArgs e) { XYECOM.Business.News ne = new XYECOM.Business.News(); long infoId = 0; foreach (GridViewRow GR in this.gvlist.Rows) { if (((HtmlInputCheckBox)(GR.FindControl("chkExport"))).Checked == true) { infoId = XYECOM.Core.MyConvert.GetInt64(gvlist.DataKeys[GR.DataItemIndex].Value.ToString()); if (infoId <= 0) continue; ne.UpdateForCommand(infoId, true); } } BindData(); }