/// <summary> /// 查看检测明细 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void GridView1_RowDeleting1(object sender, GridViewDeleteEventArgs e) { string Id = this.grid1.DataKeys[e.RowIndex].Values["id"].ToString();//标志 BProductCheckDetailBB checkDetailBB = new BProductCheckDetailBB(); DataSet ds = new DataSet(); try { ds = checkDetailBB.GetVList(" checkDetailId=" + Id); this.grid.DataSource = ds.Tables[0]; this.grid.DataBind(); //赋值记录条数、页面总数 } finally { checkDetailBB.Dispose(); } this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "showFloat();", true); }
public DataTable GetProductCheckDetail(int checkDetailId) { BProductCheckDetailBB productCheckDetailBB = new BProductCheckDetailBB(); try { DataTable dt = new DataTable(); dt = productCheckDetailBB.GetVList("checkDetailId=" + checkDetailId.ToString()).Tables[0]; return dt; } finally { productCheckDetailBB.Dispose(); } }
/// <summary> /// 删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnDel_Click(object sender, EventArgs e) { bool retChecked = false; BProductCheckDetailBB productCheckDetailBB = new BProductCheckDetailBB(); try { //获取选中的数据Id foreach (GridViewRow gvrow in this.grid.Rows) { CheckBox chkId = (CheckBox)gvrow.FindControl("chkId"); if (chkId.Checked == true) { retChecked = true; int id = int.Parse(chkId.ValidationGroup); productCheckDetailBB.DeleteRecord(id); } } } catch (Exception ex) { this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3);", true); return; } finally { productCheckDetailBB.Dispose(); } if (retChecked) { this.BindGrid(); } }
public bool DeleteProductCheckDetail(int id) { BProductCheckDetailBB productCheckDetailBB = new BProductCheckDetailBB(); try { return productCheckDetailBB.DeleteRecord(id); } finally { productCheckDetailBB.Dispose(); } }