public ActionResult Delete(int id) { var info = StoreBLL.GetList(p => p.ID == id).FirstOrDefault(); if (null == info) { return(Json(new APIJson(-1, "删除失败,参数有误"))); } if (StoreBLL.Delete(info)) { return(Json(new APIJson(0, "删除成功"))); } return(Json(new APIJson(-1, "删除失败,请重试"))); }
protected void LinkButton1_OnClick(object sender, EventArgs e) { LinkButton link = (LinkButton)sender; var stno = link.CommandArgument.ToString(); int number = bllsto.Delete(stno); if (number > 0) { Response.Write("<script>alert('删除成功');window.location.href='StoreList.aspx';</script>"); } else { Response.Write("<script>alter('删除失败');</script>"); } }