//编辑绑定 private void editProduct(int id) { ProductDal red = new ProductDal(); ProductInfo pro = red.read(id); ProductName.Value = pro.productName; title1.Value = pro.title1; //title2.Value = "";//pro.title2; content.Value = pro.content; content1.Value = pro.content1; content2.Value = pro.content2; content3.Value = pro.content3; articleImg.Src = pro.productImgUrl; listImgA.HRef = pro.productImgUrl; filePath.Value = pro.productImgUrl; int TypeId = pro.TypeId; foreach (ListItem list in typeId.Items) { if (list.Value.ToString() == TypeId.ToString()) { list.Selected = true; break; } } }
private void bind_update(int id, string showHome) { ProductInfo info = new ProductInfo(); if (showHome == "True") info.showHome = true; else info.showHome = false; ProductDal dal = new ProductDal(); dal.setShowHome(id, info); }
public List<ProductInfo> search() { ProductDal pro = new ProductDal(); int id = 0; gnum(ref id, "tid"); int page = 1; int pagesize = 12; PageCurrent pc = new PageCurrent(); page = pc.get("page"); List<JoleYe.Model.ProductInfo> list = pro.view_list(id,page,pagesize); int recordcount = pro.recordcount; pageBox = pc.page_list("?page=", pagesize, recordcount); return list; }
protected void create_279_thumbs_Click(object sender, EventArgs e) { List<ProductInfo> list = new List<ProductInfo>(); ProductDal dal = new ProductDal(); list = dal.view_list(); foreach (ProductInfo info in list) { if (dal.set_thumbs_img(info.Id, 279, "small")) { Response.Write("成功 <a target=\"_blank\" href=\"" + cimg(info.productImgUrl, "small") + "\">" + cimg(info.productImgUrl, "small") + "</a><br/>"); } else Response.Write("<font color=red>失败</font> " + info.productImgUrl + "<br/>"); } }
private void setBind() { int pagesize = 10; int page = 1; int recordcount=2; PageCurrent pc = new PageCurrent(); page = pc.get("page"); wd.Value = keyword; //DataTable dt = find("view_product", page, pagesize, " showId ,id desc"); ProductDal p = new ProductDal(); Pageer.value = pc.page_list("?page=", pagesize, recordcount); detail.DataSource = p.view_list(page, pagesize, 0, keyword); detail.DataBind(); }
public bool bind_del(int id) { ProductDal sd = new ProductDal(); return sd.del(id); }
private void setOrder(int id, int showId) { ProductDal sd = new ProductDal(); sd.setOrder(id, showId); }
//保存 protected void Submit1_ServerClick(object sender, EventArgs e) { ProductInfo proinfo = new ProductInfo(); proinfo.productName = ProductName.Value.ToString(); proinfo.title1 = title1.Value.ToString(); proinfo.title2 = "";//title2.Value.ToString(); proinfo.TypeId = Int32.Parse(typeId.Text); proinfo.content = content.Value.ToString(); proinfo.content1 = content1.Value.ToString(); proinfo.content2 = content2.Value.ToString(); proinfo.content3 = content3.Value.ToString(); Img im = new Img(); im.savePathName = "products"; proinfo.productImgUrl = im.saveImage(filePath.Value); if (string.IsNullOrEmpty(im.error)) { ProductDal dal = new ProductDal(); if (app == "edit") { proinfo.Id = id; dal.updateProduct(proinfo); editProduct(id); } else { dal.createProduct(proinfo); } showMessage("保存成功", "manage.aspx"); } else { showMessage("出现了错误:"+im.error); } }