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


Current File : D:/tmp_aspnet/root/a99112df/ca2a8923/App_Web_wh-_kcfk.11.cs
?#pragma checksum "D:\wwwroot\ldxynb\wwwroot\Back\info\Info_Add.aspx.cs" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "D457FE36078E12CC8035CF4ED0ADCC25"

#line 1 "D:\wwwroot\ldxynb\wwwroot\Back\info\Info_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_Info_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 = "info";
    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, "Info_" + 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 = false;
        Imhongtou.Visible = false;
        Tr1.Visible = false;
        Tr3.Visible = false;
        
        
    }

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

        //DataSet dt_ysj = new DataSet();

        //dt_ysj = bs.bingding("select * from info 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 HH:mm:ss");
        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();


            
            kuan.Visible = false;
            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 = Convert.ToDateTime(row["addTime"].ToString()).ToString("yyyy-MM-dd HH:mm:ss");
                this.iptViewcount.Text = row["Hits"].ToString();
                this.ordernum.Text = row["ordernum"].ToString();

                cityid.SelectedValue = row["cityid"].ToString();

                DropDownList2.SelectedValue = row["yishujiaid"].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.TextBox1.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) values(" + this.channelid + ",@Classid,@cityid,@title,@url,@bei,@Pic,@width,@height,@Mov,@econtent,@Content,@inspect,@recommend,@hot,@Hits,@addtime,@ordernum," + Int32.Parse(DropDownList2.SelectedValue.ToString()) + ")";
        if (id > 0)
        {
            sql = "update " + col + " set Classid=@classid,cityid=@cityid,title=@title,url=@url,bei=@bei,Pic=@Pic,width=@width,height=@height,Mov=@Mov,econtent=@econtent,Content=@Content,inspect=@inspect,recommend=@recommend,hot=@hot,Hits=@Hits,addtime=@addtime,ordernum=@ordernum,yishujiaid=" + Int32.Parse(DropDownList2.SelectedValue.ToString()) + " where [Infoid]=@id";
        }
        OleDbCommand cmd = this.dbc.GetCommandBySql(sql);
        cmd.Parameters.Add("@classid", OleDbType.VarChar,5).Value = classid;
        cmd.Parameters.Add("@cityid", OleDbType.VarChar, 5).Value = Int32.Parse(cityid.SelectedValue.ToString());
        cmd.Parameters.Add("@title", OleDbType.WChar).Value = this.title.Text.Trim();
        cmd.Parameters.Add("@url", OleDbType.VarChar, 500).Value = this.url.Text.Trim();
        cmd.Parameters.Add("@bei", OleDbType.VarChar, 200).Value = this.bei.Text.Trim();
        cmd.Parameters.Add("@Pic", OleDbType.VarChar, 250).Value = this.Pic.Text.Trim();
        cmd.Parameters.Add("@width", OleDbType.VarChar,5).Value = this.width.Text;
        cmd.Parameters.Add("@height", OleDbType.VarChar,5).Value = this.height.Text;
        cmd.Parameters.Add("@Mov", OleDbType.VarChar, 250).Value = this.Mov.Text.Trim();
        cmd.Parameters.Add("@econtent", OleDbType.WChar).Value = this.econtent.Text.ToString();
        cmd.Parameters.Add("@Content", OleDbType.WChar).Value = content1.Value;
        cmd.Parameters.Add("@inspect", OleDbType.Boolean).Value = this.chkPass.Checked;
        cmd.Parameters.Add("@recommend", OleDbType.Boolean).Value = this.chkRecommend.Checked;
        cmd.Parameters.Add("@hot", OleDbType.Boolean).Value = this.hot.Checked;
        cmd.Parameters.Add("@Hits", OleDbType.VarChar,5).Value = Int32.Parse(this.iptViewcount.Text.Trim());
        cmd.Parameters.Add("@addtime", OleDbType.DBTimeStamp).Value = DateTime.Parse(this.iptDatetime.Text.Trim());
        cmd.Parameters.Add("@ordernum", OleDbType.VarChar,5).Value = this.ordernum.Text;
        cmd.Parameters.Add("@id", OleDbType.VarChar, 5).Value = this.id;
        cmd.Connection.Open();
        int irows = cmd.ExecuteNonQuery();
        cmd.Connection.Close();
        cmd.Connection.Dispose();
        cmd.Dispose();
        AddInfo.Enabled=false;

        //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='" + "Info.aspx?ChannelId=" + this.channelid.ToString() + "';");
        return;
    }
    #endregion



    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {


        beiyong.Visible = true;
        Imhongtou.Visible = true;
        Tr1.Visible = true;
        ////Tr3.Visible = true;
        title.Text = "";
        if (this.DropDownList1.SelectedValue.ToString() == "选择红头文件")
        {
            Imhongtou.Visible = false;
            Tr1.Visible = false;
            Tr3.Visible = false;
            TextBox1.Text = "";
        }
        else
        {
            Imhongtou.ImageUrl = "../../images/" + DropDownList1.SelectedValue.ToString() + ".gif";
            this.TextBox1.Text = "|" + DropDownList1.SelectedValue.ToString();
        }




         if (this.DropDownList1.SelectedValue.ToString() == "公安信息")
        {
            this.TextBox1.Text = "西安铁路公安局|第55期|2014年2月21日";
            
        }

      


        

    }




    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 == "png" || type == "PNG" || 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 = true;
                            Imhongtou.Visible = true;
                            Tr1.Visible = true;
                            //Tr3.Visible = true;
                        }


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


                        if (DropDownList1.SelectedValue.ToString() != "选择红头文件")
                        {
                            beiyong.Visible = true;
                            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 = true;
                            Imhongtou.Visible = true;
                            Tr1.Visible = true;
                            //Tr3.Visible = true;
                        }

                    }
                    else
                    {
                        Response.Write("<script language='javascript'>alert('支持体式:|flv|');</script>");
                        if (DropDownList1.SelectedValue.ToString() != "选择红头文件")
                        {
                            beiyong.Visible = true;
                            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 (DropDownList1.SelectedValue.ToString() != "选择红头文件")
        {
            title.Text = title.Text + "|" + this.DropDownList1.SelectedValue.ToString() + "|" + this.TextBox1.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 = "&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) values(" + this.channelid + ",@Classid,@cityid,@title,@url,@bei,@Pic,@width,@height,@Mov,@econtent,@Content,@inspect,@recommend,@hot,@Hits,@addtime,@ordernum," + Int32.Parse(DropDownList2.SelectedValue.ToString()) + ")";
        if (id > 0)
        {
            sql = "update " + col + " set Classid=@classid,cityid=@cityid,title=@title,url=@url,bei=@bei,Pic=@Pic,width=@width,height=@height,Mov=@Mov,econtent=@econtent,Content=@Content,inspect=@inspect,recommend=@recommend,hot=@hot,Hits=@Hits,addtime=@addtime,ordernum=@ordernum,yishujiaid=" + Int32.Parse(DropDownList2.SelectedValue.ToString()) + " where [Infoid]=@id";
        }
        OleDbCommand cmd = this.dbc.GetCommandBySql(sql);
        cmd.Parameters.Add("@classid", OleDbType.VarChar, 5).Value = classid;
        cmd.Parameters.Add("@cityid", OleDbType.VarChar, 5).Value = Int32.Parse(cityid.SelectedValue.ToString());
        cmd.Parameters.Add("@title", OleDbType.WChar).Value = this.title.Text.Trim();
        cmd.Parameters.Add("@url", OleDbType.VarChar, 500).Value = this.url.Text.Trim();
        cmd.Parameters.Add("@bei", OleDbType.VarChar, 200).Value = this.bei.Text.Trim();
        cmd.Parameters.Add("@Pic", OleDbType.VarChar, 250).Value = this.Pic.Text.Trim();
        cmd.Parameters.Add("@width", OleDbType.VarChar, 5).Value = this.width.Text;
        cmd.Parameters.Add("@height", OleDbType.VarChar, 5).Value = this.height.Text;
        cmd.Parameters.Add("@Mov", OleDbType.VarChar, 250).Value = this.Mov.Text.Trim();
        cmd.Parameters.Add("@econtent", OleDbType.WChar).Value = this.econtent.Text.ToString();
        cmd.Parameters.Add("@Content", OleDbType.WChar).Value = content1.Value;
        cmd.Parameters.Add("@inspect", OleDbType.Boolean).Value = this.chkPass.Checked;
        cmd.Parameters.Add("@recommend", OleDbType.Boolean).Value = this.chkRecommend.Checked;
        cmd.Parameters.Add("@hot", OleDbType.Boolean).Value = this.hot.Checked;
        cmd.Parameters.Add("@Hits", OleDbType.VarChar, 5).Value = Int32.Parse(this.iptViewcount.Text.Trim());
        cmd.Parameters.Add("@addtime", OleDbType.DBTimeStamp).Value = DateTime.Parse(this.iptDatetime.Text.Trim());
        cmd.Parameters.Add("@ordernum", OleDbType.VarChar, 5).Value = this.ordernum.Text;
        cmd.Parameters.Add("@id", OleDbType.VarChar, 5).Value = this.id;
        cmd.Connection.Open();
        int irows = cmd.ExecuteNonQuery();
        cmd.Connection.Close();
        cmd.Connection.Dispose();
        cmd.Dispose();
        AddInfo.Enabled = false;

        //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='" + "Info.aspx?ChannelId=" + this.channelid.ToString() + "';");
        return;
    }
}


#line default
#line hidden