public void bing() { BLL.proimage myb = new BLL.proimage(); DataSet ds = myb.select_sizeid(image_id.Text); DataList1.DataSource = ds.Tables[0]; DataList1.DataBind(); }
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"])); }
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(); }
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 + ""); } }
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+""); } }
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); } } }
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"]); }