Ejemplo n.º 1
0
 public void bing()
 {
     BLL.proimage myb = new BLL.proimage();
     DataSet ds = myb.select_sizeid(image_id.Text);
     DataList1.DataSource = ds.Tables[0];
     DataList1.DataBind();
 }
Ejemplo n.º 2
0
    protected void sc_Command(object sender, CommandEventArgs e)
    {
        string size_id = Convert.ToString(e.CommandArgument);

        BLL.size bsize = new BLL.size();
        int result = bsize.delete(size_id);
        BLL.proimage myb = new BLL.proimage();
        MySqlDataReader dr = myb.s_imageurl(size_id);
        BLL.proimage isize = new BLL.proimage();
        int i_result = isize.delete_1(size_id);

        dr.Read();

        string path = "~/" + dr["_imageurl"].ToString();
        dr.Close();

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

            File.Delete(Server.MapPath(path));
        }
        if (i_result > 0)
        {
            msg("删除成功!!");
            bing();
        }
    }
Ejemplo n.º 3
0
    protected void sc_Command(object sender, CommandEventArgs e)
    {
        string size_id = Convert.ToString(e.CommandArgument);

        BLL.size bsize  = new BLL.size();
        int      result = bsize.delete(size_id);

        BLL.proimage  myb = new BLL.proimage();
        SqlDataReader dr  = myb.s_imageurl(size_id);

        BLL.proimage isize    = new BLL.proimage();
        int          i_result = isize.delete_1(size_id);


        dr.Read();

        string path = "~/" + dr["_imageurl"].ToString();

        dr.Close();

        if (File.Exists(Server.MapPath(path)))
        {
            File.Delete(Server.MapPath(path));
        }
        if (i_result > 0)
        {
            msg("删除成功!!");
            bing();
        }
    }
Ejemplo n.º 4
0
    public string s_image(string image_id)
    {
        BLL.proimage b_image = new BLL.proimage();
        DataSet      ds      = b_image.select_sizeid(image_id);

        return(Convert.ToString(ds.Tables[0].Rows[0]["_imageurl"]));
    }
Ejemplo n.º 5
0
    protected void upimage_Click(object sender, EventArgs e)
    {
        if (FileUpload1.HasFile == false)
        {
            msg("您还没有选择图片!");
            return;
        }
        else
        {
            string filepath = FileUpload1.PostedFile.FileName;

            string fileEx = filepath.Substring(filepath.LastIndexOf(".") + 1);

            if (fileEx == "jpg" || fileEx == "bmp" || fileEx == "gif" || fileEx == "jpeg" || fileEx == "png")
            {
                sizela.Text = "";

                string newfilename = "show_" + System.DateTime.Now.ToString("yyyyMMddhhmmssfff") + "." + fileEx;

                FileUpload1.PostedFile.SaveAs(Server.MapPath("~/show_imageurl/" + newfilename));

                string savepath = "show_imageurl/" + newfilename;

                imageurl.Text = "../" + savepath;

                imagela.Text += "<img src=" + imageurl.Text + " style='" + "height: 180px; width: 120px" + "' />";


                string siz = DateTime.Now.ToString("yyyyMMddhhmmssfff");
                sizeidla.Text = siz;


                Model.proimage mym = new Model.proimage();
                mym.imageid  = _imageid.Text;
                mym.imageurl = savepath;
                mym.color    = colorselect.SelectedItem.Text;
                mym.sizeid   = sizeidla.Text;
                BLL.proimage bimage = new BLL.proimage();
                int          result = bimage.insert(mym);
                if (result > 0)
                {
                    //Model.proimage mmym = new Model.proimage();
                    //mmym.sizeid = sizeidla.Text;

                    //BLL.proimage bmy = new BLL.proimage();
                    //int select_id = bmy.selectid(mmym);

                    //proimage_id.Text = Convert.ToString(select_id);

                    msg("成功添加图片,接下来请选择所拥有图片");
                }
            }
            else
            {
                msg("你上传文件格式不正确!!!");
                return;
            }
        }
    }
Ejemplo n.º 6
0
    public void b_imag(string image_id)
    {
        BLL.proimage b_image  = new BLL.proimage();
        DataSet      ds_image = b_image.select_sizeid(image_id);

        DataList1.DataSource = ds_image.Tables[0];
        DataList1.DataBind();
    }
Ejemplo n.º 7
0
    public void bing()
    {
        BLL.proimage myb = new BLL.proimage();
        DataSet      ds  = myb.select_sizeid(image_id.Text);

        DataList1.DataSource = ds.Tables[0];
        DataList1.DataBind();
    }
Ejemplo n.º 8
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 + "");
        }
    }
Ejemplo n.º 9
0
    protected void b_color_Command(object sender, CommandEventArgs e)
    {
        BLL.proimage  myb         = new BLL.proimage();
        SqlDataReader dr_proimage = myb.image_update(Convert.ToString(e.CommandArgument));

        dr_proimage.Read();
        Image_1.ImageUrl = dr_proimage["_imageurl"].ToString();
        im_url           = Image_1.ImageUrl;
        img_url.Text     = im_url;

        dr_proimage.Close();
    }
Ejemplo n.º 10
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+"");
            }
    }
Ejemplo n.º 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            u_sizeid.Text = Request.QueryString["sizeid"].ToString();

            BLL.proimage  b_image = new BLL.proimage();
            SqlDataReader dr      = b_image.image_update(u_sizeid.Text);
            dr.Read();
            image_url.Text  = dr["_imageurl"].ToString();
            Image1.ImageUrl = "~/" + image_url.Text;
            image_id.Text   = dr["_imageid"].ToString();
            dr.Close();
            sbing();
        }
    }
Ejemplo n.º 12
0
    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();


            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["_market_price"].ToString()), 2).ToString();
            local.Text     = Math.Round(Convert.ToDecimal(dr_pro["_local_price"].ToString()), 2).ToString();
            image_id.Text  = dr_pro["_imageid"].ToString();
            title_l.Text   = dr_pro["_product_name"].ToString();
            content_s.Text = dr_pro["_describe"].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);
            DataList1.DataSource = ds_image.Tables[0];
            DataList1.DataBind();


            Image_1.ImageUrl = Convert.ToString(ds_image.Tables[0].Rows[0]["_imageurl"]);
            im_url           = Image_1.ImageUrl;
            img_url.Text     = im_url;
            d_color.Text     = Convert.ToString(ds_image.Tables[0].Rows[0]["_color"]);
            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;
                siz(sizeid.Text);
            }
        }
    }
Ejemplo n.º 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            u_sizeid.Text = Request.QueryString["sizeid"].ToString();

            BLL.proimage b_image = new BLL.proimage();
            MySqlDataReader dr = b_image.image_update(u_sizeid.Text);
            dr.Read();
            image_url.Text = dr["_imageurl"].ToString();
            Image1.ImageUrl = "~/" + image_url.Text;
            image_id.Text = dr["_imageid"].ToString();
            dr.Close();
            sbing();

        }
    }
Ejemplo n.º 14
0
    protected void upimage_Click(object sender, EventArgs e)
    {
        if (FileUpload1.HasFile == false)
        {
            msg("您还没有选择图片!");
            return;
        }
        else
        {
            string filepath = FileUpload1.PostedFile.FileName;

            string fileEx = filepath.Substring(filepath.LastIndexOf(".") + 1);

            if (fileEx == "jpg" || fileEx == "bmp" || fileEx == "gif" || fileEx == "jpeg" || fileEx == "png")
            {
                string newfilename = "show_" + System.DateTime.Now.ToString("yyyyMMddhhmmssfff") + "." + fileEx;

                FileUpload1.PostedFile.SaveAs(Server.MapPath("~/show_imageurl/" + newfilename));

                string savepath = "show_imageurl/" + newfilename;
                Image1.ImageUrl = "~/" + savepath;
                Model.proimage mym = new Model.proimage();
                mym.imageurl = savepath;
                mym.imageid  = image_id.Text;
                mym.sizeid   = u_sizeid.Text;
                BLL.proimage b_im   = new BLL.proimage();
                int          result = b_im.upimage(mym);
                if (result > 0)
                {
                    string path = "~/" + image_url.Text;

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


                    msg("更新成功!!");
                    Response.Redirect("proimageselect.aspx?imageid=" + image_id.Text + "");
                }
            }
        }
    }
Ejemplo n.º 15
0
    protected void upimage_Click(object sender, EventArgs e)
    {
        if (FileUpload1.HasFile == false)
        {
            msg("您还没有选择图片!");
            return;
        }
        else
        {

            string filepath = FileUpload1.PostedFile.FileName;

            string fileEx = filepath.Substring(filepath.LastIndexOf(".") + 1);

            if (fileEx == "jpg" || fileEx == "bmp" || fileEx == "gif" || fileEx == "jpeg" || fileEx == "png")
            {

                sizela.Text = "";

                string newfilename = "show_" + System.DateTime.Now.ToString("yyyyMMddhhmmssfff") + "." + fileEx;

                FileUpload1.PostedFile.SaveAs(Server.MapPath("~/show_imageurl/" + newfilename));

                string savepath = "show_imageurl/" + newfilename;

                imageurl.Text ="../"+ savepath;

                imagela.Text += "<img src=" + imageurl.Text + " style='" + "height: 180px; width: 120px" + "' />";

                string siz = DateTime.Now.ToString("yyyyMMddhhmmssfff");
                sizeidla.Text = siz;

                Model.proimage mym = new Model.proimage();
                mym.imageid = _imageid.Text;
                mym.imageurl = savepath;
                mym.color = colorselect.SelectedItem.Text;
                mym.sizeid = sizeidla.Text;
                BLL.proimage bimage = new BLL.proimage();
                int result = bimage.insert(mym);
                if (result > 0)
                {
                    //Model.proimage mmym = new Model.proimage();
                    //mmym.sizeid = sizeidla.Text;

                    //BLL.proimage bmy = new BLL.proimage();
                    //int select_id = bmy.selectid(mmym);

                    //proimage_id.Text = Convert.ToString(select_id);

                    msg("成功添加图片,接下来请选择所拥有图片");

                }

            }
            else
            {
                msg("你上传文件格式不正确!!!");
                return;

            }
        }
    }
Ejemplo n.º 16
0
    protected void upimage_Click(object sender, EventArgs e)
    {
        if (FileUpload1.HasFile == false)
        {
            msg("您还没有选择图片!");
            return;
        }
        else
        {

            string filepath = FileUpload1.PostedFile.FileName;

            string fileEx = filepath.Substring(filepath.LastIndexOf(".") + 1);

            if (fileEx == "jpg" || fileEx == "bmp" || fileEx == "gif" || fileEx == "jpeg" || fileEx == "png")
            {

                string newfilename = "show_" + System.DateTime.Now.ToString("yyyyMMddhhmmssfff") + "." + fileEx;

                FileUpload1.PostedFile.SaveAs(Server.MapPath("~/show_imageurl/" + newfilename));

                string savepath = "show_imageurl/" + newfilename;
                Image1.ImageUrl = "~/" + savepath;
                Model.proimage mym = new Model.proimage();
                mym.imageurl = savepath;
                mym.imageid = image_id.Text;
                mym.sizeid = u_sizeid.Text;
                BLL.proimage b_im = new BLL.proimage();
                int result = b_im.upimage(mym);
                if (result > 0)
                {
                    string path = "~/" + image_url.Text;

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

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

                    msg("更新成功!!");
                    Response.Redirect("proimageselect.aspx?imageid="+image_id.Text+"");
                }

            }
        }
    }
Ejemplo n.º 17
0
 public string s_image(string image_id)
 {
     BLL.proimage b_image = new BLL.proimage();
     DataSet ds = b_image.select_sizeid(image_id);
     return Convert.ToString(ds.Tables[0].Rows[0]["_imageurl"]);
 }