public void get_productType(int typeId) { ProductTypeDal type = new ProductTypeDal(); ProductTypeInfo info = type.read(typeId); p_typename = info.typeName; p_parenttypename = type.read(info.parentId).typeName; }
private void editBind() { ProductTypeDal da = new ProductTypeDal(); ProductTypeInfo tpinfo = da.read(getId("id")); ProductTypeName.Value = tpinfo.typeName; imgUrl.Value = tpinfo.imgUrl; orderId.Value = tpinfo.orderId.ToString(); content.Value = tpinfo.content; if (tpinfo.imgUrl != "") view_img.InnerHtml = "<a href=\"" + tpinfo.imgUrl + "\" target=\"_blank\">查看</a>"; }
protected void save_ServerClick(object sender, EventArgs e) { string TypeName = ProductTypeName.Value.ToString(); string err; if (TypeName != "") { ProductTypeInfo info = new ProductTypeInfo(); ProductTypeDal ad = new ProductTypeDal(); Img img = new Img(); img.savePathName = "producttype"; if (action == "edit") { string delimg = pform("delimg"); if (delimg == "1") { img.dropimg(imgUrl.Value); info.imgUrl = ""; } else { info.imgUrl = img.saveImage(imgUrl.Value); } if (img.error != "") showMessage(img.error); info.typeName = ProductTypeName.Value; info.orderId = int.Parse(orderId.Value); info.id = getId("id"); info.content = pform("content"); ad.Update(info); err = "修改成功"; } else { info.typeName = TypeName; info.orderId = int.Parse(orderId.Value); info.imgUrl = img.saveImage(""); info.content = pform("content"); if (img.error != "") showMessage(img.error); int id = 0; gnum(ref id, "id"); info.parentId = id; ad.AddType(info); err = "添加成功"; } showMessage(err, "pro_type.aspx"); } else { labelErr.Text = "<font color=red>不能为空</font>"; } }
public void bind_Del(int id) { ProductTypeDal tp = new ProductTypeDal(); tp.DelType(id); }
public List<ProductTypeInfo> getprotypelist() { ProductTypeDal pt = new ProductTypeDal(); return pt.Getbigtypelist(); }