protected void qued_Click(object sender, EventArgs e)
 {
     if (z_id.Text != "未选择")
     {
         if (TextBox1.Text != "")
         {
             Model.procate mym = new Model.procate();
             mym.cateid       = Convert.ToInt32(z_id.Text);
             mym.catename     = TextBox1.Text;
             mym.fathercateid = Convert.ToInt32(Drop_f.SelectedValue);
             BLL.procate myb    = new BLL.procate();
             int         result = myb.update(mym);
             if (result > 0)
             {
                 msg("更改成功!");
                 TextBox1.Text = "";
                 z_id.Text     = "未选择";
                 bing();
             }
         }
         else
         {
             msg("类明不能为空");
         }
     }
     else
     {
         msg("未选择");
     }
 }
 public void bing()
 {
     BLL.procate myb = new BLL.procate();
     DataSet ds = myb.data_set();
     GridView1.DataSource = ds.Tables[0];
     GridView1.DataBind();
 }
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Edit")
        {
            f_id.Text = e.CommandArgument.ToString();
        }

        if (e.CommandName == "Delete")
        {
            int f_id = Convert.ToInt32(e.CommandArgument);
            BLL.procate myb = new BLL.procate();
            int result = myb.num(f_id);
            if (result > 0)
            {
                msg("先把含有此父类的子类删除,才能删除父类");
            }
            else

            {
                BLL.fathercate f_b = new BLL.fathercate();
                int rs = f_b.delete(f_id);
                if (rs > 0)
                {
                    msg("删除成功");
                    bing();
                }
                else
                {
                    msg("删除失败");

                }
            }

        }
    }
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Edit")
        {
            f_id.Text = e.CommandArgument.ToString();
        }

        if (e.CommandName == "Delete")
        {
            int         f_id   = Convert.ToInt32(e.CommandArgument);
            BLL.procate myb    = new BLL.procate();
            int         result = myb.num(f_id);
            if (result > 0)
            {
                msg("先把含有此父类的子类删除,才能删除父类");
            }
            else

            {
                BLL.fathercate f_b = new BLL.fathercate();
                int            rs  = f_b.delete(f_id);
                if (rs > 0)
                {
                    msg("删除成功");
                    bing();
                }
                else
                {
                    msg("删除失败");
                }
            }
        }
    }
Exemple #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BLL.procate myb = new BLL.procate();
            DataSet ds = myb.dataset();
            _cateid.DataSource = ds.Tables[0];
            _cateid.DataBind();
            L_id.Text = Request.QueryString["id"].ToString();
            int  u_id = Convert.ToInt32( L_id.Text);
            BLL.product prob = new BLL.product();
            MySqlDataReader dr = prob.selectupdate(u_id);

            if (dr.Read())
            {
                _title.Text = dr["_title"].ToString();
                FCKeditor1.Value = dr["_content"].ToString();
                _posttime.Text = dr["_posttime"].ToString();
                _weight.Text = dr["_weight"].ToString();
                _imageid.Text = dr["_imageid"].ToString();
                _marketprice.Text = dr["_marketprice"].ToString();
                _localprice.Text = dr["_localprice"].ToString();
                _procount.Text = dr["_procount"].ToString();
                _ischeap.SelectedIndex = Convert.ToInt32(dr["_ischeap"].ToString());
                _isrecomment.SelectedIndex = Convert.ToInt32(dr["_isrecommend"].ToString());
                _top.SelectedIndex = Convert.ToInt32(dr["_top"].ToString());
                _cateid.SelectedIndex = Convert.ToInt32(dr["_cateid"].ToString()) + 1;
            }
            dr.Close();

        }
    }
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Edit")
        {
            z_id.Text = e.CommandArgument.ToString();
        }

        if (e.CommandName == "Delete")
        {
            int z_id = Convert.ToInt32(e.CommandArgument);
            BLL.product myb = new BLL.product();
            int result = myb.num(z_id);
            if (result > 0)
            {
                msg("先把含有此子类的商品记录删除,才能删除子类");
            }
            else
            {
                BLL.procate d_bll = new BLL.procate();
                int rs = d_bll.dalete(z_id);
                if (rs > 0)
                {
                    msg("删除成功");
                    bing();
                }
                else
                {
                    msg("删除失败!");

                }
            }

        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BLL.procate myb = new BLL.procate();
            DataSet     ds  = myb.dataset();
            _cateid.DataSource = ds.Tables[0];
            _cateid.DataBind();
            L_id.Text = Request.QueryString["id"].ToString();
            int           u_id = Convert.ToInt32(L_id.Text);
            BLL.product   prob = new BLL.product();
            SqlDataReader dr   = prob.selectupdate(u_id);

            if (dr.Read())
            {
                _title.Text                = dr["_title"].ToString();
                FCKeditor1.Value           = dr["_content"].ToString();
                _posttime.Text             = dr["_posttime"].ToString();
                _weight.Text               = dr["_weight"].ToString();
                _imageid.Text              = dr["_imageid"].ToString();
                _marketprice.Text          = dr["_marketprice"].ToString();
                _localprice.Text           = dr["_localprice"].ToString();
                _procount.Text             = dr["_procount"].ToString();
                _ischeap.SelectedIndex     = Convert.ToInt32(dr["_ischeap"].ToString());
                _isrecomment.SelectedIndex = Convert.ToInt32(dr["_isrecommend"].ToString());
                _top.SelectedIndex         = Convert.ToInt32(dr["_top"].ToString());
                _cateid.SelectedIndex      = Convert.ToInt32(dr["_cateid"].ToString()) + 1;
            }
            dr.Close();
        }
    }
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Edit")
        {
            z_id.Text = e.CommandArgument.ToString();
        }

        if (e.CommandName == "Delete")
        {
            int         z_id   = Convert.ToInt32(e.CommandArgument);
            BLL.product myb    = new BLL.product();
            int         result = myb.num(z_id);
            if (result > 0)
            {
                msg("先把含有此子类的商品记录删除,才能删除子类");
            }
            else
            {
                BLL.procate d_bll = new BLL.procate();
                int         rs    = d_bll.dalete(z_id);
                if (rs > 0)
                {
                    msg("删除成功");
                    bing();
                }
                else
                {
                    msg("删除失败!");
                }
            }
        }
    }
    public void bing()
    {
        BLL.procate myb = new BLL.procate();
        DataSet     ds  = myb.data_set();

        GridView1.DataSource = ds.Tables[0];
        GridView1.DataBind();
    }
Exemple #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string mmmm = DateTime.Now.ToString("yyyyMMddhhmmssfff");
            _imageid.Text = mmmm;

            BLL.procate myb = new BLL.procate();
            DataSet     ds  = myb.dataset();
            _cateid.DataSource = ds.Tables[0];
            _cateid.DataBind();
        }
    }
Exemple #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string mmmm = DateTime.Now.ToString("yyyyMMddhhmmssfff");
            _imageid.Text = mmmm;

            BLL.procate myb = new BLL.procate();
            DataSet ds = myb.dataset();
            _cateid.DataSource = ds.Tables[0];
            _cateid.DataBind();
        }
    }
Exemple #12
0
    public string datas(string f_cateid)
    {
        string result = "";

        BLL.procate myb = new BLL.procate();
        DataSet     ds  = myb.data_f(Convert.ToInt32(f_cateid));

        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            if (ds.Tables[0].Rows[i] != null)
            {
                result = result + "<li>" + "<a href=pro_catelist.aspx?cateid=" + ds.Tables[0].Rows[i]["_cateid"].ToString() + ">" + ds.Tables[0].Rows[i]["_catename"].ToString() + "</a>" + "</li>";
            }
        }
        return(result);
    }
Exemple #13
0
    public string datas(string f_cateid)
    {
        string result = "";
        BLL.procate myb = new BLL.procate();
        DataSet ds = myb.data_f(Convert.ToInt32(f_cateid));
        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            if (ds.Tables[0].Rows[i] != null)
            {
                result = result + "<li>" + "<a href=pro_catelist.aspx?cateid=" + ds.Tables[0].Rows[i]["_cateid"].ToString() + ">" + ds.Tables[0].Rows[i]["_catename"].ToString() + "</a>" + "</li>";

            }

        }
        return result;
    }
Exemple #14
0
    //public string fcateid;
    //获取父类别的id
    //public string FatherCateid { get {

    //return this.fcateid;
    //} }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)

        {
            BLL.fathercate my_f = new BLL.fathercate();
            DataSet        ds_f = my_f.dataset();
            Repeater1.DataSource = ds_f.Tables[0];
            Repeater1.DataBind();

            BLL.procate pb = new BLL.procate();

            uid.Text = Request.QueryString["uid"].ToString();

            int u_id = Convert.ToInt32(uid.Text);


            BLL.product   prob   = new BLL.product();
            SqlDataReader dr_pro = prob.selectupdate(u_id);
            dr_pro.Read();
            market.Text    = Math.Round(Convert.ToDecimal(dr_pro["_marketprice"].ToString()), 2).ToString();
            local.Text     = Math.Round(Convert.ToDecimal(dr_pro["_localprice"].ToString()), 2).ToString();
            image_id.Text  = dr_pro["_imageid"].ToString();
            title_l.Text   = dr_pro["_title"].ToString();
            content_s.Text = dr_pro["_content"].ToString();
            int cate_id = Convert.ToInt32(dr_pro["_cateid"].ToString());

            catename(cate_id);
            dr_pro.Close();

            BLL.proimage b_image  = new BLL.proimage();
            DataSet      ds_image = b_image.select_sizeid(image_id.Text);



            Image_1.ImageUrl = Convert.ToString(ds_image.Tables[0].Rows[0]["_imageurl"]);
            im_url           = Image_1.ImageUrl;
            img_url.Text     = im_url;

            if (ds_image.Tables[0].Rows[0]["_sizeid"] != null)
            {
                string size_id = Convert.ToString(ds_image.Tables[0].Rows[0]["_sizeid"]);
                sizeid.Text = size_id;
            }
        }
    }
    protected void tijiao_Click(object sender, EventArgs e)
    {
        if (procatename.Text != null)
        {
            Model.procate mym = new Model.procate();
            mym.catename     = procatename.Text;
            mym.fathercateid = Convert.ToInt32(fathername.SelectedValue);

            BLL.procate myb    = new BLL.procate();
            int         result = myb.insert(mym);
            if (result > 0)
            {
                msg("添加成功!!");
                procatename.Text = "";
            }
            else
            {
                msg("添加失败!!");
            }
        }
    }
Exemple #16
0
    protected void tijiao_Click(object sender, EventArgs e)
    {
        if (procatename.Text != null)
        {
            Model.procate mym = new Model.procate();
            mym.catename = procatename.Text;
            mym.fathercateid = Convert.ToInt32(fathername.SelectedValue);

            BLL.procate myb = new BLL.procate();
            int result = myb.insert(mym);
            if (result > 0)
            {
                msg("添加成功!!");
                procatename.Text = "";
            }
            else
            {
                msg("添加失败!!");
            }

        }
    }
Exemple #17
0
 public void catename(int cateid)
 {
     BLL.procate myb = new BLL.procate();
     cate_name.Text = myb.select_name(cateid);
 }
    protected void qued_Click(object sender, EventArgs e)
    {
        if (z_id.Text != "未选择")
        {
            if (TextBox1.Text !="")
            {
                Model.procate mym = new Model.procate();
                mym.cateid = Convert.ToInt32(z_id.Text);
                mym.catename = TextBox1.Text;
                mym.fathercateid = Convert.ToInt32(Drop_f.SelectedValue);
                BLL.procate myb = new BLL.procate();
                int result = myb.update(mym);
                if (result > 0)
                {
                    msg("更改成功!");
                    TextBox1.Text = "";
                    z_id.Text = "未选择";
                    bing();
                }

            }
            else
            {
                msg("类明不能为空");
            }
        }
        else
        {
            msg("未选择");
        }
    }