protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Weifenxiao.Entity.ShufflingImgEntity model = Weifenxiao.BLL.ShufflingImgBLL.GetInstance().Get_ShufflingImgEntity(0); if (model != null) { imgUrl = model.ImgUrl; linkUrl = model.LinkUrl; imgUrl2 = model.ImgUrl2; imgUrl3 = model.ImgUrl3; linkUrl2 = model.LinkUrl2; linkUrl3 = model.LinkUrl3; } UserIdentity identity = User.Identity as UserIdentity; if (identity != null) { List <Weifenxiao.Entity.ProductClsEntity> list = Weifenxiao.BLL.ProductClsBLL.GetInstance().Get_ProductClsListAll(identity.ShopID) as List <Weifenxiao.Entity.ProductClsEntity>; if (list != null && list.Count > 0) { dropimgclslist.DataSource = list; dropimgclslist.DataTextField = "CLSNAME"; dropimgclslist.DataValueField = "CLSID"; dropimgclslist.DataBind(); ListItem lt = new ListItem("--首页--", "0"); dropimgclslist.Items.Insert(0, lt); } } } }
public void showdata(int clsId) { Weifenxiao.Entity.ShufflingImgEntity model = Weifenxiao.BLL.ShufflingImgBLL.GetInstance().Get_ShufflingImgEntity(clsId); string json = String.Empty; if (model != null) { json = "{\"MessageBox\":\"查询数据成功\",\"imgurl\":\"" + model.ImgUrl + "\",\"imgurl2\":\"" + model.ImgUrl2 + "\",\"imgurl3\":\"" + model.ImgUrl3 + "\",\"linkurl\":\"" + model.LinkUrl + "\",\"linkurl2\":\"" + model.LinkUrl2 + "\",\"linkurl3\":\"" + model.LinkUrl3 + "\"}"; } else { json = "{\"MessageBox\":\"未查找到数据\"}"; } Response.Write(Jnwf.Utils.Json.JsonHelper.SerializeJson(json)); }
public void updateImg(string imgUrl, int clsId, string linkurl, string imgUrl2, string imgUrl3, string linkUrl2, string linkUrl3) { try { Weifenxiao.Entity.ShufflingImgEntity model = Weifenxiao.BLL.ShufflingImgBLL.GetInstance().Get_ShufflingImgEntity(clsId); if (model != null) { model.ImgUrl = SqlInject(imgUrl); model.Updatetime = DateTime.Now; model.LinkUrl = SqlInject(linkurl); model.LinkUrl2 = SqlInject(linkUrl2); model.LinkUrl3 = SqlInject(linkUrl3); model.ImgUrl2 = SqlInject(imgUrl2); model.ImgUrl3 = SqlInject(imgUrl3); int i = Weifenxiao.BLL.ShufflingImgBLL.GetInstance().Update(model); if (i > 0) { Response.Write(1); } } else { Weifenxiao.Entity.ShufflingImgEntity tmodel = new Weifenxiao.Entity.ShufflingImgEntity(); tmodel.ImgUrl = SqlInject(imgUrl); tmodel.ClsId = clsId; tmodel.Addtime = DateTime.Now; tmodel.Updatetime = DateTime.Now; tmodel.LinkUrl = SqlInject(linkurl); tmodel.LinkUrl2 = SqlInject(linkUrl2); tmodel.LinkUrl3 = SqlInject(linkUrl3); tmodel.ImgUrl2 = SqlInject(imgUrl2); tmodel.ImgUrl3 = SqlInject(imgUrl3); int i = Weifenxiao.BLL.ShufflingImgBLL.GetInstance().Insert(tmodel); if (i > 0) { Response.Write(1); } } } catch (Exception ex) { Response.Write(-1); } }