|
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/6b11be23/e503b68d/ |
?#pragma checksum "D:\wwwroot\keman\wwwroot\Back\info\pic_more_Add.aspx.cs" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "394695D8FA0A28F87CF651A47D295596"
#line 1 "D:\wwwroot\keman\wwwroot\Back\info\pic_more_Add.aspx.cs"
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.IO;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.OleDb;
using CoreClass;
using System.Data.SqlClient;
public partial class Back_Info_pic_more_Add : System.Web.UI.Page
{
#region 域界说
CoreClass.DBCommon dbc = new DBCommon();
CoreClass.PublicFunction pubfun = new PublicFunction();
Zhongbiao bs = new Zhongbiao();
public int adminid;
public int channelid;
public string col = "info";
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
if (Request["id"] != null && Request["id"].ToString()!="")
{
DataSet dts = new DataSet();
dts = bs.chaxun("select top 1 * from Info where Infoid=" + Request["id"].ToString() );
if (dts.Tables[0].Rows.Count > 0)
{
Label1.Text = dts.Tables[0].Rows[0]["title"].ToString();
}
}
dlBind();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
if (Request["id"] != null && Request["id"].ToString() != "")
{
string infid = Request["id"].ToString();
if (FileUpload2.PostedFile.ContentLength < 500000000)//100000为100K channelid tp_bt
{
string fileFullname = this.FileUpload2.FileName;
string dataName = DateTime.Now.ToString("yyyyMMddhhmmss");
string fileName = fileFullname.Substring(fileFullname.LastIndexOf("\\") + 1);
string type = fileFullname.Substring(fileFullname.LastIndexOf(".") + 1);
if (type == "bmp" || type == "jpg" || type == "gif" || type == "JPG" || type == "BMP" || type == "GIF" || type == "png" || type == "PNG")
{
this.FileUpload2.SaveAs(Server.MapPath("../../HaodeUpload/UploadedFiles") + "\\" + dataName + "." + type);
string ProImg = "HaodeUpload/UploadedFiles/" + dataName + "." + type;
string strimgs = "HaodeUpload/UploadedFiles/" + dataName + "." + type;
string tpbt = TextBox1.Text.Trim().Replace("'","");
bs.user("insert into addpic(stye_id,tp_url,tp_time,tp_bt) values('" + infid + "','" + strimgs + "','" + System.DateTime.Now.ToString() + "','" + tpbt + "')");
//if (Session["AdminPassport"] != null && Session["AdminPassport"].ToString() != "")
//{
// bs.user("insert into rizhi(rz_bt,rz_nr,rz_czr,rz_time) values('增长" + Label1.Text + "栏眼前更多图片','" + strimgs + "','" + Session["AdminPassport"].ToString() + "','" + System.DateTime.Now.ToString() + "' )");
//}
//bs.java("增长成功", "pic_more_Add.aspx?channelid='" + Request["channelid"].ToString() + "'&id='" + Request["id"].ToString() + "'");
//bs.javascript("增长成功");
dlBind(); //再次加载
}
else
{
Response.Write("<script language='javascript'>alert('支持体式:|jpg|gif|bmp|png');</script>");
}
}
else
{
Response.Write("<script language='javascript'>alert('你的图片已经超过500K的大�。�');</script>");
}
}
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
((LinkButton)(e.Row.Cells[4].Controls[0])).Attributes.Add("onclick", "return confirm('确定要删除吗?')");
}
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int id = int.Parse(GridView1.DataKeys[e.RowIndex].Value.ToString());//删除数据字段;
//DataSet dt_zhianss = bs.chaxun("select top 1 * from addpic where tp_id=" + id);
//if (dt_zhianss.Tables[0].Rows.Count > 0)
//{
// string sssss="删除" + Label1.Text + "栏眼前图片";
// if (Session["AdminPassport"] != null && Session["AdminPassport"].ToString() != "")
// {
// bs.user("insert into rizhi(rz_bt,rz_nr,rz_czr,rz_time) values('" + sssss + "','" + dt_zhianss.Tables[0].Rows[0]["tp_url"].ToString() + "','" + Session["AdminPassport"].ToString() + "','" + System.DateTime.Now.ToString() + "' )");
// }
//}
bs.user("delete from addpic where tp_id=" + id);
dlBind();
}
public void dlBind()
{
string infid = "0";
if (Request["id"] != null && Request["id"].ToString() != "")
{
infid = Request["id"].ToString();
}
bs.bind("select * from addpic where stye_id='" + infid + "' order by tp_id desc", GridView1);
//this.GridView1.DataSource = ps;
//this.GridView1.DataBind();
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
dlBind();
}
}
#line default
#line hidden