|
Server : Microsoft-IIS/10.0 System : Windows NT EBS-6136 10.0 build 17763 (Windows Server 2016) i586 User : jxgj ( 0) PHP Version : 7.0.33 Disable Function : passthru,exec,system,shell_exec,proc_open,popen,pcntl_exec,socket_bind,stream_socket_server Directory : D:/tmp_aspnet/root/04556082/ecc0c5af/ |
?#pragma checksum "d:\wwwroot\gzgunuo\wwwroot\qiao\tp2.aspx.cs" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "621BCBC7D2D07D23AC9602CD3F3E3059"
#line 1 "d:\wwwroot\gzgunuo\wwwroot\qiao\tp2.aspx.cs"
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using Model;
public partial class cn_Admin_tp : System.Web.UI.Page
{
private int XID { get { return Convert.ToInt32(Request.QueryString["XID"]); } }
public string Width { get { return Convert.ToString(Request.QueryString["w"]); } }
public string Name { get { return Convert.ToString(Request.QueryString["n"]); } }
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataBind();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
if (this.XID <= 0)
return;
if (FileUpload1.HasFile)
{
Gong g = new Gong();
string fileName = DateTime.Now.ToFileTimeUtc().ToString(); //获取系统功夫作为文件名字
string path = Server.MapPath("~/download");
string FileType = Path.GetExtension(FileUpload1.FileName).ToLower();//拓展名
string path1 = path + @"\" + fileName + FileType;
FileUpload1.SaveAs(path1);
g.ImgUrl = fileName + FileType;
g.tableName = this.textAlt.Text.Trim();
g.ImgUrl = fileName + FileType;
g.Title = this.textAlt.Text;
g.CID = this.XID;
g.Alt = "";
if (SqlManager.Addtupian(g) > 0)
Response.Write(string.Format("<script>alert('增长成功');location.href='tp2.aspx?XID={0}&w={1}&n={2}';</script>", this.XID, this.Width, this.Name));
else
Response.Write(string.Format("<script>alert('增长失败');location.href='tp2.aspx?XID={0}&w={1}&n={2}';</script>", this.XID, this.Width, this.Name));
}
}
public void DataBind()
{
this.Repeater1.DataSource = SqlManager.GettupianList(this.XID);
this.Repeater1.DataBind();
}
protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
{
if (e.CommandName == "Del")
{
int id = Convert.ToInt32(e.CommandArgument);
string ImgUrlStr = SqlManager.Gettupian(id).ImgUrl;
//删除图片
StringHelper.DelImgFile(Server.MapPath("~/download/" + @"\"), ImgUrlStr, this.Name);
SqlManager.Deltupian(id);
}
if (e.CommandName == "up")
{
string KindID = e.CommandArgument.ToString().Split(',')[0];
int itemIndex = Convert.ToInt32(e.CommandArgument.ToString().Split(',')[1]);
TextBox TextBox1 = this.Repeater1.Items[itemIndex].FindControl("text") as TextBox;
if (TextBox1.Text.Trim() != "")
SqlManager.Get("update tupian set [Order]=" + TextBox1.Text + " where Id=" + KindID);
}
DataBind();
}
}
#line default
#line hidden