918博天堂

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/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : D:/tmp_aspnet/root/6b11be23/e503b68d/App_Web_b5ua9cso.1.cs
?#pragma checksum "D:\wwwroot\keman\wwwroot\Back\info\pic_more_Addfj.aspx.cs" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "CF0DAE9B25AEFF9A2281BD692B412A51"

#line 1 "D:\wwwroot\keman\wwwroot\Back\info\pic_more_Addfj.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_Addfj : 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";

    public string chid = "0";
    #endregion

    
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request["channelid"] != null && Request["channelid"].ToString() != "")
        {
            chid = Request["channelid"].ToString();
        }

         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 < 500000)//100000为100K  channelid
            //{
                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 != "")
                {
                    this.FileUpload2.SaveAs(Server.MapPath("../../HaodeUpload/UploadedFiles") + "\\" + dataName + "." + type);
                    string ProImg = "HaodeUpload/UploadedFiles/" + dataName + "." + type;
                   string  strimgs = "HaodeUpload/UploadedFiles/" + dataName + "." + type;

                   if (TextBox1.Text=="")
                    {
                        TextBox1.Text = dataName;
                    }
               
                   bs.user("insert into addfujian(tp_bt,stye_id,tp_url,tp_time) values('" + TextBox1.Text.Trim().Replace("'","") + "','" + infid + "','" + strimgs + "','" + System.DateTime.Now.ToString() + "')");


                   TextBox1.Text = "";

                      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('请选择复件');</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 addfujian  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 addfujian 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 addfujian where stye_id='" + infid + "' order by tp_id desc", GridView1);


        //this.GridView1.DataSource = ps;
        //this.GridView1.DataBind();

    }



    //判断 文件类型
    public string bangtp(string strss)
    {
        string uri_tp = "../../images/11.jpg";
        if (strss.IndexOf(".zip") > -1 || strss.IndexOf(".rar") > -1)
        {
            uri_tp = "../../images/rar.jpg";
        }

        else if (strss.IndexOf(".pdf") > -1)
        {
            uri_tp = "../../images/pdf.jpg";
        }
        else if (strss.IndexOf(".xls") > -1 )
        {
            uri_tp = "../../images/excel.jpg";
        }

        else if (strss.IndexOf(".doc") > -1 )
        {
            uri_tp = "../../images/wd.jpg";
        }

        else if (strss.IndexOf(".ppt") > -1)
        {
            uri_tp = "../../images/ppt.jpg";
        }
        return uri_tp;

    }


    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView1.PageIndex = e.NewPageIndex;
        dlBind();
    }








    

}


#line default
#line hidden