protected void Egv_RowCommand(object sender, GridViewCommandEventArgs e) { int pid = Convert.ToInt32(e.CommandArgument.ToString()); switch (e.CommandName.ToLower()) { case "restore": if (bll.UpDeleteByID(pid)) { function.WriteSuccessMsg("还原成功!"); } else { function.WriteSuccessMsg("还原失败!"); } break; case "del1": bll.RealDeleteByID(pid, bll.GetproductByid(pid)); bd.SelByProID(pid, 2); break; default: break; } DataBind(); }