/// <summary> /// 添加 /// </summary> /// <param name="minfo"></param> private void AddAd(AdMsgInfo minfo) { try { //写入数据库 AdMsg admsg = new AdMsg(); if (Request.QueryString["action"] == "edit")//修改 { CreatJs.CreatepicFile(minfo); minfo.id = int.Parse(Request.QueryString["id"].ToString()); admsg.UpdateAd(minfo); } else { //添加 admsg.AddAd(minfo); int id = admsg.AdMaxid(); //生成JS string getpath = CreatJs.CreatepicFile(minfo); //完成操作 admsg.AdUpdateJs(id, getpath); } Response.Write("完成"); } catch (Exception ex) { Response.Write(ex.ToString()); } }
private void BindDataAd(string getsid) { AdMsg admsg = new AdMsg(); RepAdList.DataSource = admsg.GetList("sid=" + getsid); RepAdList.DataBind(); }
private void BindDataAd() { AdMsg admsg = new AdMsg(); AdMsgInfo minfo = admsg.GetModelAd(int.Parse(_adid)); if (minfo != null) { txtAd.Text = "<script src=\"" + minfo.adjs.ToString() + "\"></script>"; } }
private void BindDataEdit() { AdMsg admsg = new AdMsg(); AdMsgInfo minfo = admsg.GetModelAd(int.Parse(Request.QueryString["id"].ToString())); if (minfo != null) { BindDataSort(minfo.sid.ToString()); txtTitle.Text = minfo.adname; txtPic.Text = minfo.adpic; txtUrl.Text = minfo.adurl; txtWidth.Text = minfo.adwidth.ToString(); txtHeight.Text = minfo.adheight.ToString(); hiddJs.Value = minfo.adjs; //绑定所属类型 try { radType.Items.FindByValue(minfo.adtype.ToString()).Selected = true; } catch { } } }