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_s9topc2h.1.cs
?#pragma checksum "D:\wwwroot\keman\wwwroot\Back\info\zInfo_Add.aspx.cs" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "77F3480482F6223D1572B14DB6117ADF"

#line 1 "D:\wwwroot\keman\wwwroot\Back\info\zInfo_Add.aspx.cs"
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
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;

public partial class Back_Info_zInfo_Add : System.Web.UI.Page
{
    #region 域界说
    protected CoreClass.DBCommon dbc = new DBCommon();
    protected CoreClass.PublicFunction pubfun = new PublicFunction();
    public int channelid=0;
    public int id;
    public string col = "zInfo";
    Zhongbiao bs = new Zhongbiao();
    #endregion
    protected void Page_Load(object sender, EventArgs e)
    {

        

        if (pubfun.IsNumeric(Request.QueryString["ChannelId"])) this.channelid = Int32.Parse(Request.QueryString["ChannelId"].Trim());
        if (pubfun.IsNumeric(Request.QueryString["id"])) this.id = Int32.Parse(Request.QueryString["id"].Trim());

        //再次验证是否有权限 显示操作页面
        //this.pubfun.checkAdminAccessRights(this.Page, "zInfo_" + this.channelid.ToString());
        this.LeadClass1.channelid = this.channelid;
        //this.contentEditor.AssetManager = new Uri(Request.Url, "/Editor/AssetManager/AssetManager.aspx").AbsolutePath;
        pubfun.RegisterAdminPageClientScriptBlock(Page);
        //col = pubfun.GetCol(this.channelid);
        if (channelid == 14 || channelid==15)
        {
            movtxt.Text = "大图";
            PlaceMov.Visible = false;
        }
        if (!IsPostBack)
        {
            this.InitPage();
        }

        beiyong.Visible = true;
        Imhongtou.Visible = false;
        Tr1.Visible = false;
        Tr3.Visible = true;
        
        
    }

    #region 页面初始化
    private void InitPage()
    {

        //DataSet dt_ysj = new DataSet();

        //dt_ysj = bs.bingding("select * from zInfo where channelid=2");

        //DropDownList2.DataSource = dt_ysj.Tables[0].DefaultView;
        //DropDownList2.DataTextField= dt_ysj.Tables[0]

        //bs.bingding("select * from class where channelid=2 order by Classid", DropDownList2, "Classid", "Classname");
        //DropDownList2



        this.iptDatetime.Text = DateTime.Now.ToString("yyyy-MM-dd");
        this.iptViewcount.Text = "0";
        if (this.Request.QueryString["id1"] != null) this.LeadClass1.classid1 = Convert.ToInt16(this.Request.QueryString["id1"]);
        if (this.Request.QueryString["id2"] != null) this.LeadClass1.classid2 = Convert.ToInt16(this.Request.QueryString["id2"]);
        if (this.Request.QueryString["id3"] != null) this.LeadClass1.classid3 = Convert.ToInt16(this.Request.QueryString["id3"]);
        if (this.Request.QueryString["id4"] != null) this.LeadClass1.classid4 = Convert.ToInt16(this.Request.QueryString["id4"]);
        if (this.Request.QueryString["id5"] != null) this.LeadClass1.classid5 = Convert.ToInt16(this.Request.QueryString["id5"]);
        OleDbDataReader dr = dbc.GetDataReaderBySql("select * from classchannel where channelid=" + this.channelid);
        if (dr.Read())
        {
            this.fenlei.Visible = Convert.ToBoolean(dr["fenlei"]);
            this.mingcheng.Visible = Convert.ToBoolean(dr["mingcheng"]);
            this.lianjie.Visible = Convert.ToBoolean(dr["lianjie"]);
            this.beiyong.Visible = Convert.ToBoolean(dr["beiyong"]);
            this.tupian.Visible = Convert.ToBoolean(dr["tupian"]);
            this.kuan.Visible = Convert.ToBoolean(dr["kuan"]);
            this.gao.Visible = Convert.ToBoolean(dr["gao"]);
            this.shiping.Visible = Convert.ToBoolean(dr["shiping"]);
            this.zhaiyao.Visible = Convert.ToBoolean(dr["zhaiyao"]);
            this.xiangxi.Visible = Convert.ToBoolean(dr["xiangxi"]);
            this.tuijian.Visible = Convert.ToBoolean(dr["tuijian"]);
            this.redian.Visible = Convert.ToBoolean(dr["redian"]);
            this.dianji.Visible = Convert.ToBoolean(dr["dianji"]);
            this.paixu.Visible = Convert.ToBoolean(dr["paixu"]);
            this.classTitle.Text = dr["title"].ToString();



            gao.Visible = true;
            kuan.Visible = true;
            zhaiyao.Visible = true;
            lianjie.Visible = true;
 
        }
        dr.Close();

        if (id > 0)
        {
            DataRow row = dbc.ReadOneRow(col, "[Infoid]=" + this.id.ToString());
            if (row != null)
            {
                int classid = Int32.Parse(row["classid"].ToString());
                int classid1, classid2, classid3, classid4, classid5;
                pubfun.putAjaxClassId(out classid1, out classid2, out classid3, out classid4, out classid5, classid.ToString());
                LeadClass1.classid1 = classid1;
                LeadClass1.classid2 = classid2;
                LeadClass1.classid3 = classid3;
                LeadClass1.classid4 = classid4;
                LeadClass1.classid5 = classid5;

                this.title.Text = row["Title"].ToString();
                this.url.Text = row["url"].ToString();

                if (row["bei"].ToString().IndexOf("|") > -1)
                {
                    string[] stesss = row["bei"].ToString().Split('|');
                    if (stesss.Length == 3)
                    {
                        this.bei.Text = stesss[0].ToString() + "|" + stesss[1].ToString();

                    }
                }
                else
                {
                    this.bei.Text = row["bei"].ToString();
                }

                this.Pic.Text = row["Pic"].ToString();
                //this.HaodeUpload.parentSRC = row["Pic"].ToString();
                this.width.Text = row["width"].ToString();
                this.height.Text = row["height"].ToString();
                this.Mov.Text = row["Mov"].ToString();
                //this.HaodeUpload1.parentSRC = row["Mov"].ToString();
                this.econtent.Text = row["econtent"].ToString().Trim().Replace(" ", "");
                
                content1.Value = row["Content"].ToString();
                //this.contentEditor.Text = row["Content"].ToString();
                this.chkPass.Checked = Convert.ToBoolean(row["Inspect"].ToString());
                this.chkRecommend.Checked = Convert.ToBoolean(row["Recommend"].ToString());
                this.hot.Checked = Convert.ToBoolean(row["hot"].ToString());
                this.iptDatetime.Text = row["addTime"].ToString();
                this.iptViewcount.Text = row["Hits"].ToString();
                this.ordernum.Text = row["ordernum"].ToString();

                TextBox2.Text = row["cityid"].ToString();

                TextBox3.Text = row["yishujiaid"].ToString();

                TextBox64.Text = row["uid"].ToString();

            }
        }
    }
    #endregion

    #region 增长处置
    protected void btnOk_Click(object sender, System.EventArgs e)
    {
        //if (!pubfun.IsBlank(Pic.Text)) this.HaodeUpload.parentSRC = Pic.Text;
        //if (!pubfun.IsBlank(Mov.Text)) this.HaodeUpload1.parentSRC = Mov.Text;
        int classid = 0;
        classid = pubfun.GetAjaxClassId(Request.Form["ddl1"], Request.Form["ddl2"], Request.Form["ddl3"], Request.Form["ddl4"], Request.Form["ddl5"]);
        //if (classid == 0)
        //{
        //    pubfun.Alert(Page, "请选择分类!");
        //    return;
        //}
        if (pubfun.IsBlank(this.title.Text))
        {
            this.DropDownList1.SelectedValue = "选择红头文件";
            pubfun.Alert(Page, "请填写标题!");
            title.Focus();
            return;
        }
        //if (DropDownList1.SelectedValue.ToString() != "选择红头文件")
        //{
        //    title.Text = title.Text + "|" + this.DropDownList1.SelectedValue.ToString() + "|" + this.TextBox64.Text.ToString();
        //}


        //if (!pubfun.IsNumeric(this.iptViewcount.Text))
        //{
        //    pubfun.Alert(Page, "点击量只能是数字!");
        //    iptViewcount.Focus();
        //    return;
        //}
        //if (!pubfun.IsNumeric(this.ordernum.Text))
        //{
        //    pubfun.Alert("排序只能是数字!", -1);
        //    ordernum.Focus();
        //    return;
        //}
        if (pubfun.IsBlank(this.econtent.Text))
        {
            this.econtent.Text = " ";
        }
        if (pubfun.IsBlank(this.content1.Value))
        {
            this.content1.Value = " ";
        }

       
            //bei.Text = bei.Text + "|" + Session["AdminPassport"].ToString();




        string sql = "Insert Into " + col + "(channelid,Classid,cityid,title,url,bei,pic,width,height,Mov,econtent,Content,inspect,recommend,hot,Hits,addtime,ordernum,yishujiaid,uid) values(" + this.channelid + ","+ classid +",'" + TextBox2.Text.ToString() + "','"+  title.Text.ToString() +"','"+  url.Text.ToString() +"','"+  bei.Text.ToString() +"','"+  Pic.Text.ToString() +"','"+  width.Text.ToString() +"','"+  height.Text.ToString() +"','"+  Mov.Text.ToString() +"','"+  econtent.Text.ToString() +"','"+  content1.Value +"',"+  chkPass.Checked +","+  chkRecommend.Checked +","+  hot.Checked +",'"+ Int32.Parse(this.iptViewcount.Text.Trim()) +"','"+  this.iptDatetime.Text.Trim() +"','"+  ordernum.Text +"','" + TextBox3.Text.ToString() + "','" + TextBox64.Text.ToString() + "')";
        if (id > 0)
        {
            sql = "update " + col + " set Classid="+ classid +",cityid='" + TextBox2.Text.ToString() + "',title='"+  title.Text.ToString() +"',url='"+  url.Text.ToString() +"',bei='"+  bei.Text.ToString() +"',Pic='"+  Pic.Text.ToString() +"',width='"+  width.Text.ToString() +"',height='"+  height.Text.ToString() +"',Mov='"+  Mov.Text.ToString() +"',econtent='"+  econtent.Text.ToString() +"',Content='"+  content1.Value +"',inspect="+  chkPass.Checked +",recommend="+  chkRecommend.Checked +",hot="+  hot.Checked +",Hits='"+ Int32.Parse(this.iptViewcount.Text.Trim()) +"',addtime='"+  this.iptDatetime.Text.Trim() +"',ordernum='"+  ordernum.Text +"',yishujiaid='" + TextBox3.Text.ToString() + "',uid='" + TextBox64.Text.ToString() + "' where [Infoid]="+ id +"";
        }

        bs.user(sql);

        //if (id > 0)
        //{
        //    if (Session["AdminPassport"] != null && Session["AdminPassport"].ToString() != "")
        //    {
        //        bs.user("insert into rizhi(rz_bt,rz_nr,rz_czr,rz_time) values('批改信息','" + title.Text.Replace("'", "") + "','" + Session["AdminPassport"].ToString() + "','" + System.DateTime.Now.ToString() + "' )");

        //    }
        //}
        //else
        //{
        //    if (Session["AdminPassport"] != null && Session["AdminPassport"].ToString() != "")
        //    {
        //        bs.user("insert into rizhi(rz_bt,rz_nr,rz_czr,rz_time) values('增长信息','" + title.Text.Replace("'", "") + "','" + Session["AdminPassport"].ToString() + "','" + System.DateTime.Now.ToString() + "' )");

        //    }
        //}

        //Response.Write(cityid.SelectedValue.ToString());

        pubfun.RegisterStartupScript(Page, "PAGE", "window.location.href='" + "zInfo.aspx?ChannelId=" + this.channelid.ToString() + "';");
        return;
    }
    #endregion



    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {

 
    }




    public void up_image(int iddsd)
    {
       
         if (iddsd == 1)
            {
                    string fileFullname = this.HaodeUpload.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")
                    {
                        this.HaodeUpload.SaveAs(Server.MapPath("../../HaodeUpload/UploadedFiles") + "\\" + dataName + "." + type);
                        Pic.Text = "HaodeUpload/UploadedFiles/" + dataName + "." + type;
                        //this.txtProImg.Text = "HaodeUpload/UploadedFiles/" + dataName + "." + type;
                        // 图片蹊径

 if (DropDownList1.SelectedValue.ToString() != "选择红头文件")
                        {
                            beiyong.Visible = false;
                            Imhongtou.Visible = true;
                            Tr1.Visible = true;
                            //Tr3.Visible = true;
                        }


                    }
                    else
                    {
                        Response.Write("<script language='javascript'>alert('支持体式:|jpg|gif|bmp|');</script>");


                        if (DropDownList1.SelectedValue.ToString() != "选择红头文件")
                        {
                            beiyong.Visible = false;
                            Imhongtou.Visible = true;
                            Tr1.Visible = true;
                            //Tr3.Visible = true;
                        }

                    }

            }
            else if (iddsd == 2)
            {
                
                    string fileFullname = this.HaodeUpload1.FileName;
                    string dataName = DateTime.Now.ToString("yyyyMMddhhmmss");
                    string fileName = fileFullname.Substring(fileFullname.LastIndexOf("\\") + 1);
                    string type = fileFullname.Substring(fileFullname.LastIndexOf(".") + 1);

                    if (type == "flv" )
                    {
                        this.HaodeUpload1.SaveAs(Server.MapPath("../../HaodeUpload/UploadedFiles") + "\\" + dataName + "." + type);
                        Mov.Text = "HaodeUpload/UploadedFiles/" + dataName + "." + type;
                        //this.txtProImg.Text = "HaodeUpload/UploadedFiles/" + dataName + "." + type;
                       
                        // 图片蹊径

 if (DropDownList1.SelectedValue.ToString() != "选择红头文件")
                        {
                            beiyong.Visible = false;
                            Imhongtou.Visible = true;
                            Tr1.Visible = true;
                            //Tr3.Visible = true;
                        }

                    }
                    else
                    {
                        Response.Write("<script language='javascript'>alert('支持体式:|flv|');</script>");
                        if (DropDownList1.SelectedValue.ToString() != "选择红头文件")
                        {
                            beiyong.Visible = false;
                            Imhongtou.Visible = true;
                            Tr1.Visible = true;
                            //Tr3.Visible = true;
                        }
                    }

            }




    }
    //图片上传
    protected void Button1_Click(object sender, EventArgs e)
    {
        up_image(1);
    }
    //视频上传
    protected void Button3_Click(object sender, EventArgs e)
    {
        up_image(2);
    }
    
    protected void ImageButton6_Click(object sender, ImageClickEventArgs e)
    {
        //if (!pubfun.IsBlank(Pic.Text)) this.HaodeUpload.parentSRC = Pic.Text;
        //if (!pubfun.IsBlank(Mov.Text)) this.HaodeUpload1.parentSRC = Mov.Text;
        int classid = 0;
        classid = pubfun.GetAjaxClassId(Request.Form["ddl1"], Request.Form["ddl2"], Request.Form["ddl3"], Request.Form["ddl4"], Request.Form["ddl5"]);
        //if (classid == 0)
        //{
        //    pubfun.Alert(Page, "请选择分类!");
        //    return;
        //}
        if (pubfun.IsBlank(this.title.Text))
        {
            this.DropDownList1.SelectedValue = "选择红头文件";
            pubfun.Alert(Page, "姓名!");
            title.Focus();
            return;
        }
       


        //if (!pubfun.IsNumeric(this.iptViewcount.Text))
        //{
        //    pubfun.Alert(Page, "点击量只能是数字!");
        //    iptViewcount.Focus();
        //    return;
        //}
        //if (!pubfun.IsNumeric(this.ordernum.Text))
        //{
        //    pubfun.Alert("排序只能是数字!", -1);
        //    ordernum.Focus();
        //    return;
        //}
        if (pubfun.IsBlank(this.econtent.Text))
        {
            this.econtent.Text = "&nbsp;";
        }
        if (pubfun.IsBlank(this.content1.Value))
        {
            this.content1.Value = "&nbsp;";
        }


        //bei.Text = bei.Text + "|" + Session["AdminPassport"].ToString(); 




        string sql = "Insert Into " + col + "(channelid,Classid,cityid,title,url,bei,pic,width,height,Mov,econtent,Content,inspect,recommend,hot,Hits,addtime,ordernum,yishujiaid,uid) values(" + this.channelid + ","+ classid +",'"+ TextBox2.Text.ToString() +"','"+  title.Text.ToString() +"','"+  url.Text.ToString() +"','"+  bei.Text.ToString() +"','"+  Pic.Text.ToString() +"','"+  width.Text.ToString() +"','"+  height.Text.ToString() +"','"+  Mov.Text.ToString() +"','"+  econtent.Text.ToString() +"','"+  content1.Value +"',"+  chkPass.Checked +","+  chkRecommend.Checked +","+  hot.Checked +",'"+ Int32.Parse(this.iptViewcount.Text.Trim()) +"','"+  this.iptDatetime.Text.Trim() +"','"+  ordernum.Text +"','" + this.TextBox3.Text.ToString() + "','" + TextBox64.Text.ToString() + "')";
        if (id > 0)
        {
            sql = "update " + col + " set Classid="+ classid +",cityid='"+ TextBox2.Text.ToString() +"',title='"+  title.Text.ToString() +"',url='"+  url.Text.ToString() +"',bei='"+  bei.Text.ToString() +"',Pic='"+  Pic.Text.ToString() +"',width='"+  width.Text.ToString() +"',height='"+  height.Text.ToString() +"',Mov='"+  Mov.Text.ToString() +"',econtent='"+  econtent.Text.ToString() +"',Content='"+  content1.Value +"',inspect="+  chkPass.Checked +",recommend="+  chkRecommend.Checked +",hot="+  hot.Checked +",Hits='"+ Int32.Parse(this.iptViewcount.Text.Trim()) +"',addtime='"+  this.iptDatetime.Text.Trim() +"',ordernum='"+  ordernum.Text +"',yishujiaid='" + TextBox3.Text.ToString() + "',uid='"+ TextBox64.Text.ToString() +"'  where [Infoid]="+ id +"";
        }


        bs.user(sql);


        //if (id > 0)
        //{
        //    if (Session["AdminPassport"] != null && Session["AdminPassport"].ToString() != "")
        //    {
        //        bs.user("insert into rizhi(rz_bt,rz_nr,rz_czr,rz_time) values('批改信息','" + title.Text.Replace("'", "") + "','" + Session["AdminPassport"].ToString() + "','" + System.DateTime.Now.ToString() + "' )");

        //    }
        //}
        //else
        //{
        //    if (Session["AdminPassport"] != null && Session["AdminPassport"].ToString() != "")
        //    {
        //        bs.user("insert into rizhi(rz_bt,rz_nr,rz_czr,rz_time) values('增长信息','" + title.Text.Replace("'", "") + "','" + Session["AdminPassport"].ToString() + "','" + System.DateTime.Now.ToString() + "' )");

        //    }
        //}



        pubfun.RegisterStartupScript(Page, "PAGE", "window.location.href='" + "zInfo.aspx?ChannelId=" + this.channelid.ToString() + "';");
        return;
    }
}


#line default
#line hidden