Exemplo n.º 1
0
    protected void tijiao_Click(object sender, EventArgs e)
    {
        Model.product mym = new Model.product();
        mym.title       = _title.Text;
        mym.content     = FCKeditor1.Value;
        mym.imageid     = _imageid.Text;
        mym.ischeap     = Convert.ToInt32(_ischeap.SelectedValue);
        mym.isrecomment = Convert.ToInt32(_isrecomment.SelectedValue);
        mym.localprice  = Convert.ToDouble(_localprice.Text);
        mym.marketprice = Convert.ToDouble(_marketprice.Text);
        mym.posttime    = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));
        mym.procount    = Convert.ToInt32(_procount.Text);
        mym.top         = Convert.ToInt32(_top.SelectedValue);
        mym.weight      = _weight.Text;
        mym.cateid      = Convert.ToInt32(_cateid.SelectedValue);
        BLL.product bpro   = new BLL.product();
        int         result = bpro.insert(mym);

        if (result > 0)
        {
            msg("成功添加产品!!");

            string mmmm = DateTime.Now.ToString("yyyyMMddhhmmssfff");
            _imageid.Text = mmmm;

            _title.Text       = "";
            FCKeditor1.Value  = "";
            _procount.Text    = "";
            _weight.Text      = "";
            _localprice.Text  = "";
            _marketprice.Text = "";
            imagela.Text      = "";
        }
    }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }
            //Tool.Admin.admin();
            try
            {
                i = int.Parse(Request["id"]);
                Model.product a = new Model.product()
                {
                    id = i
                };
                Hq = BLL.Product.Getproduct(a);
            }
            catch
            {
                i = 1;
                Model.product a = new Model.product()
                {
                    id = i
                };
                Hq = BLL.Product.Getproduct(a);
            }

            product_name.Text     = Hq.product_name;
            product_intro.Text    = Hq.product_name;
            Image1.ImageUrl       = "../img/product/" + Hq.product_imageurl;
            product_price.Text    = Hq.product_price.ToString();
            product_content.Value = Hq.product_content;
            product_content.Rows  = 12;
            product_content.Cols  = 60;
        }
Exemplo n.º 3
0
    protected void sous_Click(object sender, EventArgs e)
    {
        Model.product mym = new Model.product();
        mym.title = Text_title.Text;
        BLL.product myb = new BLL.product();
        DataSet     ds  = myb.select_title(mym);

        GridView1.DataSource = ds.Tables[0];
        GridView1.DataBind();
    }
Exemplo n.º 4
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Delete")
        {
            Model.product mym = new Model.product();
            mym.id = Convert.ToInt32(e.CommandArgument);
            BLL.product myb = new BLL.product();



            string s_imageid = myb.select_imageid(mym);


            BLL.proimage b_image = new BLL.proimage();

            DataSet ds = b_image.select_sizeid(s_imageid);



            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                string size_id = Convert.ToString(ds.Tables[0].Rows[i]["_sizeid"]);

                BLL.size s_bll = new BLL.size();

                int result_s = s_bll.delete(size_id);


                string path1 = Convert.ToString(ds.Tables[0].Rows[i]["_imageurl"]);

                string path = "~/" + path1;

                if (File.Exists(Server.MapPath(path)))
                {
                    File.Delete(Server.MapPath(path));
                }
            }

            int r_image = b_image.delete(s_imageid);

            int result = myb.delete_id(mym);

            if (result > 0)
            {
                msg("删除成功!!");
                bing();
            }
        }

        if (e.CommandName == "Edit")
        {
            Response.Redirect("proupdate.aspx?id=" + e.CommandArgument + "");
        }
    }
Exemplo n.º 5
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Delete")
        {
            Model.product mym = new Model.product();
            mym.id = Convert.ToInt32(e.CommandArgument);
            BLL.product myb = new BLL.product();

            string s_imageid = myb.select_imageid(mym);

            BLL.proimage b_image = new BLL.proimage();

            DataSet ds = b_image.select_sizeid(s_imageid);

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                string size_id = Convert.ToString(ds.Tables[0].Rows[i]["_sizeid"]);

                BLL.size s_bll = new BLL.size();

                int result_s = s_bll.delete(size_id);

                string path1 = Convert.ToString(ds.Tables[0].Rows[i]["_imageurl"]);

                string path = "~/" + path1;

                if (File.Exists(Server.MapPath(path)))
                {

                    File.Delete(Server.MapPath(path));
                }

            }

                int r_image = b_image.delete(s_imageid);

                int result = myb.delete_id(mym);

                if (result > 0)
                {
                    msg("删除成功!!");
                    bing();
                }

            }

            if (e.CommandName == "Edit")
            {
                Response.Redirect("proupdate.aspx?id="+e.CommandArgument+"");
            }
    }
Exemplo n.º 6
0
 protected void Button1_OnClick(object sender, EventArgs e)
 {
     Tool.UpFile   u = new UpFile();
     Model.product a = new Model.product()
     {
         id = i,
         product_imageurl = u.upFileName(this.FileUpload1, "../img/product/"),
         product_name     = product_name.Text,
         product_intro    = product_intro.Text,
         product_price    = int.Parse(product_price.Text),
         product_content  = product_content.Value
     };
     _ = BackStages.List <Model.product> .Getproduct(a) > 0 ? Tool.Tool.Alert("True", "../img/product/" + Hq.product_imageurl) : Tool.Tool.Alert("False");
 }
Exemplo n.º 7
0
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        //if (Session["_username"] == null)
        //{
        //    Common.MessageAlert.Alert(Page, "对不起,你还没有登入!!");
        //}
        //    //引用shoplist
        //else
        //{
        Model.product mypro = new Model.product();
        mypro.id = Convert.ToInt32(Request.QueryString["uid"].ToString());
        BLL.BLLshoplist blll = new BLL.BLLshoplist();
        SqlDataReader   dr   = blll.readpro(mypro);
        DataTable       dt;

        if (Session["dt"] == null)
        {
            dt = new DataTable();


            dt.Columns.Add("id", typeof(Int32));
            dt.Columns.Add("title", typeof(String));
            dt.Columns.Add("localprice", typeof(Double));
            dt.Columns.Add("posttime", typeof(String));
            dt.Columns.Add("buycount", typeof(Int32));
            dt.Columns.Add("sumprice", typeof(Int32));
        }
        else
        {
            dt = (DataTable)Session["dt"];
        }
        DataRow row = dt.NewRow();

        if (dr.Read())
        {
            row["id"]         = Convert.ToInt32(dr["_id"].ToString());
            row["title"]      = Convert.ToString(dr["_title"].ToString());
            row["localprice"] = Convert.ToDouble(dr["_localprice"].ToString());
            row["posttime"]   = Convert.ToString(dr["_posttime"].ToString());
            row["buycount"]   = 1;
            row["sumprice"]   = Convert.ToDouble(dr["_localprice"].ToString());
            dt.Rows.Add(row);
        }
        dr.Close();
        Session["dt"] = dt;
        Response.Redirect("shoplist.aspx");
    }
Exemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }
            string sid = Request["id"];

            if (Request["id"] == null)
            {
                pr = (Model.product)BLL.Product.GetProductS(1)[0];
            }
            else
            {
                id = int.Parse(sid);
                pr = (Model.product)BLL.Product.GetProductS(int.Parse(sid))[0];
            }
        }
Exemplo n.º 9
0
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        //if (Session["_username"] == null)
        //{
        //    Common.MessageAlert.Alert(Page, "对不起,你还没有登入!!");
        //}
        //    //引用shoplist
        //else
        //{
            Model.product mypro = new Model.product();
            mypro.id = Convert.ToInt32(Request.QueryString["uid"].ToString());
            BLL.BLLshoplist blll = new BLL.BLLshoplist();
            MySqlDataReader dr = blll.readpro(mypro);
            DataTable dt;
            if (Session["dt"] == null)
            {
           dt = new DataTable();

            dt.Columns.Add("id", typeof(Int32));
            dt.Columns.Add("title", typeof( String ));
            dt.Columns.Add("localprice", typeof(Double));
            dt.Columns.Add("posttime", typeof(String));
            dt.Columns .Add ("buycount", typeof (Int32));
            dt.Columns.Add("sumprice", typeof(Int32));
            }
            else
            {
                dt = (DataTable)Session["dt"];
            }
            DataRow row = dt.NewRow();
            if (dr.Read())
            {
                row["id"] = Convert.ToInt32(dr["_id"].ToString());
                row["title"] = Convert.ToString (dr["_title"].ToString());
                row["localprice"] = Convert.ToDouble(dr["_localprice"].ToString());
                row["posttime"] = Convert.ToString(dr["_posttime"].ToString());
                row["buycount"] = 1;
                row["sumprice"] = Convert.ToDouble(dr["_localprice"].ToString());
                dt.Rows.Add(row);
            }
            dr.Close();
            Session["dt"] = dt;
            Response.Redirect("shoplist.aspx");
    }
Exemplo n.º 10
0
    protected void tijiao_Click(object sender, EventArgs e)
    {
        Model.product mym = new Model.product();
        mym.title = _title.Text;
        mym.content = FCKeditor1.Value;
        mym.imageid = _imageid.Text;
        mym.ischeap = Convert.ToInt32(_ischeap.SelectedValue);
        mym.isrecomment = Convert.ToInt32(_isrecomment.SelectedValue);
        mym.localprice = Convert.ToDouble(_localprice.Text);
        mym.marketprice = Convert.ToDouble(_marketprice.Text);
        mym.posttime = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));
        mym.procount = Convert.ToInt32(_procount.Text);
        mym.top = Convert.ToInt32(_top.SelectedValue);
        mym.weight = _weight.Text;
        mym.cateid = Convert.ToInt32(_cateid.SelectedValue);
        BLL.product bpro = new BLL.product();
        int result = bpro.insert(mym);
        if (result > 0)
        {
            msg("成功添加产品!!");

            string mmmm = DateTime.Now.ToString("yyyyMMddhhmmssfff");
            _imageid.Text = mmmm;

            _title.Text = "";
            FCKeditor1.Value = "";

            _procount.Text = "";
            _weight.Text = "";
            sizela.Text = "";
            _localprice.Text = "";
            _marketprice.Text = "";

            imagela.Text = "";

        }
    }
Exemplo n.º 11
0
    protected void tijiao_Click(object sender, EventArgs e)
    {
        Model.product mym = new Model.product();
        mym.title = _title.Text;
        mym.content = FCKeditor1.Value;
        mym.id = Convert.ToInt32(L_id.Text);
        mym.ischeap = Convert.ToInt32(_ischeap.SelectedValue);
        mym.isrecomment = Convert.ToInt32(_isrecomment.SelectedValue);
        mym.localprice = Convert.ToDouble(_localprice.Text);
        mym.marketprice = Convert.ToDouble(_marketprice.Text);

        mym.procount = Convert.ToInt32(_procount.Text);
        mym.top = Convert.ToInt32(_top.SelectedValue);
        mym.weight = _weight.Text;
        mym.cateid = Convert.ToInt32(_cateid.SelectedValue);
        BLL.product bpro = new BLL.product();
        int result = bpro.update(mym);
        if (result > 0)
        {
            msg("成功更新商品!!");
            Response.Redirect("proselect.aspx");

        }
    }
Exemplo n.º 12
0
    protected void tijiao_Click(object sender, EventArgs e)
    {
        Model.product mym = new Model.product();
        mym.title       = _title.Text;
        mym.content     = FCKeditor1.Value;
        mym.id          = Convert.ToInt32(L_id.Text);
        mym.ischeap     = Convert.ToInt32(_ischeap.SelectedValue);
        mym.isrecomment = Convert.ToInt32(_isrecomment.SelectedValue);
        mym.localprice  = Convert.ToDouble(_localprice.Text);
        mym.marketprice = Convert.ToDouble(_marketprice.Text);

        mym.procount = Convert.ToInt32(_procount.Text);
        mym.top      = Convert.ToInt32(_top.SelectedValue);
        mym.weight   = _weight.Text;
        mym.cateid   = Convert.ToInt32(_cateid.SelectedValue);
        BLL.product bpro   = new BLL.product();
        int         result = bpro.update(mym);

        if (result > 0)
        {
            msg("成功更新商品!!");
            Response.Redirect("proselect.aspx");
        }
    }
Exemplo n.º 13
0
    //订单。。。。。。。
    protected void LinkButton2_Click(object sender, EventArgs e)
    {
        if (Session["_user_name"] == null)
        {
            Common.MessageAlert.Alert(Page, "对不起,您还没有登入!!");
        }
        //引用shoplist
        else
        {
            Model.product mypro = new Model.product();
            mypro.id = Convert.ToInt32(Request.QueryString["uid"].ToString());
            BLL.BLLshoplist blll = new BLL.BLLshoplist();
            SqlDataReader   dr   = blll.readpro(mypro);
            DataTable       dt;
            if (Session["dt"] == null)
            {
                dt = new DataTable();
                dt.Columns.Add("id", typeof(Int32));

                dt.Columns.Add("localprice", typeof(Double));
                dt.Columns.Add("posttime", typeof(String));
                dt.Columns.Add("buycount", typeof(Int32));
                dt.Columns.Add("sumprice", typeof(Int32));
                dt.Columns.Add("color", typeof(String));
                dt.Columns.Add("size", typeof(String));
                dt.Columns.Add("title", typeof(String));
                dt.Columns.Add("cate", typeof(String));
                dt.Columns.Add("image", typeof(String));
                dt.Columns.Add("only", typeof(String));
                dt.Columns.Add("weight", typeof(String));
                dt.Columns.Add("sumweight", typeof(String));
            }
            else
            {
                dt = (DataTable)Session["dt"];
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (Convert.ToInt32(dt.Rows[i]["id"]) == mypro.id && Convert.ToString(dt.Rows[i]["color"]) == d_color.Text && Convert.ToString(dt.Rows[i]["size"]) == _size.Text)
                    {
                        dt.Rows[i]["buycount"] = Convert.ToInt32(dt.Rows[i]["buycount"]) + 1;
                        Session["dt"]          = dt;
                        Response.Redirect("shoplist.aspx");
                        return;
                    }
                }
            }
            DataRow row = dt.NewRow();
            if (dr.Read())
            {
                row["weight"]    = dr["_product_weight"].ToString();
                row["sumweight"] = dr["_product_weight"].ToString();
                row["only"]      = DateTime.Now.ToString("yyyyMMddhhmmssfff");
                row["size"]      = _size.Text;
                row["image"]     = Image_1.ImageUrl;
                row["cate"]      = cate_name.Text;
                row["title"]     = title_l.Text;
                row["color"]     = d_color.Text;
                row["id"]        = Convert.ToInt32(dr["_id"].ToString());

                row["localprice"] = Convert.ToDouble(dr["_local_price"].ToString());
                row["posttime"]   = Convert.ToString(dr["_post_time"].ToString());
                row["buycount"]   = 1;
                row["sumprice"]   = Convert.ToDouble(dr["_local_price"].ToString());

                dt.Rows.Add(row);
            }
            dr.Close();
            Session["dt"] = dt;
            Response.Redirect("shoplist.aspx");
        }
    }
Exemplo n.º 14
0
 protected void sous_Click(object sender, EventArgs e)
 {
     Model.product mym = new Model.product();
     mym.title = Text_title.Text;
     BLL.product myb = new BLL.product();
     DataSet ds = myb.select_title(mym);
     GridView1.DataSource = ds.Tables[0];
     GridView1.DataBind();
 }