/// <summary> /// 删除 /// </summary> /// <param name="id"></param> protected void DelPic(string id) { string bind = string.Empty; bool falg = false; try { Hi.Model.BD_ShopImageList shopi = new Hi.BLL.BD_ShopImageList().GetModel(id.ToInt(0)); if (shopi != null) { shopi.dr = 1; falg = new Hi.BLL.BD_ShopImageList().Update(shopi); } } catch (Exception) { falg = false; } bind = "{\"ds\":\"" + falg + "\"}"; Response.Write(bind); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { if (Request["action"] + "" == "del") { var id = Request["tip"] + ""; DelPic(id); } if (!IsPostBack) { List <Hi.Model.BD_ShopImageList> l = new Hi.BLL.BD_ShopImageList().GetList("", "isnull(dr,0)=0 and compId=" + this.CompID + " and type=2", ""); if (l.Count > 0) { int i = 0; foreach (Hi.Model.BD_ShopImageList item in l) { i++; switch (i) { case 1: this.imgAvatar1.Src = "Goodsimages/" + item.ImageUrl; pic1 = item.ImageUrl; url1 = item.GoodsUrl.ToString(); id1 = item.ID; break; case 2: this.imgAvatar2.Src = "Goodsimages/" + item.ImageUrl; pic2 = item.ImageUrl; url2 = item.GoodsUrl.ToString(); id2 = item.ID; break; case 3: this.imgAvatar3.Src = "Goodsimages/" + item.ImageUrl; pic3 = item.ImageUrl; url3 = item.GoodsUrl.ToString(); id3 = item.ID; break; case 4: this.imgAvatar4.Src = "Goodsimages/" + item.ImageUrl; pic4 = item.ImageUrl; url4 = item.GoodsUrl.ToString(); id4 = item.ID; break; case 5: this.imgAvatar5.Src = "Goodsimages/" + item.ImageUrl; pic5 = item.ImageUrl; url5 = item.GoodsUrl.ToString(); id5 = item.ID; break; } } } } }
public string GetBannerTopImg(string type, int TypeId) { List <Hi.Model.BD_ShopImageList> ShopList = ShopList = new Hi.BLL.BD_ShopImageList().GetList("GoodsUrl,ImageUrl", " dr=0 and Compid=" + CompID + "", "id"); if (ShopList.Count == 0) { return(""); } string str = string.Empty; switch (type) { case "Img": str = ShopList.Count >= TypeId ? (ShopList[TypeId - 1].ImageUrl == "" ? "/images/Goods400x400.jpg" : ConfigurationManager.AppSettings["ImgViewPath"] + "CompFiveImg/" + ShopList[TypeId - 1].ImageUrl) : "/images/Goods400x400.jpg"; break; case "GoodsUrl": str = ShopList.Count >= TypeId ? (ShopList[TypeId - 1].GoodsUrl.ToString() == "" ? "#" : ShopList[TypeId - 1].GoodsUrl) : "javascript:;"; break; } return(str); }
protected void Page_Load(object sender, EventArgs e) { object obj = Request["KeyID"]; if (obj != null) { comPid = Convert.ToInt32(obj.ToString()); } if (!IsPostBack) { if (comPid != 0) { List <Hi.Model.BD_ShopImageList> l = new Hi.BLL.BD_ShopImageList().GetList("", "isnull(dr,0)=0 and compId=" + comPid + " and type=2", ""); if (l.Count > 0) { int i = 0; foreach (Hi.Model.BD_ShopImageList item in l) { i++; switch (i) { case 1: this.imgAvatar1.Src = "Goodsimages/" + item.ImageUrl; pic1 = item.ImageUrl; url1 = item.GoodsUrl.ToString(); id1 = item.ID; break; case 2: this.imgAvatar2.Src = "Goodsimages/" + item.ImageUrl; pic2 = item.ImageUrl; url2 = item.GoodsUrl.ToString(); id2 = item.ID; break; case 3: this.imgAvatar3.Src = "Goodsimages/" + item.ImageUrl; pic3 = item.ImageUrl; url3 = item.GoodsUrl.ToString(); id3 = item.ID; break; case 4: this.imgAvatar4.Src = "Goodsimages/" + item.ImageUrl; pic4 = item.ImageUrl; url4 = item.GoodsUrl.ToString(); id4 = item.ID; break; case 5: this.imgAvatar5.Src = "Goodsimages/" + item.ImageUrl; pic5 = item.ImageUrl; url5 = item.GoodsUrl.ToString(); id5 = item.ID; break; } } } } else { // JScript.AlertMsgOne(this, "厂商Id有误", JScript.IconOption.错误); JScript.AlertMethod(this, "厂商Id有误", JScript.IconOption.错误, "function(){ window.location.href='../../admin/systems/CompList.aspx'; }"); return; } } }