protected void btnDel_Click(object sender, EventArgs e) { LabMS.BLL.InstrumentAndConsumables bconsum = new LabMS.BLL.InstrumentAndConsumables(); try { bconsum.Delete(long.Parse(lbCID.Text)); LabMS.Common.JShelper.JSAlertAndRedirect(Page, "AddSuccess", "删除成功!", "InstrumentPreview.aspx"); } catch (Exception ex) { lbErr.Visible = true; lbErr.Text = ex.Message.ToString(); } }
protected void btDel_Click(object sender, EventArgs e) { lbErr.Visible = false; CheckBox ch; LabMS.BLL.InstrumentAndConsumables bconsum = new LabMS.BLL.InstrumentAndConsumables(); try { for (int i = 0; i < gvInstrument.Rows.Count; i++) { ch = (CheckBox)gvInstrument.Rows[i].FindControl("checkdel"); if (ch.Checked) { string CID = gvInstrument.DataKeys[i].Value.ToString(); bconsum.Delete(long.Parse(CID)); } } //checkall.Checked = false; if (tbKeyWords.Text.Trim().Equals("") && tbCreateDateMin.Text.Trim().Equals("") && tbCreateDateMax.Text.Trim().Equals("") && tbPurpose.Text.Trim().Equals("")) { bind(""); } else { bind(SearchString()); } Common.JShelper.JSAlert(Page, "success", "删除成功!"); } catch (Exception ex) { Common.JShelper.JSAlert(Page, "err", "删除失败!"); lbErr.Visible = true; lbErr.Text = ex.Message; } }
public void btDelete_Click(object sender, EventArgs e) { LabMS.BLL.InstrumentAndConsumables bconsum = new LabMS.BLL.InstrumentAndConsumables(); try { bconsum.Delete(long.Parse(strID)); LabMS.Common.JShelper.JSAlertAndRedirect(Page, "DeleteSuccess", "删除成功!", "valuablespreview.aspx"); } catch (Exception ex) { lbErr.Visible = true; lbErr.Text = ex.Message.ToString(); } }