protected void Page_Load(object sender, EventArgs e) { TtNum1.BLL.GoodsInfo bllgoodsinfo = new TtNum1.BLL.GoodsInfo(); TtNum1.Model.GoodsInfo modgoodsinfo = new TtNum1.Model.GoodsInfo(); if (!IsPostBack) { if (Session["ht_username"] == null) { Response.Write("<script type='text/javascript'>alert('您尚未登录!');</script>"); Response.Redirect("../Shopping.aspx"); ViewState["retu"] = Request.UrlReferrer.ToString(); } else { string a = Request.QueryString["Goods_ID"].ToString(); DataSet ds = bllgoodsinfo.GetList_gs(a); if ( ds.Tables[0].Rows[0][0].ToString() != "0") { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('该商品有订单信息无法删除!');location.href='index.aspx'</script>"); } else { DataSet dt = bllgoodsinfo.GetList_gs3(a); if (dt.Tables[0].Rows[0][0].ToString().Trim() != "0") { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('该商品为团购商品,无法删除!');location.href='index.aspx'</script>"); return; } bllgoodsinfo.Delete(Convert.ToInt32(a)); Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('删除成功!');location.href='index.aspx'</script>"); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["ht_username"] == null) { Response.Write("<script type='text/javascript'>alert('您尚未登录!');</script>"); Response.Redirect("../Shopping.aspx"); ViewState["retu"] = Request.UrlReferrer.ToString(); } string a = Request.QueryString["GB_ID"].ToString(); DataSet ds = bllGroupBuying.GetList_cyrs(a); if (ds.Tables[0].Rows[0][0].ToString() != "0") { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('该订单有团购人数无法删除!');location.href='index.aspx'</script>"); } else { TtNum1.BLL.GoodsInfo bllGoodsInfo = new TtNum1.BLL.GoodsInfo(); TtNum1.Model.GoodsInfo modGoodsInfo = new TtNum1.Model.GoodsInfo(); modGoodsInfo.IN_group_buying = 0; modGoodsInfo.Goods_ID =Convert.ToInt32(a); bllGoodsInfo.Update(modGoodsInfo); Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('删除成功!');location.href='index.aspx'</script>"); //bllgoodsinfo.Delete(Convert.ToInt32(a)); } //int a = Convert.ToInt32(Request.QueryString["GB_ID"].ToString()); //bllGroupBuying.Delete(a); //Response.Write("<script language=javascript>alert('删除成功!')</script>"); //Response.Redirect("index.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { TtNum1.BLL.GoodSort2 bllGoodSort2 = new TtNum1.BLL.GoodSort2(); TtNum1.Model.GoodSort2 modGoodSort2 = new TtNum1.Model.GoodSort2(); TtNum1.BLL.GoodsInfo bllgoodsinfo = new TtNum1.BLL.GoodsInfo(); TtNum1.Model.GoodsInfo modgoodsinfo = new TtNum1.Model.GoodsInfo(); if (!IsPostBack) { //if (Session["ht_username"] == null) //{ // Response.Write("<script type='text/javascript'>alert('您尚未登录!');</script>"); // Response.Redirect("../Shopping.aspx"); // ViewState["retu"] = Request.UrlReferrer.ToString(); //} //else //{ string a = Request.QueryString["S_ID"].ToString(); DataSet ds = bllgoodsinfo.GetList_gs2(a); if (Convert.ToInt32( ds.Tables[0].Rows[0][0].ToString().Trim()) !=0) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('该类有商品信息无法删除!');location.href='type_0.aspx'</script>"); } else { bllgoodsinfo.Delete_2(a); Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('删除成功!');location.href='type_0.aspx'</script>"); } //} } }