protected void btn_ServerClick(object sender, EventArgs e) { Img img = new Img(); img.savePathName = "files"; string path = img.saveImage(""); if (img.error == "") { AlbumInfo info = new AlbumInfo(); info.album_name = path; info.imgUrl = path; info.showHome = false; info.linkUrl = ""; AlbumDal al = new AlbumDal(); int id = al.add(info); StringBuilder sb = new StringBuilder(); sb.Append("<span style='font-size:12px;BACKGROUND: #F7F7F7;'>上传成功!"); sb.Append("<a href=\"javascript:;\" onClick=\"parent.addContent(iname);\">插入</a> "); sb.Append("<a href=\"javascript:history.back();\">继续上传</a></span>"); sb.Append("<script language=\"JavaScript\">"); sb.Append("var iname=\""+gform("up_name")+"\";"); sb.Append("parent.document.getElementById(iname).value=\"" + path + "\";</script>;"); die(sb.ToString()); } else { Response.Write(img.error+" <a href=\"javascript:history.back()\">返回</a>"); Response.End(); } }
protected void btn_ServerClick(object sender, EventArgs e) { Img img = new Img(); img.savePathName = "album"; string path = img.saveImage(""); if (img.error == "") { AlbumInfo info = new AlbumInfo(); info.album_name = path; info.imgUrl = path; if (showHome.Checked) info.showHome = true; else info.showHome = false; info.linkUrl = linkUrl.Value; AlbumDal al = new AlbumDal(); int id = al.add(info); showMessage("上传成功<br/>图片地址:<a href=\"" + path + "\" target=\"_blank\">" + path + "</a>"); } else { showMessage(img.error); } }
private void bind_del(int id) { AlbumDal al = new AlbumDal(); if (al.del(id)) showMessage("删除成功"); else showMessage("删除失败"); }
private void bind_update(int id, string showHome) { AlbumInfo info = new AlbumInfo(); if (showHome == "True") info.showHome = true; else info.showHome = false; AlbumDal al = new AlbumDal(); al.updateShomeHome(id, info); //throw new Exception("The method or operation is not implemented."); }
protected void setBind(object sender, EventArgs e) { AlbumDal al = new AlbumDal(); int page = 1; int pagesize = 10; PageCurrent pc = new PageCurrent(); page = pc.get("page"); DataTable dt = al.GetList(page, pagesize); int recordcount = findcount("album"); Pageer.value = pc.page_list("?page=", pagesize, recordcount); detail.DataSource = dt; detail.DataBind(); }