﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace TtNum1.Role
{
    public partial class dele1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            TtNum1.BLL.GoodsInfo bllgoodsinfo = new TtNum1.BLL.GoodsInfo();
            TtNum1.Model.GoodsInfo modgoodsinfo = new TtNum1.Model.GoodsInfo();

            TtNum1.BLL.GoodSort bllGoodSort = new TtNum1.BLL.GoodSort();
            TtNum1.Model.GoodSort modGoodSort = new TtNum1.Model.GoodSort();
            if (!IsPostBack)
            {
            
              
                    string a = Request.QueryString["S_ID"].ToString();
                    DataSet ds= bllgoodsinfo.GetList_gs1(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_1(a);
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('删除成功！');location.href='type_0.aspx'</script>");
                      
                    
                   
                }
            }
        }
    }
}